Exemple #1
0
        public override bool Update(EmployeeEntity model)
        {
            bool isSuccessful = BusinessUserBLL.UpdateUser(model);

            if (isSuccessful == true)
            {
                isSuccessful = base.Update(model);
            }

            return(isSuccessful);
        }
Exemple #2
0
        public override bool Update(LaborEntity model)
        {
            LaborEntity originalModel = Get(model.UserGuid, true);
            bool        isSuccessful  = BusinessUserBLL.UpdateUser(model);

            if (isSuccessful == true)
            {
                //TIP:xieran2012124 保存即加锁锁定
                model.IsProtectedByOwner = Logics.True;
                isSuccessful             = base.Update(model);
            }
            OperateLogBLL.RecordOperateLog(string.Format("修改劳务人员信息{0}", isSuccessful == true ? "成功" : "失败"), "Labor", model.UserGuid.ToString(), model.UserNameDisplay, model, originalModel);

            return(isSuccessful);
        }
        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)));
        }