Ejemplo n.º 1
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();
 }
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (txtID.Text == string.Empty || txtPWD.Text == string.Empty ||
                txtFullName.Text == string.Empty || txtPWDConfirm.Text == string.Empty)
            {
                MessageBox.Show("Enter Tous Les Information", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (txtPWD.Text != txtPWDConfirm.Text)
            {
                MessageBox.Show("Les Deux Mots De Passe ne sont Pas Identiques", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (btnSave.Text == "Enregistrer")
            {
                BL.CLS_LOGIN user = new BL.CLS_LOGIN();
                user.ADD_USER(txtID.Text, txtFullName.Text, txtPWD.Text, cmbType.Text);
                MessageBox.Show("Utilisateur Crée Avec Succée", "L'ajout De Nouveau Utilisateur", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (btnSave.Text == "Modifier")
            {
                BL.CLS_LOGIN user = new BL.CLS_LOGIN();
                user.EDIT_USER(txtID.Text, txtFullName.Text, txtPWD.Text, cmbType.Text);
                MessageBox.Show("Utilisateur Modifier Avec Succée", "Modification De L'Utilisateur", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            txtID.Clear();
            txtFullName.Clear();
            txtPWD.Clear();
            txtPWDConfirm.Clear();
            txtID.Focus();
        }
Ejemplo n.º 3
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (txtID.Text == string.Empty || txtPWD.Text == string.Empty ||
                txtFullName.Text == string.Empty || txtPWDConfirm.Text == string.Empty)
            {
                MessageBox.Show("{ أدخل جميع البيانات", "تنبية", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (txtPWD.Text != txtPWDConfirm.Text)
            {
                MessageBox.Show(" كلمات السر غير متطابقة", "تنبية", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (btnSave.Text == "حفظ المستخدم")
            {
                BL.CLS_LOGIN user = new BL.CLS_LOGIN();
                user.ADD_USER(txtID.Text, txtFullName.Text, txtPWD.Text, cmpType.Text);
                MessageBox.Show("تم إضافة المستخدم بنجاح", "إضافة مستخدم جديد", MessageBoxButtons.OK, MessageBoxIcon.Information);
                Close();
            }
            else if (btnSave.Text == "تعديل المستخدم")
            {
                BL.CLS_LOGIN user = new BL.CLS_LOGIN();
                user.EDIT_USER(txtID.Text, txtFullName.Text, txtPWD.Text, cmpType.Text);
                MessageBox.Show("تم تعديل المستخدم بنجاح", "تعديل مستخدم ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                Close();
            }
            txtID.Clear();
            txtFullName.Clear();
            txtPWD.Clear();
            txtPWDConfirm.Clear();
            txtID.Focus();
        }
Ejemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtID.Text == string.Empty || txtFullName.Text == string.Empty || txtPWD.Text == string.Empty ||
                    txtPWDConfirm.Text == string.Empty)
                {
                    MessageBox.Show("FADHLAN BUUXI XOGTA OO DHAN", "QALAD", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                if (txtPWD.Text != txtPWDConfirm.Text)
                {
                    MessageBox.Show("FADHLAN LABADA ERAY ISMALAHAN", "ISKA JIR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                if (btnSave.Text == "KAYDI")
                {
                    BL.CLS_LOGIN user = new BL.CLS_LOGIN();
                    user.ADD_USER(txtID.Text, txtFullName.Text, txtPWD.Text, cmbType.Text);
                    MessageBox.Show("WAA LAGU GUULEESTAY KU DARIDA ADEEGSADAHAAN", "KU DARIDA ADEEGSADE CUSUB", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else if (btnSave.Text == "BADAL")
                {
                    BL.CLS_LOGIN user = new BL.CLS_LOGIN();
                    user.EDIT_USER(txtID.Text, txtFullName.Text, txtPWD.Text, cmbType.Text);
                    MessageBox.Show("WAA LAGU GUULEESTAY BADALIDA ADEEGSADAHAAN", "BADALID", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                txtID.Clear();
                txtFullName.Clear();
                txtPWD.Clear();
                txtPWDConfirm.Clear();


                txtID.Focus();
            }
            catch
            {
                return;
            }
        }
Ejemplo n.º 5
0
        private void btn_Enter_Click(object sender, EventArgs e)
        {
            BL.CLS_LOGIN log = new BL.CLS_LOGIN();
            DataTable    dt  = new DataTable();

            int[] USR_ACC = new int[12];
            dt = log.LOGIN(txb_userID.Text.Trim(), txb_PwdUsr.Text.Trim());
            if (dt.Rows.Count > 0)
            {
                var blockusr = Convert.ToInt32(dt.Rows[0]["BLOCK_USR"]);
                if (blockusr == 0)
                {
                    USR_ACC[1]             = Convert.ToInt16(dt.Rows[0]["ACS1"]);
                    USR_ACC[2]             = Convert.ToInt16(dt.Rows[0]["ACS2"]);
                    USR_ACC[3]             = Convert.ToInt16(dt.Rows[0]["ACS3"]);
                    USR_ACC[4]             = Convert.ToInt16(dt.Rows[0]["ACS4"]);
                    USR_ACC[5]             = Convert.ToInt16(dt.Rows[0]["ACS5"]);
                    USR_ACC[6]             = Convert.ToInt16(dt.Rows[0]["ACS6"]);
                    USR_ACC[7]             = Convert.ToInt16(dt.Rows[0]["ACS7"]);
                    USR_ACC[8]             = Convert.ToInt16(dt.Rows[0]["ACS8"]);
                    USR_ACC[9]             = Convert.ToInt16(dt.Rows[0]["ACS9"]);
                    USR_ACC[10]            = Convert.ToInt16(dt.Rows[0]["ACS10"]);
                    USR_ACC[11]            = Convert.ToInt16(dt.Rows[0]["ACS11"]);
                    BL.CLS_LOGIN.SALES_MAN = txb_userID.Text;
                    FORM_MAIN.getMainForm.tool_Backup.Enabled = true;

                    if (USR_ACC[1] == 1)
                    {
                        FORM_MAIN.getMainForm.tool_SALES.Enabled    = true;
                        FORM_MAIN.getMainForm.tool_DIRSALES.Enabled = true;
                    }
                    if (USR_ACC[2] == 1)
                    {
                        FORM_MAIN.getMainForm.tool_SALES.Enabled     = true;
                        FORM_MAIN.getMainForm.tool_MNGSALESS.Enabled = true;
                    }
                    if (USR_ACC[3] == 1)
                    {
                        FORM_MAIN.getMainForm.Tool_PURCHAES.Enabled       = true;
                        FORM_MAIN.getMainForm.Tool_DIRECTPURCHASE.Enabled = true;
                    }
                    if (USR_ACC[4] == 1)
                    {
                        FORM_MAIN.getMainForm.Tool_PURCHAES.Enabled    = true;
                        FORM_MAIN.getMainForm.Tool_MNGPURCHASE.Enabled = true;
                    }
                    if (USR_ACC[5] == 1)
                    {
                        FORM_MAIN.getMainForm.Tool_ITEMS.Enabled = true;
                    }
                    if (USR_ACC[6] == 1)
                    {
                        FORM_MAIN.getMainForm.Tool_CUSTOMER.Enabled    = true;
                        FORM_MAIN.getMainForm.Tool_ADDCUSTOMER.Enabled = true;
                    }
                    if (USR_ACC[7] == 1)
                    {
                        FORM_MAIN.getMainForm.Tool_CUSTOMER.Enabled    = true;
                        FORM_MAIN.getMainForm.Tool_MNGCUSTOMER.Enabled = true;
                    }
                    if (USR_ACC[8] == 1)
                    {
                        FORM_MAIN.getMainForm.Too_USERS.Enabled    = true;
                        FORM_MAIN.getMainForm.Tool_ADDUSER.Enabled = true;
                    }
                    if (USR_ACC[9] == 1)
                    {
                        FORM_MAIN.getMainForm.Too_USERS.Enabled     = true;
                        FORM_MAIN.getMainForm.Tool_MNGUSERS.Enabled = true;
                    }
                    if (USR_ACC[10] == 1)
                    {
                        FORM_MAIN.getMainForm.Tool_MONEY.Enabled = true;
                    }
                    if (USR_ACC[11] == 1)
                    {
                        FORM_MAIN.getMainForm.ToolStripMenuItem_REPORTS.Enabled = true;
                    }

                    FORM_MAIN.getMainForm.tool_login.Enabled = false;
                    this.Close();
                }
                else
                {
                    MessageBox.Show("هذا مستخدم تم حضره من قبل مدير النظام", "Erorr", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    Application.Exit();
                }
            }
            else
            {
                MessageBox.Show("Log Fail");
            }
        }