| | |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Net.Http; |
| | | using System.Web; |
| | | using System.Web.Http; |
| | | using System.Web.Script.Serialization; |
| | | using VueWebApi.DLL.BLL; |
| | |
| | | int startNum = rows * (page - 1) + 1; //起始记录rowNum |
| | | int endNum = rows * page; //结束记录 rowNum |
| | | mes = BasicSettingBLL.OrganizationSearch(OrgCode, OrgName, OrgType, UserName,startNum,endNum,prop,order); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[组织架构查找上级单位] |
| | | /// <summary> |
| | | /// 组织架构查找上级单位 |
| | | /// </summary> |
| | | /// <param name="orgcode">组织编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "PrentOrganization")] |
| | | [HttpGet] |
| | | public HttpResponseMessage PrentOrganization(string orgcode) |
| | | { |
| | | mes = BasicSettingBLL.PrentOrganization(orgcode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region[用户所属组织] |
| | | /// <summary> |
| | | /// 用户所属组织查询 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route(template: "UserOrganization")] |
| | | [HttpGet] |
| | | public HttpResponseMessage UserOrganization() |
| | | { |
| | | mes = BasicSettingBLL.UserOrganization(); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[用户清单新增编辑] |
| | | /// <summary> |
| | | /// 用户清单新增编辑 |
| | |
| | | /// <summary> |
| | | /// 用户清单关联角色保存 |
| | | /// </summary> |
| | | /// <param name="data">提交数据对象</param> |
| | | /// <param name="usercode">用户编码</param> |
| | | /// <param name="json">提交数据对象</param> |
| | | /// <returns></returns> |
| | | [Route(template: "SaveUserAssoctRole")] |
| | | [HttpPost] |
| | | public HttpResponseMessage SaveUserAssoctRole([FromBody] dynamic json) |
| | | public HttpResponseMessage SaveUserAssoctRole(string usercode, List<RoleUserSubmit> json) |
| | | { |
| | | dynamic result = json; |
| | | //RoleUserSubmit printObj = JsonConvert.DeserializeObject<RoleUserSubmit>(result); |
| | | |
| | | JavaScriptSerializer Serializer = new JavaScriptSerializer(); |
| | | List<RoleUserSubmit> objs = new List<RoleUserSubmit>(); |
| | | objs = Serializer.Deserialize<List<RoleUserSubmit>>(result); |
| | | |
| | | JObject jo = (JObject)JsonConvert.DeserializeObject(result); |
| | | return TJson.toJson(jo); |
| | | //JavaScriptSerializer Serializer = new JavaScriptSerializer(); |
| | | //List<RoleUserSubmit> objs = new List<RoleUserSubmit>(); |
| | | //objs = Serializer.Deserialize<List<RoleUserSubmit>>(json); |
| | | mes= BasicSettingBLL.SaveUserAssoctRole(usercode, json); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region[角色类型查询] |
| | | /// <summary> |
| | | /// 角色类型查询 |
| | | /// </summary> |
| | | /// <param name="page">页码</param> |
| | | /// <param name="rows">每页显示条数</param> |
| | | /// <param name="prop">排序字段</param> |
| | | /// <param name="order">排序规则</param> |
| | | /// <returns></returns> |
| | | [Route(template: "RoleTypeSearch")] |
| | | [HttpGet] |
| | | public HttpResponseMessage RoleTypeSearch(int page = 0, int rows = 0, string prop = null, string order = null) |
| | | { |
| | | int startNum = rows * (page - 1) + 1; //起始记录rowNum |
| | | int endNum = rows * page; //结束记录 rowNum |
| | | mes = BasicSettingBLL.RoleTypeSearch(startNum, endNum, prop, order); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[角色类型新增] |
| | | /// <summary> |
| | | /// 角色类型新增 |
| | | /// </summary> |
| | | /// <param name="json">角色类型提交数据</param> |
| | | /// <returns></returns> |
| | | [Route(template: "RoleTypeAdd")] |
| | | [HttpPost] |
| | | public HttpResponseMessage RoleTypeAdd(List<ObjectData> json) |
| | | { |
| | | mes = BasicSettingBLL.RoleTypeAdd(json); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[角色类型删除] |
| | | /// <summary> |
| | | /// 角色类型删除 |
| | | /// </summary> |
| | | /// <param name="RoleTypeCode">角色类型编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "RoleTypeDelete")] |
| | | [HttpPost] |
| | | public HttpResponseMessage RoleTypeDelete(string RoleTypeCode) |
| | | { |
| | | mes = BasicSettingBLL.RoleTypeDelete(RoleTypeCode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[角色清单查询] |
| | | /// <summary> |
| | |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[角色清单新增编辑] |
| | | /// <summary> |
| | | /// 角色清单新增编辑 |
| | | /// </summary> |
| | | /// <param name="obj">提交数据对象</param> |
| | | /// <returns></returns> |
| | | [Route(template: "AddUpdateRole")] |
| | | [HttpPost] |
| | | public HttpResponseMessage AddUpdateRole([FromBody] JObject obj) |
| | | { |
| | | string RoleId = obj["RoleId"].ToString(); //角色id(主键) |
| | | string RoleCode = obj["RoleCode"].ToString(); //角色编码 |
| | | string RoleName = obj["RoleName"].ToString(); //角色名称 |
| | | string RoleTypeCode = obj["RoleTypeCode"].ToString(); //角色类型编码 |
| | | string description = obj["description"].ToString(); //角色描述 |
| | | var usercode = HttpContext.Current.Request.Cookies["navTabId"].Value.ToString(); |
| | | string OperType = obj["OperType"].ToString(); //操作类型 |
| | | mes = BasicSettingBLL.AddUpdateRole(RoleId, RoleCode, RoleName, RoleTypeCode, description, usercode, OperType); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[角色清单删除] |
| | | /// <summary> |
| | | /// 角色清单删除 |
| | | /// </summary> |
| | | /// <param name="RoleCode">角色编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeleteRole")] |
| | | [HttpPost] |
| | | public HttpResponseMessage DeleteRole(string RoleCode) |
| | | { |
| | | mes = BasicSettingBLL.DeleteRole(RoleCode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[角色清单关联用户查询] |
| | | /// <summary> |
| | | /// 角色清单关联用户查询 |
| | | /// </summary> |
| | | /// <param name="rolecode">角色编码</param> |
| | | /// <param name="usercode">用户编码</param> |
| | | /// <param name="username">用户名称</param> |
| | | /// <param name="orgcode">所属组织编码</param> |
| | | /// <param name="isrole">关联角色</param> |
| | | /// <param name="page">页码</param> |
| | | /// <param name="rows">每页显示条数</param> |
| | | /// <param name="prop">排序字段</param> |
| | | /// <param name="order">排序规则</param> |
| | | /// <returns></returns> |
| | | [Route(template: "RoleAssociationUser")] |
| | | [HttpGet] |
| | | public HttpResponseMessage RoleAssociationUser(string rolecode = null, string usercode = null, string username = null, string orgcode = null,string isrole=null, int page = 0, int rows = 0, string prop = null, string order = null) |
| | | { |
| | | int startNum = rows * (page - 1) + 1; //起始记录rowNum |
| | | int endNum = rows * page; //结束记录 rowNum |
| | | mes = BasicSettingBLL.RoleAssociationUser(rolecode, usercode, username,orgcode,isrole, startNum, endNum, prop,order); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[角色清单关联用户保存] |
| | | /// <summary> |
| | | /// 角色清单关联用户保存 |
| | | /// </summary> |
| | | /// <param name="rolecode">角色编码</param> |
| | | /// <param name="json">提交数据对象</param> |
| | | /// <returns></returns> |
| | | [Route(template: "SaveUserAssoctRole")] |
| | | [HttpPost] |
| | | public HttpResponseMessage SaveRoleAssociationUser(string rolecode, List<ObjectData> json) |
| | | { |
| | | //JavaScriptSerializer Serializer = new JavaScriptSerializer(); |
| | | //List<RoleUserSubmit> objs = new List<RoleUserSubmit>(); |
| | | //objs = Serializer.Deserialize<List<RoleUserSubmit>>(json); |
| | | mes = BasicSettingBLL.SaveRoleAssociationUser(rolecode, json); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | } |