Beispiel #1
0
 public static void Insert(Bank bank)
 {
     Insert(bank.AccountantEntity);
 }
        public static bool Validate(Bank bank)
        {
            if (string.IsNullOrEmpty(bank.Name))
            {
                Methods.ShowStandardMsgBox
                    (FormMessageType.Error, RscError.ValidationTitle, "لطفا نام بانک را مشخص بفرمایید.");
                return false;
            }

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

            if (string.IsNullOrEmpty(bank.AccountNumber))
            {
                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 AddBankToList(Bank bank)
 {
     DataLayer.Insert(bank);
     grvItems.DataSource = DataLayer.GetBanks(false);
 }
        private void ClearPage()
        {
            grvItems.CurrentRow = null;

            Bank bank = new Bank();
            bank.Context = DataLayer.GetContext();
            srcBank.DataSource = bank;

            btnNew.Enabled = false;
            btnAdd.Enabled = true;

            txtName.Focus();
        }