private void SetupBankViews(View parent)
        {
            var banksSpinner = parent.FindViewById<Spinner>(Resource.Id.payment_bank);
            var banksBranchSpinner = parent.FindViewById<Spinner>(Resource.Id.payment_bank_branch);

            var banks = bankRepository.GetAll().ToList();
            var bankNames = banks.Select(b => b.Name).ToList();
            var banksAdapter = new ArrayAdapter(Activity, Resource.Layout.bank_spinner_item, bankNames);
            banksSpinner.Adapter = banksAdapter;

            var bankBranchesAdapter = new ArrayAdapter(Activity, Resource.Layout.bank_spinner_item);
            banksBranchSpinner.Adapter = bankBranchesAdapter;

            banksSpinner.ItemSelected += delegate
            {
                this.bank = banks[banksSpinner.SelectedItemPosition];

                var bankBranchNames = bank.Branches.Select(b => b.Name).ToList();
                bankBranchesAdapter.Clear();
                bankBranchesAdapter.AddAll(bankBranchNames);

                banksBranchSpinner.ItemSelected += delegate
                {
                    this.bankBranch = bank.Branches[banksBranchSpinner.SelectedItemPosition];
                };
            };

            bank = banks.First();
            bankBranch = bank.Branches.First();
        }
예제 #2
0
 protected OrderSaleContextBuilder(Outlet outlet, CostCentre costCentre, User user, Sale sale, Bank bank, BankBranch bankBranch)
 {
     Outlet = outlet;
     CostCentre = costCentre;
     User = user;
     Sale = sale;
     Bank = bank;
     BankBranch = bankBranch;
 }
 public void Save(BankBranchViewModel bankBranchViewModel)
 {
     BankBranch bankBranch = new BankBranch(bankBranchViewModel.Id)
     {
         Name = bankBranchViewModel.Name,
         Code = bankBranchViewModel.Code,
         Description = bankBranchViewModel.Description,
         Bank=_bankRepository.GetById (bankBranchViewModel.BankId )
     };
     _bankBranchRepository.Save(bankBranch);
 }
 public BankBranchViewModel Map(BankBranch bankBranch)
 {
     return new BankBranchViewModel
     {
       Id=bankBranch.Id,
       Name=bankBranch.Name,
       BankId=_bankRepository.GetById(bankBranch.Bank.Id).Id ,
       BankName=_bankRepository.GetById(bankBranch.Bank.Id ).Name,
       Code=bankBranch.Code,
       Description=bankBranch.Description,
       IsActive = bankBranch._Status == EntityStatus.Active ? true : false
     };
 }
예제 #5
0
 public BankBranchDTO Map(BankBranch bankBranch)
 {
     if (bankBranch == null) return null;
     return Mapper.Map<BankBranch, BankBranchDTO>(bankBranch);
 }
예제 #6
0
 public SaleAndContextBuilder(Outlet outlet, CostCentre costCentre, User user, Sale sale, Bank bank, BankBranch bankBranch)
     : base(outlet, costCentre, user, sale, bank, bankBranch)
 {
 }
예제 #7
0
 public virtual OrderSaleContextBuilder WithChequePayment(decimal amount, Bank bank, BankBranch bankBranch,  string chequeNumber = "12345678")
 {
     Sale.AddChequePayment(chequeNumber, amount, bank, bankBranch, DateTime.Now);
     return this;
 }
 private void GetBankBranches()
 {
     using (StructureMap.IContainer cont = NestedContainer)
     {
         BankBranchesList.Clear();
         var branches = Using<IBankBranchRepository>(cont).GetByBankMasterId(SelectedBank.Id);
         branches.ForEach(n => BankBranchesList.Add(n));
         SelectedBankBranch = new BankBranch(Guid.Empty) { Name = "---Select Brank---" };
     }
 }
        public void AddPaymentInfo(decimal cashAmnt, decimal creditAmnt, decimal mMoneyAmnt, decimal chequeAmnt,
                                   decimal amountPaid, string mMoneyReferenceNo, string chequeNo, decimal grossAmount,
                                   decimal change, Bank bank, BankBranch bBranch, string mMoneyOption,
                                   bool mMoneyIsApproved, Guid mMoneyTransactionRefId, string mMoneyAccountId,
                                   string mMoneySubscriberId, string mMoneyTillNumber, string currency,
                                   PaymentNotificationResponse paymentNotif,
                                   PaymentResponse paymentResponse)
        {
            using (StructureMap.IContainer cont = NestedContainer)
            {
                CashAmount = cashAmnt - change;
                bankBranch = bBranch;
                TotalGross = grossAmount + AmountPaid;

                CreditAmount = creditAmnt;
                MMoneyAmount = mMoneyAmnt;
                ChequeAmount = chequeAmnt;
                MMoneyRefNo = mMoneyReferenceNo;
                ChequeNo = chequeNo + " - " + (bank != null ? bank.Name : "");
                AmountPaid = amountPaid + AmountPaid;
                MMoneyOption = mMoneyOption;

                string desc = "";
              
                #region Cash

                if (cashAmnt > 0)
                {
                    var existing = PaymentInfoList.FirstOrDefault(n => n.PaymentModeUsed == PaymentMode.Cash && n.IsNew);
                    if (existing == null)
                    {
                        existing = new PaymentInfo
                                       {
                                           Id = Guid.NewGuid(),
                                           Amount = cashAmnt - change, //??
                                           PaymentModeUsed = PaymentMode.Cash,
                                           IsNew = true,
                                           IsConfirmed = true,
                                           PaymentRefId = "Cash",
                                           MMoneyPaymentType = "",
                                           PaymentTypeDisplayer = "Cash",
                                           Description = "", 
                                       };
                        PaymentInfoList.Add(existing);
                    }
                    else
                        existing.Amount += cashAmnt;

                    desc = GetLocalText("sl.payment.notifitcation.desc.inpaymentof") /*"In payment of" */
                           + " " + currency + " " + existing.Amount + ".";
                    existing.Description = desc;
                }

                #endregion

                #region Cheq

                if (chequeAmnt > 0)
                {
                    var existing =
                        PaymentInfoList.FirstOrDefault(n => n.PaymentModeUsed == PaymentMode.Cheque && n.IsNew);
                    if (existing == null)
                    {
                        existing = new PaymentInfo
                                       {
                                           Id = Guid.NewGuid(),
                                           Amount = chequeAmnt,
                                           PaymentModeUsed = PaymentMode.Cheque,
                                           PaymentRefId = chequeNo + " - " + (bank != null ? bank.Name : ""),
                                           IsNew = true,
                                           IsConfirmed = true,
                                           MMoneyPaymentType = "",
                                           PaymentTypeDisplayer =
                                               "Cheque " + chequeNo + " - " + (bank != null ? bank.Name : ""),
                                           Description = ""
                                       };
                        PaymentInfoList.Add(existing);
                    }
                    else
                        existing.Amount += chequeAmnt;

                    desc = GetLocalText("sl.payment.notifitcation.desc.inpaymentof") /*"I payment of"*/
                           + " " + currency + " " + existing.Amount + " "
                           + GetLocalText("sl.payment.notifitcation.desc.tobank") /*"to bank"*/
                           + " " + (bank != null ? bank.Name : "") + " "
                           + GetLocalText("sl.payment.notifitcation.desc.chequenumber") /*"cheque number"*/
                           + " " + chequeNo + ".";
                    existing.Description = desc;
                }

                #endregion

                #region M-Money

                if (mMoneyAmnt > 0)
                {
                    if (mMoneyTransactionRefId == Guid.Empty)
                        throw new Exception("Transaction reference id not set.\nAddPaymentInfo()");

                    //cn: Add or replace a notification.
                    var existingNotif = _paymentNotifs.FirstOrDefault(n => n.Id == paymentNotif.Id);
                    if (existingNotif != null)
                        _paymentNotifs.Remove(existingNotif);

                    if (paymentNotif != null)
                        _paymentNotifs.Add(paymentNotif);

                    var mmPayment = new PaymentInfo
                                        {
                                            Id = mMoneyTransactionRefId,
                                            Amount = mMoneyAmnt,
                                            PaymentModeUsed = PaymentMode.MMoney,
                                            MMoneyPaymentType = mMoneyOption,
                                            IsNew = true,
                                            IsConfirmed = mMoneyIsApproved,
                                            PaymentRefId = mMoneyReferenceNo,
                                            PaymentTypeDisplayer = mMoneyOption,
                                            Description = desc
                                        };
                    PaymentInfoList.Add(mmPayment);

                    if (mmPayment.IsConfirmed)
                        desc = MMoneyDescription(mmPayment.Amount, currency, mMoneySubscriberId, mMoneyAccountId,
                                                 mMoneyTillNumber, MMoneyRefNo);
                    else
                        desc = paymentResponse.LongDescription != ""
                                   ? paymentResponse.LongDescription
                                   : paymentResponse.ShortDescription;

                    mmPayment.Description = desc;
                }

                #endregion

                #region Credit

                var credit = PaymentInfoList.FirstOrDefault(n => n.PaymentModeUsed == PaymentMode.Credit && n.IsNew);
                if (credit == null)
                {
                    credit = new PaymentInfo
                                 {
                                     Id = Guid.NewGuid(),
                                     Amount = creditAmnt,
                                     PaymentModeUsed = PaymentMode.Credit,
                                     IsNew = true,
                                     IsConfirmed = true,
                                     MMoneyPaymentType = "",
                                     PaymentRefId = "",
                                     PaymentTypeDisplayer = "Credit"
                                 };

                    PaymentInfoList.Add(credit);
                }
                else
                    credit.Amount = creditAmnt;

                if (credit.Amount == 0)
                    PaymentInfoList.Remove(credit);

                #endregion

                RecalcAmountPaid();
                CanSaveToContinue = false;
            }
        }
예제 #10
0
        private void ClearViewModel()
        {
            AccountFullName = "";
            AccountName = "";
            AccountNumber = "";
            PinNumber = "";
            CostCenterCode ="";

            SelectedBank = new Bank(Guid.Empty){Name="--Select Bank--"};
            SelectedBankBranch = new BankBranch(Guid.Empty) { Name = "--Select Bank Branch--" };
            SelectedCommoditySupplierType = CommoditySupplierType.Default;
            SelectedCommoditySupplierType = CommoditySupplierType.Individual;
            SelectedMaritalStatus = MaritalStatas.Default;
            SelectedMaritalStatus = MaritalStatas.Single;
            FarmCode = "";
            FarmName ="";
            Acerage = "";
            FarmRegistrationNo = "";
            FarmPhysicalAddress = "";
            FarmDescription = "";

            Surname = "";
            FirstName = "";
            MiddleName = "";
            OwnerCode = "";
            IdNumber = "";
            PinNumber = "";
            PhysicalAddress = "";
            PostalAddress = "";
            Email = "";
            PhoneNumber = "";
            BusinessNumber = "";
            FaxNumber = "";
            OfficeNumber = "";
            Description = "";
            DateOfBirth = DateTime.Now;

            AssignedCentresList.Clear();
            SupplierIsEnabled = true;
            SelectedCommodityOwnerType = new CommodityOwnerType(Guid.Empty){Name="--Select Commodity Type--"};
        }
예제 #11
0
        protected Guid AddBankBranch(string name, string desc, string code, Guid BankId)
        {
            BankBranch bankBranch = new BankBranch(Guid.NewGuid())

            {
                Name = name,
                Description = desc,
                Code = code,
                Bank=_bankRepository.GetById(BankId ) 

            };
            bankBranch._SetStatus(EntityStatus.Active);
            return _bankBranchRepository.Save(bankBranch);
        }
 private ValidationResultInfo Validate(BankBranch bankBranch)
 {
     return _bankBranchRepository.Validate(bankBranch);
 }
        private BankBranch Map(BankBranchImport bankBranchImport, List<string> mappingvalidationList)
        {
            var exists = Queryable.FirstOrDefault(_context.tblBankBranch, p => p.Code == bankBranchImport.Code);
            Guid id = exists != null ? exists.Id : Guid.NewGuid();

            var bank = Queryable.FirstOrDefault(_context.tblBank, p => p.Code == bankBranchImport.BankCode);

            if (bank == null) { mappingvalidationList.Add(string.Format((string) "Invalid Bank Code {0}", (object) bankBranchImport.BankCode)); }
            var bankId = bank != null ? bank.Id : Guid.Empty;

            var bankEntity = _bankRepository.GetById(bankId);

            var bankBranch = new BankBranch(id);
            bankBranch.Bank = bankEntity;
            bankBranch.Code = bankBranchImport.Code;
            bankBranch.Name = bankBranchImport.Name;
            bankBranch.Description = bankBranchImport.Description;

            return bankBranch;

        }
 private void CreateBankBranch(string name,string bankName)
 {
    var bankBranch = new BankBranch(Guid.NewGuid());
             bankBranch.Code = name;
             bankBranch.Name = name;
             bankBranch.Description = name;
             bankBranch.Bank = _bankRepository.GetByCode(bankName);
             _bankBranchRepository.Save(bankBranch);
 }
예제 #15
0
        private void ClearViewModel()
        {
            Name = "";
            Code = "";
            IdNo = "";
            PinNo = "";
            MobileNumber = "";
            AccountName = "";
            AccountNumber = "";
            Description = "";
            SelectedGender = Gender.Unknown;
            SelectedBankOne = new Bank(Guid.NewGuid()) { Name = "--Select Bank--" };
            SelectedBankBranch = new BankBranch(Guid.NewGuid()) { Name = "--Select Bank Branch--" };

            PhysicalAddress = "";
            PostalAddress = "";
            Email = "";
            PhoneNumber = "";
            BusinessNumber = "";
            FaxNumber = "";

        }
예제 #16
0
파일: Order.cs 프로젝트: asanyaga/BuildTest
        public void AddChequePayment(string chequeNumber, decimal amount, Bank bank, BankBranch bankBranch, DateTime dueDate)
        {            
            var payment = new Payment(Id)
            {
                PaymentMode = PaymentMode.Cheque,
                PaymentReference = string.Format("{0} - {1} - {2}", chequeNumber, bank.Code, bankBranch.Code),
                Amount = amount,
                Bank = bank.Code, 
                BankBranch = bankBranch.Code,
                PaymentStatus = PaymentStatus.New,
                DueDate = dueDate
            };

            Payments.Add(payment);
        }
        public HttpResponseMessage BankBranchAdd(BankBranchItem bankBranchItem)
        {
            var response = new ResponseBool { Success = false };
            var bankBranch = new BankBranch(bankBranchItem.MasterId)
            {
                Name = bankBranchItem.Name,
                Code = bankBranchItem.Code,
                Description = bankBranchItem.Description,
                //Bank = bankBranchItem.Bank,
            };

            try
            {
                 _bankBranchRepository.Save(bankBranch);
                response.Success = true;
            }
            catch (Exception ex)
            {
                _log.Error("Failed to add bank branch", ex);
            }
            return Request.CreateResponse(HttpStatusCode.OK, response);
        }