public static bool Validate(MoneyReception moneyReception) { if (string.IsNullOrEmpty(moneyReception.Value.ToString())) { Methods.ShowStandardMsgBox (FormMessageType.Error, RscError.ValidationTitle, "لطفا مبلغ نقدی را مشخص بفرمایید."); return false; } if (moneyReception.RecieverId == 0) { Methods.ShowStandardMsgBox (FormMessageType.Error, RscError.ValidationTitle, "لطفا محل واریز را مشخص بفرمایید."); return false; } if (moneyReception.Date.Year > 2020 || moneyReception.Date.Year < 2000) { Methods.ShowStandardMsgBox (FormMessageType.Error, RscError.ValidationTitle, "لطفا تاریخ صحیحی را برای دریافت نقدی مشخص بفرمایید."); return false; } return true; }
private void SetMoneyRecieverToDefaultSafe(MoneyReception moneyReception) { moneyReception.RecieverId = 77; }
private void AddMoneyToList(MoneyReception moneyReception) { ReceptionDocument receptionDocument = srcReceptionDocument.DataSource as ReceptionDocument; receptionDocument.MoneyReceptions.Add(moneyReception); grvCashes.DataSource = receptionDocument.MoneyReceptions; }
public static bool Validate(MoneyReception moneyReception) { if (string.IsNullOrEmpty(moneyReception.Value.ToString())) { Methods.ShowStandardMsgBox (FormMessageType.Error, RscError.ValidationTitle, "لطفا مبلغ چک را مشخص بفرمایید."); return false; } if (moneyReception.RecieverId==0) { Methods.ShowStandardMsgBox (FormMessageType.Error, RscError.ValidationTitle, "لطفا محل واریز را مشخص بفرمایید."); return false; } return true; }
private void ClearCashForm() { grvCashes.CurrentRow = null; MoneyReception moneyReception = new MoneyReception(); moneyReception.Context = DataLayer.GetContext(); srcMoneyReception.DataSource = moneyReception; btnNewCash.Enabled = false; btnAddCash.Enabled = true; dpMoneyReception.SelectedDateTime = DateTime.Now; txtCashValue.Focus(); }
private void CreateReceptionDocumentCreditAndSave(Bank[] banks) { for (int i = 0; i < banks.Length; i++) { ReceptionDocument receptionDocument = new ReceptionDocument(); receptionDocument.Date = DateTime.Now; receptionDocument.PageSerial = DataLayer.GetMoneyReceptionSheetSerial(); receptionDocument.PayerId = 77; receptionDocument.Type = (int)DocumentType.BankCredit; MoneyReception moneyReception = new MoneyReception(); moneyReception.Date = DateTime.Now; moneyReception.Description = String.Format("{1}-{0}", "اختصاص موجودی برای حساب بانکی ", banks[i].AccountantEntity.Name); moneyReception.RecieverId = 77; moneyReception.Value = banks[i].Value; receptionDocument.MoneyReceptions.Add(moneyReception); DataLayer.Insert(receptionDocument); } DataLayer.Save(); }
/// <summary> /// Deprecated Method for adding a new object to the MoneyReceptions EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToMoneyReceptions(MoneyReception moneyReception) { base.AddObject("MoneyReceptions", moneyReception); }
/// <summary> /// Create a new MoneyReception object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="value">Initial value of the Value property.</param> /// <param name="recieverId">Initial value of the RecieverId property.</param> /// <param name="receptionDocumentId">Initial value of the ReceptionDocumentId property.</param> public static MoneyReception CreateMoneyReception(global::System.Int32 id, global::System.Double value, global::System.Int32 recieverId, global::System.Int32 receptionDocumentId) { MoneyReception moneyReception = new MoneyReception(); moneyReception.Id = id; moneyReception.Value = value; moneyReception.RecieverId = recieverId; moneyReception.ReceptionDocumentId = receptionDocumentId; return moneyReception; }
private void AddMoneyToList(MoneyReception moneyReception, ReceptionDocument receptionDocument) { receptionDocument.MoneyReceptions.Add(moneyReception); grvCashes.DataSource = receptionDocument.MoneyReceptions; }
private void ClearPage() { grvItems.CurrentRow = null; dpDocumentDate.SelectedDateTime = DateTime.Now; dpPayDate.SelectedDateTime = DateTime.Now; ReceptionDocument receptionDocument = new ReceptionDocument(); receptionDocument.Type =(int) DocumentType.MoneyReception; receptionDocument.Context = DataLayer.GetContext(); srcDocument.DataSource = receptionDocument; MoneyReception moneyReception = new MoneyReception(); moneyReception.Context = DataLayer.GetContext(); srcMoney.DataSource = moneyReception; receptionDocument.MoneyReceptions.Add(moneyReception); cmbPayer.SelectedItem = null; cmbReciever.SelectedItem = null; cmbPayer.Enabled = true; dpPayDate.Enabled = true; dpDocumentDate.Enabled = true; btnNewPage.Enabled = false; btnAddPage.Enabled = true; }