private void AddDocumentToList(ReceptionDocument receptionDocument)
 {
     DataLayer.Insert(receptionDocument);
     grvItems.DataSource = DataLayer.GetAccountantEntityPayments(false, receptionDocument.Payer);
 }
Example #2
0
        public static bool Validate(ReceptionDocument receptionDocument)
        {
            if (receptionDocument.PayerId == 0)
            {
                Methods.ShowStandardMsgBox
                    (FormMessageType.Error, RscError.ValidationTitle, "لطفا پرداخت کننده مورد نظر خود را مشخص بفرمایید.");
                return false;
            }

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

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

            return true;
        }
        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();
        }
        private void ClearPage()
        {
            ClearChequeForm();

            ClearCashForm();

            grvItems.CurrentRow = null;

            ReceptionDocument receptionDocument = new ReceptionDocument();
            receptionDocument.Type = (int)DocumentType.PatientReception;
            receptionDocument.Context = DataLayer.GetContext();
            srcReceptionDocument.DataSource = receptionDocument;

            grvCashes.DataSource = receptionDocument.MoneyReceptions;
            grvCheques.DataSource = receptionDocument.ChequeReceptions;

            txtPatientValue.Text = "";
            cmbPatients.Enabled = true;
            dpPayDate.Enabled = true;
            btnNewPage.Enabled = false;
            btnAddPage.Enabled = true;

            dpPayDate.SelectedDateTime = DateTime.Now;

            cmbPatients.Focus();
        }
Example #5
0
 /// <summary>
 /// Create a new ReceptionDocument 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="payerId">Initial value of the PayerId property.</param>
 public static ReceptionDocument CreateReceptionDocument(global::System.Int32 id, global::System.Int32 serial, global::System.DateTime date, global::System.Int32 payerId)
 {
     ReceptionDocument receptionDocument = new ReceptionDocument();
     receptionDocument.Id = id;
     receptionDocument.Serial = serial;
     receptionDocument.Date = date;
     receptionDocument.PayerId = payerId;
     return receptionDocument;
 }
Example #6
0
 /// <summary>
 /// Deprecated Method for adding a new object to the ReceptionDocuments EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToReceptionDocuments(ReceptionDocument receptionDocument)
 {
     base.AddObject("ReceptionDocuments", receptionDocument);
 }
 private void AddDocumentToList(ReceptionDocument receptionDocument)
 {
     DataLayer.Insert(receptionDocument);
     grvItems.DataSource = DataLayer.GetReceptionDocumentsByType(false, DocumentType.ChequeReception);
 }
 /// <summary>
 /// Create a new ReceptionDocument 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="payerId">Initial value of the PayerId 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 ReceptionDocument CreateReceptionDocument(global::System.Int32 id, global::System.Int32 pageSerial, global::System.DateTime date, global::System.Int32 payerId, global::System.Int32 documentSerial, global::System.Int32 type, global::System.Int32 creatorId, global::System.DateTime createDate)
 {
     ReceptionDocument receptionDocument = new ReceptionDocument();
     receptionDocument.Id = id;
     receptionDocument.PageSerial = pageSerial;
     receptionDocument.Date = date;
     receptionDocument.PayerId = payerId;
     receptionDocument.DocumentSerial = documentSerial;
     receptionDocument.Type = type;
     receptionDocument.CreatorId = creatorId;
     receptionDocument.CreateDate = createDate;
     return receptionDocument;
 }
        private void ClearPage()
        {
            grvItems.CurrentRow = null;

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

            ReceptionDocument receptionDocument = new ReceptionDocument();
            receptionDocument.Context = DataLayer.GetContext();
            receptionDocument.Type =(int) DocumentType.ChequeReception;
            srcDocument.DataSource = receptionDocument;

            ChequeReception ChequeReception = new ChequeReception();
            ChequeReception.Context = DataLayer.GetContext();
            srcCheque.DataSource = ChequeReception;

            receptionDocument.ChequeReceptions.Add(ChequeReception);

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

            cmbPayer.Enabled = true;
            dpRecieveDate.Enabled = true;
            dpDocumentDate.Enabled = true;
            btnNewPage.Enabled = false;
            btnAddPage.Enabled = true;
        }
Example #10
0
 private void AddMoneyToList(MoneyReception moneyReception, ReceptionDocument receptionDocument)
 {
     receptionDocument.MoneyReceptions.Add(moneyReception);
     grvCashes.DataSource = receptionDocument.MoneyReceptions;
 }
Example #11
0
 private void AddChequeToList(ChequeReception chequeReception, ReceptionDocument receptionDocument)
 {
     receptionDocument.ChequeReceptions.Add(chequeReception);
     grvCheques.DataSource = receptionDocument.ChequeReceptions;
 }
Example #12
0
 private void SetChequesRecieveDateAndPayer(ReceptionDocument receptionDocument)
 {
     foreach (var cheque in receptionDocument.ChequeReceptions)
     {
         cheque.RecieveDate = receptionDocument.Date;
         cheque.PayerId = receptionDocument.PayerId;
     }
 }
Example #13
0
        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;
        }