示例#1
0
 private void btn_Save_Click(object sender, EventArgs e)
 {
     try
     {
         if (txt_UserName.Text != "" && txt_Password.Text != "")
         {
             if (UserComponent.checkAtiranUserName(txt_UserName.Text) == 0)
             {
                 if (txt_Password.Text.Trim().Equals(txt_ConfPassword.Text.Trim()))
                 {
                     int result = 0;
                     result = UserComponent.InserToUser(txt_UserName.Text, txt_Password.Text);
                     if (result > 0)
                     {
                         txt_UserName.Text = "";
                         txt_Password.Text = "";
                         txt_ConfPassword.Clear();
                         CustomMessageForm.CustomMessageBox.Show("پیغام", "ثبت اطلاعات با موفقیت انجام شد");
                         dataGridView1.DataSource = UserComponent.GetUsers();
                         setgridview();
                         // new by sharafzade
                         DialogResult x = Atiran.UI.WindowsForms.MessageBoxes.CustomMessageForm.CustomMessageBox.Show("پيغام", "آيا ميخواهيد براي كاربر تعريف شده، زير سيستم اختصاص دهيد؟", "w");
                         if (x == DialogResult.Yes)
                         {
                             ModuleAccessControl UAC    = new ModuleAccessControl(true, result);
                             UserControlLoader   loader = new UserControlLoader(UAC);
                         }
                     }
                     else
                     {
                         CustomMessageForm.CustomMessageBox.Show("پیغام", "خطا در ثبت اطلاعات");
                     }
                 }
                 else
                 {
                     CustomMessageForm.CustomMessageBox.Show("پیغام", "كلمه هاي عبور وارد شده مطابقت ندارد", "e");
                     txt_Password.Clear();
                     txt_ConfPassword.Clear();
                     txt_Password.Focus();
                 }
             }
             else
             {
                 CustomMessageForm.CustomMessageBox.Show("پیغام", "نام کاربری تکراری می باشد، لطفا نام کاربری دیگری انتخاب نمایید.");
             }
         }
         else
         {
             CustomMessageForm.CustomMessageBox.Show("پیغام", "نام، نام خانوادگی، نام کاربری و کلمه عبور نمی تواند خالی باشد");
         }
     }
     catch (Exception ex)
     {
         CustomMessageForm.CustomMessageBox.Show("پیغام", "خطا در ثبت اطلاعات");
     }
 }
示例#2
0
 /// <summary>
 /// Act Thread
 /// </summary>
 ///
 private void MTF_UserControlLoad_Load()
 {
     Invoke(new System.Windows.Forms.MethodInvoker(delegate()
     {
         resultKeys = HelpOperaion.ReturnAllShortcutKeys();
         dataGridView1.DataSource = resultKeys;
         SetGridView();
         txtSearch.Focus();
     }));
 }
示例#3
0
 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         panel3.Visible = true;
         USERID         = Convert.ToInt32(dataGridView1.CurrentRow.Cells[0].Value.ToString());
         var find = UserComponent.GetUserInformation(USERID);
         foreach (var item in find)
         {
             txt_EditPassword.Text = System.Text.Encoding.UTF8.GetString(item.UserPassWord);
             user = txt_EditUserName.Text = item.UserName;
         }
         panel3.Visible = true;
         txt_EditUserName.Focus();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
示例#4
0
 private void ChangePassword_Load(object sender, EventArgs e)
 {
     txt_CurrentPassword.Focus();
 }
示例#5
0
 private void CreateUser_Load(object sender, EventArgs e)
 {
     this.ActiveControl = txt_UserName;
     txt_UserName.Focus();
     txt_UserName.Select();
 }