public static string roledel(string schid, string roleid) { if (!Com.Public.isVa(schid, "")) { return("无跨界权限;"); } string ret = "success"; if (Com.Session.userid == null) { ret = "expire"; } else { try { SchSystem.BLL.SchUserRoleXXT surBll = new SchSystem.BLL.SchUserRoleXXT(); bool surBool = surBll.ExistsRoleData(schid, roleid); if (surBool) { ret = "success01"; } else { SchSystem.BLL.SchRoleXXT bll = new SchSystem.BLL.SchRoleXXT(); SchSystem.Model.SchRoleXXT model = new SchSystem.Model.SchRoleXXT(); model.RoleId = int.Parse(roleid); model.Stat = 2; model.LastRecTime = DateTime.Now; model.LastRecUser = Com.Session.userid; if (bll.UpdateStat(model)) { ret = "success"; } else { ret = "操作失败"; } } } catch (Exception ex) { ret = ex.Message; } } return(ret); }
public static string usersave(string schid, string userid, string userroles) { string ret = ""; if (Com.Session.userid == null) { ret = "expire"; } else { try { if (string.IsNullOrEmpty(schid) || schid == "0") { ret += "非法的学校!"; } if (!Com.Public.isVa(schid, "")) { ret += "无跨界权限;"; } if (ret == "") { //添加或更新关联部门 //SchSystem.BLL.SchUserDept userdeptbll = new SchSystem.BLL.SchUserDept(); //if (userdpts == null) userdpts = "0"; //userdeptbll.DoUserDept(userid, Com.Session.userid, schid, userdpts); //添加或更新关联角色 SchSystem.BLL.SchUserRoleXXT userrolebll = new SchSystem.BLL.SchUserRoleXXT(); if (userroles == null) { userroles = "0"; } userrolebll.DoUserRole(userid, Com.Session.userid, schid, userroles); ret = "success"; } } catch (Exception ex) { ret = ex.Message; } } return(ret); }