Beispiel #1
0
        public static string addrole(string schid, string systype, string rolename, string rolestr, string roleextstr)
        {
            if (!Com.Public.isVa(schid, ""))
            {
                return("无跨界权限;");
            }
            string ret = "";

            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.SchRole   bll   = new SchSystem.BLL.SchRole();
                    SchSystem.Model.SchRole model = new SchSystem.Model.SchRole();
                    model.RecTime     = DateTime.Now;
                    model.RecUser     = Com.SoureSession.Soureuserid;
                    model.SchId       = int.Parse(schid);
                    model.SysType     = int.Parse(systype);
                    model.RoleName    = Com.Public.SqlEncStr(rolename);
                    model.RoleStr     = rolestr;
                    model.RoleExtStr  = roleextstr;
                    model.Stat        = 1;
                    model.LastRecTime = DateTime.Now;
                    model.LastRecUser = Com.SoureSession.Soureuserid;
                    int id = bll.Add(model);
                    ret = id.ToString();
                }
                catch (Exception ex)
                {
                    ret = ex.Message;
                }
            }
            return(ret);
        }
Beispiel #2
0
        public static string addrole(string schid, string systype, string rolename, string rolestr, string roleextstr)
        {
            if (!Com.Public.isVa(schid, ""))
            {
                return("无跨界权限;");
            }
            string ret = "";

            if (Com.Session.userid == null)
            {
                ret = "expire";
            }
            else
            {
                try
                {
                    SchSystem.BLL.SchRole   bll   = new SchSystem.BLL.SchRole();
                    SchSystem.Model.SchRole model = new SchSystem.Model.SchRole();
                    model.RecTime     = DateTime.Now;
                    model.RecUser     = Com.Session.userid;
                    model.SchId       = int.Parse(schid);
                    model.SysType     = int.Parse(systype);
                    model.RoleName    = Com.Public.SqlEncStr(rolename);
                    model.RoleStr     = rolestr;
                    model.RoleExtStr  = roleextstr;
                    model.Stat        = 1;
                    model.LastRecTime = DateTime.Now;
                    model.LastRecUser = Com.Session.userid;
                    int id = bll.Add(model);
                    ret = id.ToString();
                }
                catch (Exception ex)
                {
                    ret = ex.Message;
                }
            }
            return(ret);
        }