예제 #1
0
 public MessageResult AddUserInfo(UserInfoApi userInfoApi)
 {
     try
     {
         var result = userBLL.AddUserInfo(userInfoApi.UserInfoModel, userInfoApi.UserRoleInfoModels);
         return(MessageResult.Success(result));
     }
     catch (Exception ex)
     {
         return(MessageResult.Fail(ex.Message));
     }
 }
예제 #2
0
파일: regist.cs 프로젝트: jackjet870/IM-5
        private void button1_Click(object sender, EventArgs e)
        {
            string UserId = string.Empty;

            error_username.Text  = "";
            error_password.Text  = "";
            error_password2.Text = "";
            error_identity.Text  = "";
            UserBLL udb      = new UserBLL();
            bool    bSuccess = false;

            string[] sMessage = { "", "", "", "", "", "" };
            udb.user.UserName    = username_textBox.Text;
            udb.user.PassWord1   = passwd_textbox.Text;
            udb.user.PassWord2   = passwd_textbox2.Text;
            udb.user.PhoneNumber = phonenum_textbox.Text;
            udb.user.Identity    = Identity_comboBox.Text;
            udb.user.Email       = email_textbox.Text;
            udb.user.BirthDay    = birthday_textbox.Text;
            udb.user.Sex         = sex_comboBox.Text;
            bSuccess             = udb.AddUserInfo(udb.user.UserName, udb.user.PassWord1, udb.user.PassWord2, udb.user.Email, udb.user.PhoneNumber, udb.user.BirthDay, udb.user.Identity, udb.user.Sex, ref sMessage);
            if (bSuccess)
            {
                MessageBox.Show("注册成功!");
                Close();
            }
            else
            {
                //显示错误信息
                if (string.IsNullOrEmpty(sMessage[2]))
                {
                    error_password2.Text = sMessage[4];
                }
                else
                {
                    error_password2.Text = sMessage[2];
                }

                error_password.Text = sMessage[1];

                error_identity.Text = sMessage[3];

                if (string.IsNullOrEmpty(sMessage[0]))
                {
                    error_username.Text = sMessage[5];
                }
                else
                {
                    error_username.Text = sMessage[0];
                }
            }
        }
예제 #3
0
        public MResultModel AddUserInfo(EditUserModel inputM)
        {
            MResultModel resM;

            try
            {
                _userBLL.AddUserInfo(inputM);
                resM = MResultModel.GetSuccessResultM("添加成功");
            }
            catch (ArgumentNullException ex)
            {
                resM = MResultModel.GetFailResultM(ex.Message);
            }
            catch (ArgumentException ex)
            {
                resM = MResultModel.GetFailResultM(ex.Message);
            }
            return(resM);
        }