Esempio n. 1
0
        public static bool Validate(MoneyPayment moneyPayment)
        {
            if (string.IsNullOrEmpty(moneyPayment.Value.ToString()))
            {
                Methods.ShowStandardMsgBox
                    (FormMessageType.Error, RscError.ValidationTitle, "لطفا مبلغ چک را مشخص بفرمایید.");
                return false;
            }

            if (moneyPayment.PayerId == 0)
            {
                Methods.ShowStandardMsgBox
                    (FormMessageType.Error, RscError.ValidationTitle, "لطفا محل برداشت را مشخص بفرمایید.");
                return false;
            }

            if (moneyPayment.Date.Year > 2020 || moneyPayment.Date.Year < 2000)
            {
                Methods.ShowStandardMsgBox
                    (FormMessageType.Error, RscError.ValidationTitle, "لطفا تاریخ صحیحی را برای پرداخت نقدی مشخص بفرمایید.");
                return false;
            }

            return true;
        }
Esempio n. 2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the MoneyPayments EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToMoneyPayments(MoneyPayment moneyPayment)
 {
     base.AddObject("MoneyPayments", moneyPayment);
 }
 /// <summary>
 /// Create a new MoneyPayment object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="value">Initial value of the Value property.</param>
 /// <param name="paymentDocumentId">Initial value of the PaymentDocumentId property.</param>
 /// <param name="payerId">Initial value of the PayerId property.</param>
 /// <param name="date">Initial value of the Date property.</param>
 public static MoneyPayment CreateMoneyPayment(global::System.Int32 id, global::System.Double value, global::System.Int32 paymentDocumentId, global::System.Int32 payerId, global::System.DateTime date)
 {
     MoneyPayment moneyPayment = new MoneyPayment();
     moneyPayment.Id = id;
     moneyPayment.Value = value;
     moneyPayment.PaymentDocumentId = paymentDocumentId;
     moneyPayment.PayerId = payerId;
     moneyPayment.Date = date;
     return moneyPayment;
 }
Esempio n. 4
0
 /// <summary>
 /// Create a new MoneyPayment object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="description">Initial value of the Description property.</param>
 /// <param name="value">Initial value of the Value property.</param>
 /// <param name="paymentDocumentId">Initial value of the PaymentDocumentId property.</param>
 /// <param name="payerId">Initial value of the PayerId property.</param>
 public static MoneyPayment CreateMoneyPayment(global::System.Int32 id, global::System.String description, global::System.Double value, global::System.Int32 paymentDocumentId, global::System.Int32 payerId)
 {
     MoneyPayment moneyPayment = new MoneyPayment();
     moneyPayment.Id = id;
     moneyPayment.Description = description;
     moneyPayment.Value = value;
     moneyPayment.PaymentDocumentId = paymentDocumentId;
     moneyPayment.PayerId = payerId;
     return moneyPayment;
 }
Esempio n. 5
0
        private void ClearPage()
        {
            grvItems.CurrentRow = null;

            dpDocumentDate.SelectedDateTime = DateTime.Now;
            dpRecieveDate.SelectedDateTime = DateTime.Now;

            PaymentDocument paymentDocument = new PaymentDocument();
            paymentDocument.Type = (int)DocumentType.MoneyPayment;
            paymentDocument.Context = DataLayer.GetContext();
            srcDocument.DataSource = paymentDocument;

            MoneyPayment moneyPayment = new MoneyPayment();
            moneyPayment.Context = DataLayer.GetContext();
            srcMoney.DataSource = moneyPayment;

            paymentDocument.MoneyPayments.Add(moneyPayment);

            cmbPayer.SelectedItem = null;
            cmbReciever.SelectedItem = null;

            cmbPayer.Enabled = true;
            dpRecieveDate.Enabled = true;
            dpDocumentDate.Enabled = true;
            btnNewPage.Enabled = false;
            btnAddPage.Enabled = true;
        }