Example #1
0
        public static PaymentViewModel Create(EnumPaymentType paymentType, ITPaymentRepository tPaymentRepository, ITPaymentDetRepository tPaymentDetRepository)
        {
            PaymentViewModel viewModel = new PaymentViewModel();

            TPayment p = new TPayment();

            p.SetAssignedIdTo(Guid.NewGuid().ToString());
            p.PaymentDate = DateTime.Today;
            p.PaymentDesc = string.Empty;
            p.PaymentType = paymentType.ToString();

            viewModel.Payment = p;

            viewModel.Title = string.Format("Pembayaran {0}", paymentType.ToString());

            //get label text
            switch (paymentType)
            {
            case EnumPaymentType.Piutang:
                viewModel.CashAccountLabel = "Deposit ke : ";
                break;

            case EnumPaymentType.Hutang:
                viewModel.CashAccountLabel = "Deposit dari : ";
                break;
            }

            return(viewModel);
        }
Example #2
0
        public static PaymentViewModel Create(EnumPaymentType paymentType, ITPaymentRepository tPaymentRepository, ITPaymentDetRepository tPaymentDetRepository, IMSupplierRepository mSupplierRepository, IMCustomerRepository mCustomerRepository, IMCostCenterRepository mCostCenterRepository)
        {
            PaymentViewModel viewModel = new PaymentViewModel();

            TPayment p = new TPayment();

            p.SetAssignedIdTo(Guid.NewGuid().ToString());
            p.PaymentDate = DateTime.Today;
            p.PaymentDesc = string.Empty;
            p.PaymentType = paymentType.ToString();

            viewModel.Payment = p;

            viewModel.Title = string.Format("Pembayaran {0}", paymentType.ToString());

            IList <MCostCenter> list       = mCostCenterRepository.GetAll();
            MCostCenter         costCenter = new MCostCenter();

            costCenter.CostCenterName = "-Pilih Cost Center-";
            list.Insert(0, costCenter);
            viewModel.CostCenterList = new SelectList(list, "Id", "CostCenterName");

            //get label text
            switch (paymentType)
            {
            case EnumPaymentType.Piutang:
                viewModel.CashAccountLabel = "Deposit ke : ";

                //fill cust
                var values = from MCustomer cust in mCustomerRepository.GetAll()
                             select new { Id = cust.Id, Name = cust.PersonId != null ? cust.PersonId.PersonName : "-Pilih Konsumen-" };
                viewModel.TransByList = new SelectList(values, "Id", "Name");
                break;

            case EnumPaymentType.Hutang:
                viewModel.CashAccountLabel = "Deposit dari : ";

                IList <MSupplier> listAcc  = mSupplierRepository.GetAll();
                MSupplier         supplier = new MSupplier();
                supplier.SupplierName = "-Pilih Supplier-";
                listAcc.Insert(0, supplier);
                viewModel.TransByList = new SelectList(listAcc, "Id", "SupplierName");
                break;
            }
            return(viewModel);
        }
Example #3
0
        public PaymentController(ITJournalRepository tJournalRepository, ITJournalDetRepository tJournalDetRepository, IMCostCenterRepository mCostCenterRepository, IMAccountRepository mAccountRepository, ITRecAccountRepository tRecAccountRepository, ITRecPeriodRepository tRecPeriodRepository, IMBrandRepository mBrandRepository, IMSupplierRepository mSupplierRepository, IMWarehouseRepository mWarehouseRepository, IMItemRepository mItemRepository, ITStockCardRepository tStockCardRepository, ITStockItemRepository tStockItemRepository, ITTransDetRepository tTransDetRepository, ITTransRepository tTransRepository, ITPaymentRepository tPaymentRepository, ITPaymentDetRepository tPaymentDetRepository, IMAccountRefRepository mAccountRefRepository, IMCustomerRepository mCustomerRepository)
        {
            Check.Require(tJournalRepository != null, "tJournalRepository may not be null");
            Check.Require(tJournalDetRepository != null, "tJournalDetRepository may not be null");
            Check.Require(mCostCenterRepository != null, "mCostCenterRepository may not be null");
            Check.Require(mAccountRepository != null, "mAccountRepository may not be null");
            Check.Require(tRecAccountRepository != null, "tRecAccountRepository may not be null");
            Check.Require(tRecPeriodRepository != null, "tRecPeriodRepository may not be null");
            Check.Require(mBrandRepository != null, "mBrandRepository may not be null");
            Check.Require(mSupplierRepository != null, "mSupplierRepository may not be null");
            Check.Require(mWarehouseRepository != null, "mBrandRepository may not be null");
            Check.Require(mItemRepository != null, "mItemRepository may not be null");
            Check.Require(tStockCardRepository != null, "tStockCardRepository may not be null");
            Check.Require(tStockItemRepository != null, "tStockItemRepository may not be null");
            Check.Require(tTransDetRepository != null, "tTransDetRepository may not be null");
            Check.Require(tTransRepository != null, "tTransRepository may not be null");
            Check.Require(tPaymentRepository != null, "tPaymentRepository may not be null");
            Check.Require(tPaymentDetRepository != null, "tPaymentDetRepository may not be null");
            Check.Require(mAccountRefRepository != null, "mAccountRefRepository may not be null");
            Check.Require(mCustomerRepository != null, "mCustomerRepository may not be null");


            this._tJournalRepository    = tJournalRepository;
            this._tJournalDetRepository = tJournalDetRepository;
            this._mCostCenterRepository = mCostCenterRepository;
            this._mAccountRepository    = mAccountRepository;
            this._tRecAccountRepository = tRecAccountRepository;
            this._tRecPeriodRepository  = tRecPeriodRepository;
            this._mBrandRepository      = mBrandRepository;
            this._mSupplierRepository   = mSupplierRepository;
            this._mWarehouseRepository  = mWarehouseRepository;
            this._mItemRepository       = mItemRepository;
            this._tStockCardRepository  = tStockCardRepository;
            this._tStockItemRepository  = tStockItemRepository;
            this._tTransDetRepository   = tTransDetRepository;
            this._tTransRepository      = tTransRepository;
            this._tPaymentRepository    = tPaymentRepository;
            this._tPaymentDetRepository = tPaymentDetRepository;
            this._mAccountRefRepository = mAccountRefRepository;
            this._mCustomerRepository   = mCustomerRepository;
        }
Example #4
0
        public PaymentController(IMBrandRepository mBrandRepository, IMSupplierRepository mSupplierRepository, IMWarehouseRepository mWarehouseRepository, IMItemRepository mItemRepository, ITStockCardRepository tStockCardRepository, ITStockItemRepository tStockItemRepository, ITTransDetRepository tTransDetRepository, ITTransRepository tTransRepository, ITPaymentRepository tPaymentRepository, ITPaymentDetRepository tPaymentDetRepository)
        {
            Check.Require(mBrandRepository != null, "mBrandRepository may not be null");
            Check.Require(mSupplierRepository != null, "mSupplierRepository may not be null");
            Check.Require(mWarehouseRepository != null, "mBrandRepository may not be null");
            Check.Require(mItemRepository != null, "mItemRepository may not be null");
            Check.Require(tStockCardRepository != null, "tStockCardRepository may not be null");
            Check.Require(tStockItemRepository != null, "tStockItemRepository may not be null");
            Check.Require(tTransDetRepository != null, "tTransDetRepository may not be null");
            Check.Require(tTransRepository != null, "tTransRepository may not be null");
            Check.Require(tPaymentRepository != null, "tPaymentRepository may not be null");
            Check.Require(tPaymentDetRepository != null, "tPaymentDetRepository may not be null");

            this._mBrandRepository      = mBrandRepository;
            this._mSupplierRepository   = mSupplierRepository;
            this._mWarehouseRepository  = mWarehouseRepository;
            this._mItemRepository       = mItemRepository;
            this._tStockCardRepository  = tStockCardRepository;
            this._tStockItemRepository  = tStockItemRepository;
            this._tTransDetRepository   = tTransDetRepository;
            this._tTransRepository      = tTransRepository;
            this._tPaymentRepository    = tPaymentRepository;
            this._tPaymentDetRepository = tPaymentDetRepository;
        }