Exemplo n.º 1
0
 private void Form14_Load(object sender, EventArgs e)
 {
     try {
         DataTable dt = login.user_author(Program.id, "1");
         if (Convert.ToBoolean(dt.Rows[0][4].ToString()) == false)
         {
             button13.Visible = false;
         }
     } catch (Exception er) { }
 }
        private void b1_Click(object sender, EventArgs e)
        {
            if (text1.Text == string.Empty || text2.Text == string.Empty || text3.Text == string.Empty || text4.Text == string.Empty)
            {
                MessageBox.Show("الرجاء ادخل جميع البيانات", "  تنبية", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (text3.Text != text4.Text)
            {
                MessageBox.Show("كلمة السر غيرمتطابقة", "  تنبية", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (b1.Text == "اضافة")
            {
                BL.CLS_LOGIN user = new BL.CLS_LOGIN();
                user.ADD_USER(text1.Text, text2.Text, text3.Text, com1.Text);
                user.user_author(Convert.ToBoolean(checkBox1.Checked));
                MessageBox.Show("تم اضافة المستخدم بنجاح", "اضافة مستخدم جديد", MessageBoxButtons.OK, MessageBoxIcon.Information);
              


            }
            else if (b1.Text == "تعديل")
            {
                BL.CLS_LOGIN user = new BL.CLS_LOGIN();
                user.EDIT_USER(text1.Text, text2.Text, text3.Text, com1.Text);
                MessageBox.Show("تم تعديل المستخدم بنجاح", "تعديل مستخدم جديد", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            text1.Clear();
            text2.Clear();
            text3.Clear();
            text4.Clear();
            text1.Focus();

        }