Example #1
0
 private void AddDocumentToList(PaymentDocument paymentDocument)
 {
     DataLayer.Insert(paymentDocument);
     grvItems.DataSource = DataLayer.GetPaymentDocumentsByType(false, DocumentType.ChequePayment);
 }
Example #2
0
        public static bool Validate(PaymentDocument paymentDocument)
        {
            if (paymentDocument.RecieverId == 0)
            {
                Methods.ShowStandardMsgBox
                    (FormMessageType.Error, RscError.ValidationTitle, "لطفا دریافت کننده مورد نظر خود را مشخص بفرمایید.");
                return false;
            }

            if (paymentDocument.ChequePayments.Count == 0 && paymentDocument.MoneyPayments.Count == 0)
            {
                Methods.ShowStandardMsgBox
                    (FormMessageType.Error, RscError.ValidationTitle, "لطفا فهرستی از پرداختی ها را مشخص بفرمایید.");
                return false;
            }

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

            return true;
        }
Example #3
0
        private void ClearPage()
        {
            grvItems.CurrentRow = null;

            dpDocumentDate.SelectedDateTime = DateTime.Now;
            dpPayDate.SelectedDateTime = DateTime.Now;
            dpDueDate.SelectedDateTime = DateTime.Now;

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

            ChequePayment chequePayment = new ChequePayment();
            chequePayment.Context = DataLayer.GetContext();
            srcCheque.DataSource = chequePayment;

            paymentDocument.ChequePayments.Add(chequePayment);

            cmbPayer.SelectedItem = null;
            cmbReciever.SelectedItem = null;
            cmbChequeStatus.SelectedIndex = -1;

            cmbPayer.Enabled = true;
            dpPayDate.Enabled = true;
            dpDocumentDate.Enabled = true;
            btnNewPage.Enabled = false;
            btnAddPage.Enabled = true;
        }
Example #4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the PaymentDocuments EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToPaymentDocuments(PaymentDocument paymentDocument)
 {
     base.AddObject("PaymentDocuments", paymentDocument);
 }
Example #5
0
 /// <summary>
 /// Create a new PaymentDocument object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="serial">Initial value of the Serial property.</param>
 /// <param name="date">Initial value of the Date property.</param>
 /// <param name="recieverId">Initial value of the RecieverId property.</param>
 public static PaymentDocument CreatePaymentDocument(global::System.Int32 id, global::System.Int32 serial, global::System.DateTime date, global::System.Int32 recieverId)
 {
     PaymentDocument paymentDocument = new PaymentDocument();
     paymentDocument.Id = id;
     paymentDocument.Serial = serial;
     paymentDocument.Date = date;
     paymentDocument.RecieverId = recieverId;
     return paymentDocument;
 }
 /// <summary>
 /// Create a new PaymentDocument object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="pageSerial">Initial value of the PageSerial property.</param>
 /// <param name="date">Initial value of the Date property.</param>
 /// <param name="recieverId">Initial value of the RecieverId property.</param>
 /// <param name="documentSerial">Initial value of the DocumentSerial property.</param>
 /// <param name="type">Initial value of the Type property.</param>
 /// <param name="creatorId">Initial value of the CreatorId property.</param>
 /// <param name="createDate">Initial value of the CreateDate property.</param>
 public static PaymentDocument CreatePaymentDocument(global::System.Int32 id, global::System.Int32 pageSerial, global::System.DateTime date, global::System.Int32 recieverId, global::System.Int32 documentSerial, global::System.Int32 type, global::System.Int32 creatorId, global::System.DateTime createDate)
 {
     PaymentDocument paymentDocument = new PaymentDocument();
     paymentDocument.Id = id;
     paymentDocument.PageSerial = pageSerial;
     paymentDocument.Date = date;
     paymentDocument.RecieverId = recieverId;
     paymentDocument.DocumentSerial = documentSerial;
     paymentDocument.Type = type;
     paymentDocument.CreatorId = creatorId;
     paymentDocument.CreateDate = createDate;
     return paymentDocument;
 }
Example #7
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;
        }