private void Set_Data() { LoadType(); LoadMahiat(); lblCode.Text = AccountGroupBussines.Get((int)HesabType.Bank).Aouth_Code; txtDescription.Text = bank.Description; txtName.Text = bank.Name; chbPoss.Checked = bank.Poss; txtCode.Text = bank.HalfCode; txtDateEftetah.Value.FarsiSelectedDate = bank.DateEftetah; cmbType.SelectedIndex = (int)bank.Type; txtCodeShobe.Text = bank.ShobeCode; txtNameShobe.Text = bank.ShobeName; txtSahebHesab.Text = bank.DarandeName; _moein = MoeinBussines.Get(bank.MoeinAmountAvalDore); txtMoeinName.Text = _moein?.Name ?? ""; txtMoeinCode.Text = _moein?.Code ?? ""; txtAmount.Text = (Math.Abs(bank.AmountAvalDore)).ToString(); if (bank.AmountAvalDore < 0) { cmbAmountMahiat.SelectedIndex = 1; } if (bank.AmountAvalDore == 0) { cmbAmountMahiat.SelectedIndex = 0; } if (bank.AmountAvalDore > 0) { cmbAmountMahiat.SelectedIndex = 2; } if (bank.Guid == Guid.Empty) { NewCode(); } }
private SanadDetailBussines GenerateDet() { try { var tafsil = TafsilBussines.Get(_tafsilGuid); var moein = MoeinBussines.Get(_moeinGuid); var res = new SanadDetailBussines { Guid = Guid.NewGuid(), Modified = DateTime.Now, Description = txtRowDesc.Text, Debit = txtDebit.TextDecimal, Credit = txtCredit.TextDecimal, TafsilGuid = (tafsil?.Guid ?? Guid.Empty), MoeinGuid = (moein?.Guid ?? Guid.Empty), MoeinCode = moein?.Code, MoeinName = moein?.Name, TafsilCode = tafsil?.Code, TafsilName = tafsil?.Name }; return(res); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); return(null); } }
public frmMoein(Guid moeinGuid, bool Is_Show) { InitializeComponent(); moein = MoeinBussines.Get(moeinGuid); grpAccount.Enabled = Is_Show; btnFinish.Enabled = Is_Show; }
private void MnuDelete_Click(object sender, EventArgs e) { try { if (DGrid.RowCount == 0) { return; } Guid moeinGuid = (Guid)DGrid[dgGuid.Index, DGrid.CurrentRow.Index].Value; var moein = MoeinBussines.Get(moeinGuid); string message = "آیا از حذف حساب " + moein.Name + " " + "اطمینان دارید؟"; frmMessage frm = new frmMessage(EnumMessageFlag.DeleteFlag, Color.PapayaWhip, message); if (frm.ShowDialog() == DialogResult.OK) { moein = MoeinBussines.Change_Status(moeinGuid, false); if (moein.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(); } }
private void Set_Data() { LoadMahiat(); lblCode.Text = AccountGroupBussines.Get((int)HesabType.Sandouq).Aouth_Code; txtDescription.Text = safe.Description; txtName.Text = safe.Name; txtCode.Text = safe.HalfCode; _moein = MoeinBussines.Get(safe.MoeinAmountAvalDore); txtMoeinName.Text = _moein?.Name ?? ""; txtMoeinCode.Text = _moein?.Code ?? ""; txtAmount.Text = (Math.Abs(safe.AmountAvalDore)).ToString(); if (safe.AmountAvalDore < 0) { cmbAmountMahiat.SelectedIndex = 1; } if (safe.AmountAvalDore == 0) { cmbAmountMahiat.SelectedIndex = 0; } if (safe.AmountAvalDore > 0) { cmbAmountMahiat.SelectedIndex = 2; } if (safe.Guid == Guid.Empty) { NewCode(); } }
public void FillData(CustomersBussines _cus) { try { cmbType.Items.Clear(); cmbType.Items.Add(SellerType.A_Haqiqi.GetDisplay()); cmbType.Items.Add(SellerType.A_Hoqouqi.GetDisplay()); cmbType.SelectedIndex = 0; lblCode.Text = AccountGroupBussines.Get((int)HesabType.A_Haqiqi).Aouth_Code; LoadGroups(); LoadMahiat(); txtCode.Text = _cus.Half_Code; txtName.Text = _cus.Name; txtAmount.Text = (Math.Abs(_cus.Amount_AvalDore)).ToString(); txtDateBirth.Value.FarsiSelectedDate = _cus.DateBirth; txtDescription.Text = _cus.Description; moein = MoeinBussines.Get(_cus.MoeinAmountAvalDore); txtMoeinName.Text = moein?.Name ?? ""; txtMoeinCode.Text = moein?.Code ?? ""; cmbType.SelectedIndex = _cus.Type == SellerType.A_Haqiqi ? 0 : 1; if (_cus.GroupGuid != Guid.Empty) { cmbGroup.SelectedValue = _cus.GroupGuid; } else { if (cusGroupBindingSource.Count > 0) { cmbGroup.SelectedIndex = 0; } } if (_cus.Guid == Guid.Empty) { NewCode(); } if (_cus.Amount_AvalDore < 0) { cmbAmountMahiat.SelectedIndex = 1; } if (_cus.Amount_AvalDore == 0) { cmbAmountMahiat.SelectedIndex = 0; } if (_cus.Amount_AvalDore > 0) { cmbAmountMahiat.SelectedIndex = 2; } } catch (Exception ex) { frmMessage f = new frmMessage(EnumMessageFlag.ShowFlag, Color.Red, ex.Message); f.ShowDialog(); } }
private void BtnSearchMoein_Click(object sender, EventArgs e) { try { frmShow_MoeinHesab f = new frmShow_MoeinHesab(true); if (f.ShowDialog() == DialogResult.OK) { moein = MoeinBussines.Get(f.SelectedGuid); txtMoeinCode.Text = moein?.Code ?? ""; txtMoeinName.Text = moein?.Name ?? ""; } } catch (Exception exception) { frmMessage frm = new frmMessage(EnumMessageFlag.ShowFlag, Color.Red, exception.Message); frm.ShowDialog(); } }
public void FillData(SellerBussines _seller) { try { cmbType.Items.Clear(); cmbType.Items.Add(SellerType.A_Haqiqi.GetDisplay()); cmbType.Items.Add(SellerType.A_Hoqouqi.GetDisplay()); cmbType.SelectedIndex = 0; LoadMahiat(); txtCode.Text = _seller.Half_Code; txtName.Text = _seller.Name; txtDescription.Text = _seller.Description; txtResName.Text = _seller.RespName; txtEcoCode.Text = _seller.EconomyCode; txtAmount.Text = (Math.Abs(_seller.Amount_AvalDore)).ToString(); moein = MoeinBussines.Get(_seller.MoeinAmountAvalDore); txtMoeinName.Text = moein?.Name ?? ""; txtMoeinCode.Text = moein?.Code ?? ""; if (_seller.Guid == Guid.Empty) { NewCode(); } if (_seller.Amount_AvalDore < 0) { cmbAmountMahiat.SelectedIndex = 1; } if (_seller.Amount_AvalDore == 0) { cmbAmountMahiat.SelectedIndex = 0; } if (_seller.Amount_AvalDore > 0) { cmbAmountMahiat.SelectedIndex = 2; } } catch (Exception ex) { var f = new frmMessage(EnumMessageFlag.ShowFlag, Color.Red, ex.Message); f.ShowDialog(); } }
private void SetMoein() { try { var frm = new frmKolMoein(true); if (frm.ShowDialog(this) == DialogResult.OK) { var moein = MoeinBussines.Get(frm.SelectedMoeinGuid); if (moein != null) { txtMoeinName.Text = moein.Name; _moeinGuid = moein.Guid; } } } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } }
public void FillData(PerssonelBussines _perssonel) { try { lblCode.Text = AccountGroupBussines.Get((int)HesabType.A_Haqiqi).Aouth_Code; LoadGroups(); LoadMahiat(); txtCode.Text = _perssonel.Half_Code; txtName.Text = _perssonel.Name; txtAmount.Text = (Math.Abs(_perssonel.Amount_AvalDore)).ToString(); txtDateBirth.Value.FarsiSelectedDate = _perssonel.DateBirth; txtDescription.Text = _perssonel.Description; txtNatCode.Text = _perssonel.NationalCode; txtPerssonelCode.Text = _perssonel.PerssonelCode; txtPlaceBirth.Text = _perssonel.PlaceBirth; moein = MoeinBussines.Get(_perssonel.MoeinAmountAvalDore); txtMoeinName.Text = moein?.Name ?? ""; txtMoeinCode.Text = moein?.Code ?? ""; if (_perssonel.PerssonelGroup != Guid.Empty) { cmbGroup.SelectedValue = _perssonel.PerssonelGroup; } else { if (PerssonelGroupBindingSource.Count > 0) { cmbGroup.SelectedIndex = 0; } } var gender = _perssonel.Gender; if (gender == EnumGender.Male) { rbtnMale.Checked = true; } if (gender == EnumGender.Female) { rbtnFemale.Checked = true; } if (_perssonel.Guid == Guid.Empty) { NewCode(); SetPerssonelCode(); } if (_perssonel.Amount_AvalDore < 0) { cmbAmountMahiat.SelectedIndex = 1; } if (_perssonel.Amount_AvalDore == 0) { cmbAmountMahiat.SelectedIndex = 0; } if (_perssonel.Amount_AvalDore > 0) { cmbAmountMahiat.SelectedIndex = 2; } } catch (Exception ex) { frmMessage f = new frmMessage(EnumMessageFlag.ShowFlag, Color.Red, ex.Message); f.ShowDialog(); } }