コード例 #1
0
        public ActionResult UserInfo(int Id, string LoginPwd)
        {
            var userBLL = new Pharos.Sys.BLL.SysUserInfoBLL();
            var model   = userBLL.GetModelByUID(CurrentUser.UID);

            model.LoginPwd = LoginPwd;
            var result = userBLL.UpdateUser(model);

            return(Content(result.ToJson()));
        }
コード例 #2
0
        public ActionResult UserInfo()
        {
            var userBll = new Pharos.Sys.BLL.SysUserInfoBLL();
            var model   = userBll.GetModelByUID(Sys.CurrentStoreUser.UID);
            List <SelectListItem> storeRoles = null;

            if (!Sys.CurrentStoreUser.StoreId.IsNullOrEmpty())
            {
                var user = userBll.GetStoreUser(Sys.CurrentStoreUser.StoreId, null, 0).FirstOrDefault(o => o.UID == Sys.CurrentStoreUser.UID);
                if (user != null && !user.OperateAuth.IsNullOrEmpty())
                {
                    var auths = user.OperateAuth.Split('|');
                    storeRoles = new List <SelectListItem>();
                    foreach (var o in auths)
                    {
                        if (o.IsNullOrEmpty())
                        {
                            continue;
                        }
                        if (o.StartsWith(Sys.CurrentStoreUser.StoreId + ","))
                        {
                            var role = o.Substring(o.LastIndexOf(',') + 1);
                            storeRoles.Add(new SelectListItem()
                            {
                                Value    = role,
                                Text     = role == "1" ? "店长" : role == "2" ? "营业员" : role == "3" ? "收银员" : "数据维护",
                                Selected = true
                            });
                        }
                    }
                }
            }
            //ViewBag.BumenTitle = new Pharos.Sys.BLL.SysDepartmentBLL().GetModelByDepId(model.BumenId).Title;
            //ViewBag.PositionTitle = new Pharos.Sys.BLL.SysDataDictionaryBLL().GetExtModelByDicSN(model.PositionId).Title;
            var roleBLL     = new Pharos.Sys.BLL.SysRoleBLL();
            var roleIdArray = model.RoleIds.Split(',');
            var roleTitle   = string.Empty;
            var roleStr     = string.Empty;

            foreach (var item in roleIdArray)
            {
                roleTitle = roleBLL.GetModelByRoleId(int.Parse(item)).Title;
                if (string.IsNullOrEmpty(roleStr))
                {
                    roleStr = roleTitle;
                }
                else
                {
                    roleStr += "、" + roleTitle;
                }
            }
            ViewBag.RoleStr    = roleStr;
            ViewBag.StoreRoles = storeRoles;
            return(View(model));
        }