Exemple #1
0
 private void buttonX1_Click(object sender, EventArgs e)
 {
     if (txtRoleName.Text == "")
     {
         erproles.SetError(txtRoleName, "مقداری وارد کنید ");
         txtRoleName.Focus();
     }
     else
     {
         erproles.Clear();
         if (Is_Edit)
         {
             db.UpdateRoles(RoleID, txtRoleName.Text, chkDeppo.Checked, chkBank.Checked, chkPerson.Checked, chkFactor.Checked, chkSetting.Checked, chkUsers.Checked
                            , chkIsActive.Checked, 1, 1, "1");
         }
         else
         {
             db.InsertRoles(txtRoleName.Text, chkDeppo.Checked, chkBank.Checked, chkPerson.Checked, chkFactor.Checked, chkSetting.Checked, chkUsers.Checked
                            , chkIsActive.Checked, 1, 1, "1");
             txtRoleName.Text       = string.Empty;
             chkBank.Checked        = chkDeppo.Checked = chkFactor.Checked = chkIsActive.Checked = chkPerson.Checked =
                 chkSetting.Checked = chkUsers.Checked = false;
             txtRoleName.Focus();
             MessageBoxFarsi.Show("عملیات انجام شد", "ثبت انجام شد", MessageBoxFarsiButtons.OK, MessageBoxFarsiIcon.Help);
             bsRoles_tbl.DataSource = db.FillRoles();
             ExitType = false;
         }
     }
 }
 private void buttonX6_Click(object sender, EventArgs e)
 {
     if (MessageBoxFarsi.Show("مورد حذف میشه", "حذف", MessageBoxFarsiButtons.YesNoCancel, MessageBoxFarsiIcon.Delete) == DialogResult.Yes)
     {
         db.sp_DeleteuserByID((int)(dgvShowUsers.CurrentRow.Cells[0].Value));
         binddata();
     }
 }
 private void btnDelete_Click(object sender, EventArgs e)
 {
     if (MessageBoxFarsi.Show("مورد حذف شود؟", "حذف", MessageBoxFarsiButtons.YesNoCancel, MessageBoxFarsiIcon.Delete) == DialogResult.Yes)
     {
         db.DeleteRoles((int)dgvRolls.CurrentRow.Cells[0].Value);
         bsShowRolles.DataSource = db.FillRoles();
     }
 }
Exemple #4
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     if (MessageBoxFarsi.Show("رکورد جاری حذف شود ؟", "تایید حذف", MessageBoxFarsiButtons.YesNoCancel, MessageBoxFarsiIcon.Delete, MessageBoxFarsiDefaultButton.Button1) == DialogResult.Yes)
     {
         //db.DeleteRoles((int)dgvRolls.CurrentRow.Cells[0].Value);
         //bsRoles_tbl.DataSource = db.FillRoles();
     }
 }
Exemple #5
0
 private void buttonX8_Click(object sender, EventArgs e)
 {
     if (Exists_Settings == false)
     {
         MessageBoxFarsi.Show("هیچ تنظیماتی وجود ندارد- از نرم افزار خارج میشوید", "راه اندازی", MessageBoxFarsiButtons.OK, MessageBoxFarsiIcon.Warning);
         Application.Exit();
     }
     else
     {
         this.Close();
     }
 }
Exemple #6
0
 private void buttonX2_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtCompanyName.Text == string.Empty)
         {
             erpSettings.SetError(txtCompanyName, "مقداری وارد کنید");
             txtCompanyName.Focus();
         }
         else
         {
             erpSettings.Clear();
             if (Exists_Settings == true)   // go to edit
             {
                 bsSettings_tbl.EndEdit();
                 db.UpdateSettings_tbl(txtCompanyName.Text, txtCodeEghtesadi.Text, txtCodeMelli.Text, txtCompanyAddress.Text
                                       , txtInvoicePhone.Text, txtInvtracePhone.Text, txtSmsPanelUserName.Text, txtSmsPanelPassword.Text, txtFerestandePayamak.Text,
                                       txtGirandePayamak.Text, txtHoshdarSarresidAz.Value, txtHoshdarSarresidTa.Value, txtInvtraceAddress.Text,
                                       txtMobile.Text, chkSmsTarakonesh.Checked, chkSmsFactor.Checked, txtmodiramel.Text, txtcodesabt.Text, "ax", "ax2", chkIsActive.Checked, 1, 1, "1");
             }
             else
             {
                 db.InsertSettings_tbl(txtCompanyName.Text, txtCodeEghtesadi.Text, txtCodeMelli.Text, txtCompanyAddress.Text
                                       , txtInvoicePhone.Text, txtInvtracePhone.Text, txtSmsPanelUserName.Text, txtSmsPanelPassword.Text, txtFerestandePayamak.Text,
                                       txtGirandePayamak.Text, txtHoshdarSarresidAz.Value, txtHoshdarSarresidTa.Value, txtInvtraceAddress.Text,
                                       txtMobile.Text, chkSmsTarakonesh.Checked, chkSmsFactor.Checked, txtmodiramel.Text, txtcodesabt.Text, "ax", "ax2", chkIsActive.Checked, 1, 1, "1");
             }
             MessageBoxFarsi.Show("ایجاد شد", "پیغام", MessageBoxFarsiButtons.OK, MessageBoxFarsiIcon.Information, MessageBoxFarsiDefaultButton.Button1);
             Exists_Settings = true;
         }
     }
     catch (SqlException ex)
     {
         MessageBox.Show(ex.Message);
         er.CopyError(ex.Number, ex.Message);
     }
     catch (Exception ep)
     {
         MessageBox.Show(ep.Message);
         er.CopyError2(ep.Message);
     }
 }
        public static DialogResult Ask(string text, string caption)
        {
            DialogResult dr = MessageBoxFarsi.Show(text, caption, MessageBoxFarsiButtons.OkCancel, BehComponents.MessageBoxFarsiIcon.Question);

            return(dr);
        }
 public static void Error(string text, string caption)
 {
     MessageBoxFarsi.Show(text, caption, MessageBoxFarsiButtons.OK, MessageBoxFarsiIcon.Error);
 }
 public static void Info(string text, string caption)
 {
     MessageBoxFarsi.Show(text, caption, MessageBoxFarsiButtons.OK, MessageBoxFarsiIcon.Information);
 }