private void AddChequeToListAndClearForm(ChequeReception chequeReception)
        {
            SetChequeRecieverToDefaultSafe(chequeReception);
            SetChequeStatusToPass(chequeReception);
            _lstChequeReception.Add(chequeReception);
            grvItems.DataSource = _lstChequeReception;

            //ClearChequeForm();
        }
Example #2
0
        public static bool Validate(ChequeReception chequeReception)
        {
            if (string.IsNullOrEmpty(chequeReception.Bank))
            {
                Methods.ShowStandardMsgBox
                    (FormMessageType.Error, RscError.ValidationTitle, "لطفا نام بانک را مشخص بفرمایید.");
                return false;
            }

            if (string.IsNullOrEmpty(chequeReception.Branch))
            {
                Methods.ShowStandardMsgBox
                    (FormMessageType.Error, RscError.ValidationTitle, "لطفا نام شعبه را مشخص بفرمایید.");
                return false;
            }

            if (string.IsNullOrEmpty(chequeReception.Number))
            {
                Methods.ShowStandardMsgBox
                    (FormMessageType.Error, RscError.ValidationTitle, "لطفا شماره چک را مشخص بفرمایید.");
                return false;
            }

            if (string.IsNullOrEmpty(chequeReception.Value.ToString()))
            {
                Methods.ShowStandardMsgBox
                    (FormMessageType.Error, RscError.ValidationTitle, "لطفا مبلغ چک را مشخص بفرمایید.");
                return false;
            }

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

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

            if (chequeReception.Status == -1)
            {
                Methods.ShowStandardMsgBox
                    (FormMessageType.Error, RscError.ValidationTitle, "لطفا وضعیت چک را مشخص بفرمایید.");
                return false;
            }

            if (!(chequeReception.Status == (int)ChequeStatus.Invalid || chequeReception.Status == (int)ChequeStatus.Returned)
                && chequeReception.RecieverId == 0)
            {
                Methods.ShowStandardMsgBox
                    (FormMessageType.Error, RscError.ValidationTitle, "لطفا محل واریز را مشخص بفرمایید.");
                return false;
            }

            return true;
        }
 private void SetChequeStatusToPass(ChequeReception chequeReception)
 {
     chequeReception.Status = (int)ChequeStatus.Passed;
 }
        private void ClearChequeForm()
        {
            grvItems.CurrentRow = null;

            ChequeReception receptionDocument = new ChequeReception();
            receptionDocument.Context = DataLayer.GetContext();

            scrItem.DataSource = receptionDocument;

            btnNewCheque.Enabled = false;
            btnAddCheque.Enabled = true;

            txtAmount.Focus();
        }
 private void SetChequeRecieverToDefaultSafe(ChequeReception chequeReception)
 {
     chequeReception.RecieverId = 77;
 }
        private void ClearChequeForm()
        {
            grvCheques.CurrentRow = null;

            ChequeReception receptionDocument = new ChequeReception();
            receptionDocument.Context = DataLayer.GetContext();
            srcChequeReception.DataSource = receptionDocument;

            btnNewCheque.Enabled = false;
            btnAddCheque.Enabled = true;

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

            txtChequeValue.Focus();
        }
 private void AddChequeToList(ChequeReception chequeReception)
 {
     ReceptionDocument receptionDocument = srcReceptionDocument.DataSource as ReceptionDocument;
     receptionDocument.ChequeReceptions.Add(chequeReception);
     grvCheques.DataSource = receptionDocument.ChequeReceptions;
 }
Example #8
0
        public static bool Validate(ChequeReception chequeReception)
        {
            if (string.IsNullOrEmpty(chequeReception.Bank))
            {
                Methods.ShowStandardMsgBox
                    (FormMessageType.Error, RscError.ValidationTitle, "لطفا نام بانک را مشخص بفرمایید.");
                return false;
            }

            if (string.IsNullOrEmpty(chequeReception.Branch))
            {
                Methods.ShowStandardMsgBox
                    (FormMessageType.Error, RscError.ValidationTitle, "لطفا نام شعبه را مشخص بفرمایید.");
                return false;
            }

            if (string.IsNullOrEmpty(chequeReception.Number))
            {
                Methods.ShowStandardMsgBox
                    (FormMessageType.Error, RscError.ValidationTitle, "لطفا شماره چک را مشخص بفرمایید.");
                return false;
            }

            if (string.IsNullOrEmpty(chequeReception.Value.ToString()))
            {
                Methods.ShowStandardMsgBox
                    (FormMessageType.Error, RscError.ValidationTitle, "لطفا مبلغ چک را مشخص بفرمایید.");
                return false;
            }

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

            return true;
        }
Example #9
0
 /// <summary>
 /// Deprecated Method for adding a new object to the ChequeReceptions EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToChequeReceptions(ChequeReception chequeReception)
 {
     base.AddObject("ChequeReceptions", chequeReception);
 }
Example #10
0
 /// <summary>
 /// Create a new ChequeReception object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="dueDate">Initial value of the DueDate property.</param>
 /// <param name="value">Initial value of the Value property.</param>
 /// <param name="bankName">Initial value of the BankName property.</param>
 /// <param name="status">Initial value of the Status property.</param>
 /// <param name="payerId">Initial value of the PayerId property.</param>
 /// <param name="number">Initial value of the Number property.</param>
 /// <param name="chequeReceptionDocumentId">Initial value of the ChequeReceptionDocumentId property.</param>
 /// <param name="receptionDocumentId">Initial value of the ReceptionDocumentId property.</param>
 /// <param name="recieveDate">Initial value of the RecieveDate property.</param>
 public static ChequeReception CreateChequeReception(global::System.Int32 id, global::System.DateTime dueDate, global::System.Double value, global::System.String bankName, global::System.Int32 status, global::System.Int32 payerId, global::System.String number, global::System.Int32 chequeReceptionDocumentId, global::System.Int32 receptionDocumentId, global::System.DateTime recieveDate)
 {
     ChequeReception chequeReception = new ChequeReception();
     chequeReception.Id = id;
     chequeReception.DueDate = dueDate;
     chequeReception.Value = value;
     chequeReception.BankName = bankName;
     chequeReception.Status = status;
     chequeReception.PayerId = payerId;
     chequeReception.Number = number;
     chequeReception.ChequeReceptionDocumentId = chequeReceptionDocumentId;
     chequeReception.ReceptionDocumentId = receptionDocumentId;
     chequeReception.RecieveDate = recieveDate;
     return chequeReception;
 }
        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 #12
0
 private void AddChequeToList(ChequeReception chequeReception, ReceptionDocument receptionDocument)
 {
     receptionDocument.ChequeReceptions.Add(chequeReception);
     grvCheques.DataSource = receptionDocument.ChequeReceptions;
 }