Esempio n. 1
0
        public static string roledel(string schid, string roleid)
        {
            if (!Com.Public.isVa(schid, ""))
            {
                return("无跨界权限;");
            }
            string ret = "success";

            Com.DataPack.DataRsp <Com.DataPack.UserInfo> rsp = Com.Public.UserFuncSoure(Com.SoureSession.jsid, Com.SoureSession.jstoken);
            if (rsp.code == "ERROR_TOKEN")
            {
                ret = "expire";
            }
            else
            {
                try
                {
                    SchSystem.BLL.SchUserRole surBll = new SchSystem.BLL.SchUserRole();
                    bool surBool = surBll.ExistsRoleData(schid, roleid);
                    if (surBool)
                    {
                        ret = "success01";
                    }
                    else
                    {
                        SchSystem.BLL.SchRole   bll   = new SchSystem.BLL.SchRole();
                        SchSystem.Model.SchRole model = new SchSystem.Model.SchRole();
                        model.RoleId      = int.Parse(roleid);
                        model.Stat        = 2;
                        model.LastRecTime = DateTime.Now;
                        model.LastRecUser = Com.SoureSession.Soureuserid;
                        if (bll.UpdateStat(model))
                        {
                            ret = "success";
                        }
                        else
                        {
                            ret = "操作失败";
                        }
                    }
                }
                catch (Exception ex)
                {
                    ret = ex.Message;
                }
            }
            return(ret);
        }
Esempio n. 2
0
        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.SchUserRole surBll = new SchSystem.BLL.SchUserRole();
                    bool surBool = surBll.ExistsRoleData(schid, roleid);
                    if (surBool)
                    {
                        ret = "success01";
                    }
                    else
                    {
                        SchSystem.BLL.SchRole   bll   = new SchSystem.BLL.SchRole();
                        SchSystem.Model.SchRole model = new SchSystem.Model.SchRole();
                        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);
        }