Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
 private void SetMoneyRecieverToDefaultSafe(MoneyReception moneyReception)
 {
     moneyReception.RecieverId = 77;
 }
Exemplo n.º 3
0
 private void AddMoneyToList(MoneyReception moneyReception)
 {
     ReceptionDocument receptionDocument = srcReceptionDocument.DataSource as ReceptionDocument;
     receptionDocument.MoneyReceptions.Add(moneyReception);
     grvCashes.DataSource = receptionDocument.MoneyReceptions;
 }
Exemplo n.º 4
0
        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;
        }
Exemplo n.º 5
0
        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();
        }
Exemplo n.º 6
0
        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();
        }
Exemplo n.º 7
0
 /// <summary>
 /// Deprecated Method for adding a new object to the MoneyReceptions EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToMoneyReceptions(MoneyReception moneyReception)
 {
     base.AddObject("MoneyReceptions", moneyReception);
 }
Exemplo n.º 8
0
 /// <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;
 }
Exemplo n.º 9
0
 private void AddMoneyToList(MoneyReception moneyReception, ReceptionDocument receptionDocument)
 {
     receptionDocument.MoneyReceptions.Add(moneyReception);
     grvCashes.DataSource = receptionDocument.MoneyReceptions;
 }
Exemplo n.º 10
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;
        }