Example #1
0
        private void BT_SeachSub_Click(object sender, EventArgs e)
        {
            if (LB_User.SelectedIndex < 0)
            {
                return;
            }
            SelectUID = List_User.Where(P => P.UserName == LB_User.SelectedItem.ToString().Trim()).Single().UserID;
            foreach (string rolename in UserManager_Client.RoleSelect_UserName(LB_User.SelectedItem.ToString()))
            {
                if (rolename.Contains("管理员") || rolename.Contains("员工"))
                {
                    MessageBox.Show("您选择的用户具有多重系统身份,该员工属于公司内部员工,该服务不向公司内部员工开放!");
                    return;
                }
            }

            WFpart.UserManagerService.User_ViewModel _TempUser   = List_User.Where(P => P.UserID == SelectUID).Single();
            WFpart.UserManagerService.aspnet_UsersEX _TempUserEX = List_UserEX.Where(P => P.User_ID == SelectUID).Single();
            Label_User.Text       = LB_User.SelectedItem.ToString();
            Label_UserName.Text   = _TempUserEX.User_RealName;
            Label_Adress.Text     = _TempUserEX.User_Adress;
            Label_Info.Text       = _TempUserEX.User_Info;
            Label_Phone.Text      = _TempUserEX.User_Phone;
            Label_Validation.Text = _TempUserEX.User_Validation;
            PL_OldUser.Visible    = false;
            PL_UserResult.Visible = true;
            RB_NewUser.Visible    = false;
            RB_OldUser.Visible    = false;
        }
Example #2
0
        private void BT_Sub_Click(object sender, EventArgs e)
        {
            if (TB_RealName.Text.Trim() == null | TB_Phone.Text.Trim() == null || TB_Validation.Text.Trim() == null)
            {
                MessageBox.Show("请完善至少前三项资料!");
                return;
            }
            else
            {
                if (List_UserEX.Where(P => P.User_Validation == TB_Validation.Text.Trim()).Count() > 0)
                {
                    MessageBox.Show("您的身份证已经注册过,请选择老账户进行订车服务!");
                    return;
                }

                if (UserManager_Client.UserReg(null, new UserManagerService.aspnet_UsersEX()
                {
                    User_RealName = TB_RealName.Text.Trim(),
                    User_Validation = TB_Validation.Text.Trim(),
                    User_Adress = TB_Adress.Text.Trim(),
                    User_Phone = TB_Phone.Text.Trim(),
                    User_Info = TB_Info.Text.Trim()
                }))
                {
                    MessageBox.Show("账号注册成功!");
                    SelectUID   = UserManager_Client.SelectUserEXInfo_All().Where(P => P.User_Validation == TB_Validation.Text.Trim()).Single().User_ID;
                    List_User   = UserManager_Client.SelectUserInfo_All().ToList();
                    List_UserEX = UserManager_Client.SelectUserEXInfo_All().ToList();
                    WFpart.UserManagerService.User_ViewModel _TempUser   = List_User.Where(P => P.UserID == SelectUID).Single();
                    WFpart.UserManagerService.aspnet_UsersEX _TempUserEX = List_UserEX.Where(P => P.User_ID == SelectUID).Single();
                    Label_UserName.Text   = _TempUserEX.User_RealName;
                    Label_Adress.Text     = _TempUserEX.User_Adress;
                    Label_Info.Text       = _TempUserEX.User_Info;
                    Label_Phone.Text      = _TempUserEX.User_Phone;
                    Label_Validation.Text = _TempUserEX.User_Validation;
                    PL_NewUser.Visible    = false;
                    PL_UserResult.Visible = true;
                    RB_NewUser.Visible    = false;
                    RB_OldUser.Visible    = false;
                }
                else
                {
                    MessageBox.Show("账号注册失败!请检查拼写,如问题依旧,请联系管理员!", "错误!!", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
                }
            }
        }
Example #3
0
 /// <summary>
 /// 用户选择框改变事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void LB_UserName_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (LB_UserName.SelectedIndex < 0)
     {
         return;
     }
     try
     {
         WFpart.UserManagerService.User_ViewModel user   = List_User.Where(P => P.UserName == LB_UserName.SelectedItem.ToString()).Single();
         WFpart.UserManagerService.aspnet_UsersEX userEX = List_UserEX.Where(P => P.User_ID == user.UserID).Single();
         TB_Answer.Text         = "为空时保持原来的值";
         TB_Password.Text       = "为空时保持原来的值";
         TB_Email.Text          = user.Email;
         TB_Question.Text       = user.Question;
         TB_RealName.Text       = userEX.User_RealName;
         TB_UserAdress.Text     = userEX.User_Adress;
         TB_UserInfo.Text       = userEX.User_Info;
         TB_UserName.Text       = user.UserName;
         TB_UserPhone.Text      = userEX.User_Phone;
         TB_UserValidation.Text = userEX.User_Validation;
     }
     catch (InvalidOperationException)
     {
         TB_Answer.Text         = "";
         TB_Email.Text          = "";
         TB_Password.Text       = "";
         TB_Question.Text       = "";
         TB_RealName.Text       = "";
         TB_UserAdress.Text     = "";
         TB_UserInfo.Text       = "";
         TB_UserName.Text       = "";
         TB_UserPhone.Text      = "";
         TB_UserValidation.Text = "";
         LB_UserName.DataSource = null;
     }
 }