Example #1
0
 private void TXTFULLNAME_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         TXTPASS.Focus();
     }
 }
Example #2
0
 private void btnsave_Click(object sender, EventArgs e)
 {
     if (TXTUSER.Text == string.Empty || TXTPASS.Text == string.Empty || TXTFULLNAME.Text == string.Empty || TXTCONFIRM.Text == string.Empty)
     {
         MessageBox.Show("برجاء ادخال جميع البيانات", "تنبيه", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     if (TXTPASS.Text != TXTCONFIRM.Text)
     {
         MessageBox.Show("برجاء ادخال كلمه السر متطابقه", "تنبيه", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     if (btnsave.Text == "حفظ المستخدم")
     {
         BL.CLS_LOGIN USER = new BL.CLS_LOGIN();
         USER.ADD_USER(TXTUSER.Text, TXTFULLNAME.Text, TXTPASS.Text, comboBox1.Text);
         MessageBox.Show("تم انشاء المستخدم بنجاح", "اضافه مستخدم جديد", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else if (btnsave.Text == "تعديل المستخدم")
     {
         BL.CLS_LOGIN USER = new BL.CLS_LOGIN();
         USER.EDITUSER(TXTUSER.Text, TXTFULLNAME.Text, TXTPASS.Text, comboBox1.Text);
         MessageBox.Show("تم تعديل المستخدم بنجاح", "  تعديل مستخدم", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     TXTUSER.Clear();
     TXTFULLNAME.Clear();
     TXTPASS.Clear();
     TXTCONFIRM.Clear();
     TXTUSER.Focus();
 }