Esempio n. 1
0
        public ActionResult Add(PcAndRole model)
        {
            Utility.ReturnData <string> returnData = new Utility.ReturnData <string>();
            long      count   = bll.GetQueryCount(x => x.UserName == model.UserName && x.Status != 1);
            UserBasic ubModel = new UserBasic();

            ubModel.NickName     = model.UserName;
            ubModel.UserType     = 1;
            ubModel.AddTime      = DateTime.Now;
            ubModel.EnterpriseID = LoginUser.UserBasic.EnterpriseID;
            long   id      = ubBll.AddAndGetId(ubModel);
            UserPC upModel = new UserPC();

            upModel.UserName       = model.UserName;
            upModel.UserBasicID    = id;
            upModel.RoleID         = model.RoleID;
            upModel.PCType         = 1;
            upModel.AddTime        = DateTime.Now;
            upModel.PassWord       = SimpleEncrypt.SaltMD5(model.PassWord.Replace(" ", ""));
            upModel.AddUserBasicID = LoginUser.UserBasicID;
            upModel.Status         = 0;
            returnData             = bll.AddUserPc(upModel);
            if (returnData.Status == false)
            {
                ubBll.Delete(s => s.ID == id);
                return(Content(returnData.Message));
            }
            return(Content(returnData.Message));
        }
Esempio n. 2
0
        public ActionResult Delete(int id)
        {
            RolePowerBll rp = new RolePowerBll();

            Utility.ReturnData <string> returnData = new Utility.ReturnData <string>();

            long check = bll.GetCountByRoleId(id);

            if (check > 0)
            {
                return(Content("角色存在关联,不能删除!"));
            }
            UserRole model = bll.FindUserRoleByID(id);

            returnData = bll.DeleteUserRole(model);
            rp.Delete(x => x.UserRoleID == id);
            if (returnData.Message == "删除成功!")
            {
                return(Content(returnData.Message));
            }
            else
            {
                return(Content(returnData.Message));
            }
        }
Esempio n. 3
0
        public ActionResult ChangePwd(string pwd, int id)
        {
            Utility.ReturnData <string> returnData = new Utility.ReturnData <string>();
            UserPC model = bll.GetModelById(id);

            model.PassWord = SimpleEncrypt.SaltMD5(pwd.Replace(" ", ""));
            returnData     = bll.UpdateUserPc(model);
            if (returnData.Message == "编辑成功!")
            {
                return(Content("重置成功!"));
            }
            else
            {
                return(Content(returnData.Message));
            }
        }
Esempio n. 4
0
        public ActionResult EditPwd(string oldpwd, string pwd)
        {
            Utility.ReturnData <string> ret = new Utility.ReturnData <string>();
            long   id       = LoginUser.UserBasicID;
            UserPC model    = bll.GetModelById(id);
            string checkpwd = SimpleEncrypt.SaltMD5(oldpwd.Replace(" ", ""));

            if (model.PassWord != checkpwd)
            {
                return(Content("原始密码不正确!"));
            }
            model.PassWord = SimpleEncrypt.SaltMD5(pwd.Replace(" ", ""));
            bll.Update(model);

            return(Content("修改成功!"));
        }
Esempio n. 5
0
 public ActionResult Add(UserRole model)
 {
     Utility.ReturnData <string> returnData = new Utility.ReturnData <string>();
     model.Addtime        = DateTime.Now;
     model.AddUserBasicID = LoginUser.UserBasicID;
     model.EnterpriseID   = LoginUser.UserBasic.EnterpriseID;
     returnData           = bll.AddOrUpdateUserRole(model);
     if (returnData.Message == "添加成功!")
     {
         return(Content(returnData.Message));
     }
     else
     {
         return(Content(returnData.Message));
     }
 }
Esempio n. 6
0
        public ActionResult Delete(int id)
        {
            Utility.ReturnData <string> returnData = new Utility.ReturnData <string>();
            UserPC model = bll.GetModelById(id);

            ubBll.Delete(s => s.ID == id);
            model.Status = 1;
            returnData   = bll.UpdateUserPc(model);
            if (returnData.Message == "编辑成功!")
            {
                return(Content("删除成功!"));
            }
            else
            {
                return(Content(returnData.Message));
            }
        }
Esempio n. 7
0
        public ActionResult Add(UserRole model)
        {
            Utility.ReturnData<string> returnData = new Utility.ReturnData<string>();
            model.Addtime = DateTime.Now;
            model.AddUserBasicID = LoginUser.UserBasicID;
            model.EnterpriseID = LoginUser.UserBasic.EnterpriseID;
            returnData = bll.AddOrUpdateUserRole(model);
            if (returnData.Message=="添加成功!")
            {
                return Content(returnData.Message);
            }
            else
            {
                return Content(returnData.Message);
            }

        }
Esempio n. 8
0
        public ActionResult EditPwd(string oldpwd, string pwd)
        {
            Utility.ReturnData<string> ret = new Utility.ReturnData<string>();
            long id = LoginUser.UserBasicID;
            UserPC model = bll.GetModelById(id);
            string checkpwd = SimpleEncrypt.SaltMD5(oldpwd.Replace(" ", ""));
            if (model.PassWord != checkpwd)
            {
                return Content("原始密码不正确!");
            }
            model.PassWord = SimpleEncrypt.SaltMD5(pwd.Replace(" ", ""));
            bll.Update(model);

            return Content("修改成功!");



        }
Esempio n. 9
0
        public ActionResult Update(UserPC model)
        {
            Utility.ReturnData <string> returnData = new Utility.ReturnData <string>();
            UserPC ucModel = bll.GetModelById(model.UserBasicID);

            ucModel.RoleID         = model.RoleID;
            ucModel.UserName       = model.UserName;
            ucModel.AddTime        = DateTime.Now;
            ucModel.AddUserBasicID = LoginUser.UserBasicID;
            returnData             = bll.UpdateUserPc(ucModel);
            if (returnData.Message == "编辑成功!")
            {
                return(Content(returnData.Message));
            }
            else
            {
                return(Content(returnData.Message));
            }
        }
Esempio n. 10
0
        public ActionResult UpdateList(string id, int roleid)
        {
            Utility.ReturnData <string> returnData = new Utility.ReturnData <string>();
            string[] ids = id.Substring(0, id.Length - 1).Split(',');

            UserPC model = new UserPC();

            for (int i = 0; i < ids.Length; i++)
            {
                model        = bll.GetModelById(Convert.ToInt32(ids[i]));
                model.RoleID = roleid;
                returnData   = bll.UpdateUserPc(model);
            }
            if (returnData.Message == "编辑成功!")
            {
                return(Content("关联成功!"));
            }


            return(Content(returnData.Message));
        }
Esempio n. 11
0
        public JsonResult CreateAfter(ShopInfo model)
        {
            Utility.ReturnData <string> returnData = new Utility.ReturnData <string>();
            ShopInfoBll shopBll = new ShopInfoBll();
            UserPC      _model  = CacheHelp.Get("user") as UserPC;

            model.Relation     = 1;
            model.ContactPhone = "";
            model.Address      = "";
            model.Range        = "";
            model.shopIMG      = "";
            model.WeixinMPID   = 0;
            model.Remarks      = "";
            model.AgentID      = 0;
            model.ContactTEL   = "";
            model.Status       = 2;
            model.ProvinceID   = model.ProvinceID;
            model.CityID       = model.CityID;
            model.CountyID     = model.CountyID;
            model.EnterpriseID = LoginUser.UserBasic.EnterpriseID;
            returnData         = shopBll.Create(model);
            return(Json(returnData));
        }
Esempio n. 12
0
        public ActionResult DeleteList(string id)
        {
            Utility.ReturnData <string> returnData = new Utility.ReturnData <string>();
            string[] ids = id.Substring(0, id.Length - 1).Split(',');

            UserPC model = new UserPC();

            for (int i = 0; i < ids.Length; i++)
            {
                int j = Convert.ToInt32(ids[i]);
                ubBll.Delete(s => s.ID == j);
                model        = bll.GetModelById(Convert.ToInt32(ids[i]));
                model.Status = 1;
                returnData   = bll.UpdateUserPc(model);
            }
            if (returnData.Message == "编辑成功!")
            {
                return(Content("删除成功!"));
            }


            return(Content(returnData.Message));
        }
Esempio n. 13
0
 public ActionResult Delete(int id)
 {
     RolePowerBll rp=new RolePowerBll();
     Utility.ReturnData<string> returnData = new Utility.ReturnData<string>();
    
     long check = bll.GetCountByRoleId(id);
     if (check > 0)
     {
         return Content("角色存在关联,不能删除!");
     }
     UserRole model = bll.FindUserRoleByID(id);
      returnData = bll.DeleteUserRole(model);
    rp.Delete(x=>x.UserRoleID==id);
     if (returnData.Message=="删除成功!")
     {
         return Content(returnData.Message);
     }
     else
     {
         return Content(returnData.Message);
     }
     
 }
Esempio n. 14
0
 public ActionResult Add(PcAndRole model)
 {
     Utility.ReturnData<string> returnData = new Utility.ReturnData<string>();
     long count = bll.GetQueryCount(x => x.UserName == model.UserName && x.Status != 1);
     UserBasic ubModel = new UserBasic();
     ubModel.NickName = model.UserName;
     ubModel.UserType = 1;
     ubModel.AddTime = DateTime.Now;
     ubModel.EnterpriseID = LoginUser.UserBasic.EnterpriseID;
     long id = ubBll.AddAndGetId(ubModel);
     UserPC upModel = new UserPC();
     upModel.UserName = model.UserName;
     upModel.UserBasicID = id;
     upModel.RoleID = model.RoleID;
     upModel.PCType = 1;
     upModel.AddTime = DateTime.Now;
     upModel.PassWord = SimpleEncrypt.SaltMD5(model.PassWord.Replace(" ", ""));
     upModel.AddUserBasicID = LoginUser.UserBasicID;
     upModel.Status = 0;
     returnData = bll.AddUserPc(upModel);
     if (returnData.Status == false)
     {
         ubBll.Delete(s => s.ID == id);
         return Content(returnData.Message);
     }
     return Content(returnData.Message);
 }
Esempio n. 15
0
 public ActionResult ChangePwd(string pwd, int id)
 {
     Utility.ReturnData<string> returnData = new Utility.ReturnData<string>();
     UserPC model = bll.GetModelById(id);
     model.PassWord = SimpleEncrypt.SaltMD5(pwd.Replace(" ", ""));
     returnData = bll.UpdateUserPc(model);
     if (returnData.Message == "编辑成功!")
     {
         return Content("重置成功!");
     }
     else
     {
         return Content(returnData.Message);
     }
 }
Esempio n. 16
0
        public ActionResult Delete(int id)
        {
            Utility.ReturnData<string> returnData = new Utility.ReturnData<string>();
            UserPC model = bll.GetModelById(id);

            ubBll.Delete(s => s.ID == id);
            model.Status = 1;
            returnData = bll.UpdateUserPc(model);
            if (returnData.Message == "编辑成功!")
            {
                return Content("删除成功!");
            }
            else
            {
                return Content(returnData.Message);
            }
        }
Esempio n. 17
0
        public ActionResult DeleteList(string id)
        {
            Utility.ReturnData<string> returnData = new Utility.ReturnData<string>();
            string[] ids = id.Substring(0, id.Length - 1).Split(',');

            UserPC model = new UserPC();

            for (int i = 0; i < ids.Length; i++)
            {
                int j = Convert.ToInt32(ids[i]);
                ubBll.Delete(s => s.ID == j);
                model = bll.GetModelById(Convert.ToInt32(ids[i]));
                model.Status = 1;
                returnData = bll.UpdateUserPc(model);
            }
            if (returnData.Message == "编辑成功!")
            {
                return Content("删除成功!");
            }


            return Content(returnData.Message);
        }
Esempio n. 18
0
        public ActionResult UpdateList(string id, int roleid)
        {

            Utility.ReturnData<string> returnData = new Utility.ReturnData<string>();
            string[] ids = id.Substring(0, id.Length - 1).Split(',');

            UserPC model = new UserPC();

            for (int i = 0; i < ids.Length; i++)
            {
                model = bll.GetModelById(Convert.ToInt32(ids[i]));
                model.RoleID = roleid;
                returnData = bll.UpdateUserPc(model);
            }
            if (returnData.Message == "编辑成功!")
            {
                return Content("关联成功!");
            }


            return Content(returnData.Message);
        }
Esempio n. 19
0
        public ActionResult Update(UserPC model)
        {
            Utility.ReturnData<string> returnData = new Utility.ReturnData<string>();
            UserPC ucModel = bll.GetModelById(model.UserBasicID);
            ucModel.RoleID = model.RoleID;
            ucModel.UserName = model.UserName;
            ucModel.AddTime = DateTime.Now;
            ucModel.AddUserBasicID = LoginUser.UserBasicID;
            returnData = bll.UpdateUserPc(ucModel);
            if (returnData.Message == "编辑成功!")
            {
                return Content(returnData.Message);
            }
            else
            {
                return Content(returnData.Message);
            }


        }
Esempio n. 20
0
 public JsonResult CreateAfter(ShopInfo model)
 {
     Utility.ReturnData<string> returnData = new Utility.ReturnData<string>();
     ShopInfoBll shopBll = new ShopInfoBll();
     UserPC _model = CacheHelp.Get("user") as UserPC;
     model.Relation = 1;
     model.ContactPhone = "";
     model.Address = "";
     model.Range = "";
     model.shopIMG = "";
     model.WeixinMPID = 0;
     model.Remarks = "";
     model.AgentID = 0;
     model.ContactTEL = "";
     model.Status = 2;
     model.ProvinceID = model.ProvinceID;
     model.CityID = model.CityID;
     model.CountyID = model.CountyID;
     model.EnterpriseID = LoginUser.UserBasic.EnterpriseID;
     returnData = shopBll.Create(model);
     return Json(returnData);
 }