Пример #1
0
        public override EmployeeEntity Get(Guid modelID)
        {
            BusinessUser   businessUser  = BusinessUserBLL.Get(modelID);
            EmployeeEntity entity        = Converter.InheritedEntityConvert <BusinessUser, EmployeeEntity>(businessUser);
            EmployeeEntity entityPartial = base.Get(modelID);

            entity = ReflectHelper.CopyMemberValue <EmployeeEntity, EmployeeEntity>(entityPartial, entity, true);

            return(entity);
        }
Пример #2
0
        public override LaborEntity Get(Guid modelID, bool isForceUseNoCache)
        {
            BusinessUser businessUser  = BusinessUserBLL.Get(modelID, isForceUseNoCache);
            LaborEntity  entity        = Converter.InheritedEntityConvert <BusinessUser, LaborEntity>(businessUser);
            LaborEntity  entityPartial = base.Get(modelID, isForceUseNoCache);

            entity = ReflectHelper.CopyMemberValue <LaborEntity, LaborEntity>(entityPartial, entity, true);

            return(entity);
        }
Пример #3
0
        public ActionResult UChangePassword(string userGuid, string userName = "", string returnUrl = StringHelper.Empty)
        {
            BusinessUser businessUser = BusinessUserBLL.Get(userGuid);

            if (string.IsNullOrWhiteSpace(userName))
            {
                userName = businessUser.UserName;
            }
            this.ViewBag.ReturnUrl = returnUrl;
            return(View(businessUser));
        }
        public ActionResult UserItem(string enterpriseKey, string itemKey = StringHelper.Empty)
        {
            BusinessUser user = BusinessUser.Empty;

            if (GuidHelper.IsInvalidOrEmpty(itemKey) == false)
            {
                user = BusinessUserBLL.Get(new Guid(itemKey));
            }

            this.ViewBag.EnterpriseKey = enterpriseKey;

            return(View(user));
        }
        public ActionResult UserItem(string enterpriseKey, string itemKey, BusinessUser originalEntity)
        {
            bool         isSuccessful   = false;
            string       displayMessage = string.Empty;
            BusinessUser targetUser     = null;

            if (GuidHelper.IsInvalidOrEmpty(itemKey) == true)
            {
                targetUser = new BusinessUser();

                targetUser.EnterpriseKey = enterpriseKey;
                targetUser.UserType      = UserTypes.Broker;
                targetUser.Password      = SystemConst.InitialUserPassword;

                SetTargetUserEntityValue(originalEntity, ref targetUser);

                CreateUserRoleStatuses createStatus = CreateUserRoleStatuses.Successful;
                BusinessUserBLL.CreateUser(targetUser, out createStatus);
                if (createStatus == CreateUserRoleStatuses.Successful)
                {
                    isSuccessful = true;
                }
            }
            else
            {
                targetUser = BusinessUserBLL.Get(new Guid(itemKey));

                SetTargetUserEntityValue(originalEntity, ref targetUser);
                isSuccessful = BusinessUserBLL.UpdateUser(targetUser);
            }

            if (isSuccessful == true)
            {
                displayMessage = "数据保存成功";
            }
            else
            {
                displayMessage = "数据保存失败";
            }

            return(Json(new LogicStatusInfo(isSuccessful, displayMessage)));
        }
Пример #6
0
        private void PassCurrentUser()
        {
            string currentUserName = string.Empty;
            bool   isAuthenticated = this.Request.RequestContext.HttpContext.User.Identity.IsAuthenticated;

            if (isAuthenticated == true)
            {
                currentUserName = this.Request.RequestContext.HttpContext.User.Identity.Name;
            }

            if (string.IsNullOrWhiteSpace(currentUserName) == true)
            {
                UserCookie userCookie = UserCookie.Load <UserCookie>();
                currentUserName = userCookie.UserName;
            }

            BusinessUser currentUser = BusinessUserBLL.Get(currentUserName);

            this.ViewBag.CurrentUser = currentUser;
        }