Exemple #1
0
 public frmKol(Guid kolGuid, bool Is_Show)
 {
     InitializeComponent();
     kol = KolBussines.Get(kolGuid);
     grpAccount.Enabled = Is_Show;
     btnFinish.Enabled  = Is_Show;
 }
 private void MnuDelete_Click(object sender, EventArgs e)
 {
     try
     {
         if (DGrid.RowCount == 0)
         {
             return;
         }
         Guid       kol_Guid = (Guid)DGrid[dgGuid.Index, DGrid.CurrentRow.Index].Value;
         var        kol      = KolBussines.Get(kol_Guid);
         string     message  = "آیا از حذف حساب " + kol.Name + " " + "اطمینان دارید؟";
         frmMessage frm      = new frmMessage(EnumMessageFlag.DeleteFlag, Color.PapayaWhip, message);
         if (frm.ShowDialog() == DialogResult.OK)
         {
             kol = KolBussines.Change_Status(kol_Guid, false);
             if (kol.Save())
             {
                 frmMessage f = new frmMessage(EnumMessageFlag.ShowFlag, Color.Green, "عملیات با موفقیت انجام شد");
                 f.ShowDialog();
                 LoadData();
             }
         }
     }
     catch (Exception exception)
     {
         frmMessage frm = new frmMessage(EnumMessageFlag.ShowFlag, Color.Red, exception.Message);
         frm.ShowDialog();
     }
 }
Exemple #3
0
        private void TxtKolCode_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                if (txtKolName.Text != "")
                {
                    txtSetter.KeyDown(sender, e, btnFinish);
                    return;
                }

                if (e.KeyCode == Keys.Enter)
                {
                    frmShow_Kol f = new frmShow_Kol(true);
                    f.SearchText = txtKolCode.Text.Trim();
                    if (f.ShowDialog() == DialogResult.OK)
                    {
                        kol             = KolBussines.Get(f.SelectedGuid);
                        txtKolCode.Text = kol?.Code ?? "";
                        txtKolName.Text = kol?.Name ?? "";
                        if (moein.Guid == Guid.Empty)
                        {
                            NewCode(kol.Guid);
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                frmMessage frm = new frmMessage(EnumMessageFlag.ShowFlag, Color.Red, exception.Message);
                frm.ShowDialog();
            }
        }
Exemple #4
0
 private void Set_Data()
 {
     cmbMahiat.Items.Add(EnumMahiat.Bedehkar.GetDisplay());
     cmbMahiat.Items.Add(EnumMahiat.Bestankar.GetDisplay());
     cmbMahiat.Items.Add(EnumMahiat.BedAndBes.GetDisplay());
     cmbMahiat.SelectedIndex = (int)moein.Mahiat;
     txtDescription.Text     = moein.Description;
     txtCode.Text            = moein.Half_Code;
     txtName.Text            = moein.Name;
     if (moein.KolGuid != Guid.Empty)
     {
         txtKolCode.Text = KolBussines.Get(moein.KolGuid).Code;
         txtKolName.Text = KolBussines.Get(moein.KolGuid).Name;
     }
     if (moein.Guid == Guid.Empty)
     {
         NewCode(kol.Guid);
     }
 }
Exemple #5
0
 private void BtnSearchKol_Click(object sender, EventArgs e)
 {
     try
     {
         frmShow_Kol f = new frmShow_Kol(true);
         if (f.ShowDialog() == DialogResult.OK)
         {
             kol             = KolBussines.Get(f.SelectedGuid);
             txtKolCode.Text = kol?.Code ?? "";
             txtKolName.Text = kol?.Name ?? "";
             if (moein.Guid == Guid.Empty)
             {
                 NewCode(kol.Guid);
             }
         }
     }
     catch (Exception exception)
     {
         frmMessage frm = new frmMessage(EnumMessageFlag.ShowFlag, Color.Red, exception.Message);
         frm.ShowDialog();
     }
 }