コード例 #1
0
        //private readonly ITTransDetItemRepository _tTransDetItemRepository;
        //private readonly IMAccountRefRepository _mAccountRefRepository;
        //private readonly ITJournalRepository _tJournalRepository;
        //private readonly ITJournalDetRepository _tJournalDetRepository;
        //private readonly IMAccountRepository _mAccountRepository;
        //private readonly ITJournalRefRepository _tJournalRefRepository;

        public InventoryController(ITTransRepository tTransRepository, IMWarehouseRepository mWarehouseRepository, IMSupplierRepository mSupplierRepository, IMItemRepository mItemRepository, ITStockCardRepository tStockCardRepository, ITStockItemRepository tStockItemRepository, ITTransRefRepository tTransRefRepository, ITStockRepository tStockRepository, ITStockRefRepository tStockRefRepository, IMCustomerRepository mCustomerRepository, IMEmployeeRepository mEmployeeRepository, ITTransDetRepository tTransDetRepository)
        {
            Check.Require(tTransRepository != null, "tTransRepository may not be null");
            Check.Require(mWarehouseRepository != null, "mWarehouseRepository may not be null");
            Check.Require(mSupplierRepository != null, "mSupplierRepository 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(tTransRefRepository != null, "tTransRefRepository may not be null");
            Check.Require(tStockRepository != null, "tStockRepository may not be null");
            Check.Require(tStockRefRepository != null, "tStockRefRepository may not be null");
            Check.Require(mCustomerRepository != null, "mCustomerRepository may not be null");
            Check.Require(mEmployeeRepository != null, "mEmployeeRepository may not be null");
            Check.Require(tTransDetRepository != null, "tTransDetRepository may not be null");

            this._tTransRepository     = tTransRepository;
            this._mWarehouseRepository = mWarehouseRepository;
            this._mSupplierRepository  = mSupplierRepository;
            this._mItemRepository      = mItemRepository;
            this._tStockCardRepository = tStockCardRepository;
            this._tStockItemRepository = tStockItemRepository;
            this._tTransRefRepository  = tTransRefRepository;
            this._tStockRepository     = tStockRepository;
            this._tStockRefRepository  = tStockRefRepository;
            this._mCustomerRepository  = mCustomerRepository;
            this._mEmployeeRepository  = mEmployeeRepository;
            this._tTransDetRepository  = tTransDetRepository;
        }
コード例 #2
0
        public SupplierController(IMSupplierRepository mSupplierRepository, IRefAddressRepository refAddressRepository)
        {
            Check.Require(mSupplierRepository != null, "mSupplierRepository may not be null");
            Check.Require(refAddressRepository != null, "refAddressRepository may not be null");

            this._mSupplierRepository  = mSupplierRepository;
            this._refAddressRepository = refAddressRepository;
        }
コード例 #3
0
        public InventoryController(ITTransRepository tTransRepository, IMWarehouseRepository mWarehouseRepository, IMSupplierRepository mSupplierRepository, IMItemRepository mItemRepository, ITStockCardRepository tStockCardRepository, ITStockItemRepository tStockItemRepository, ITTransRefRepository tTransRefRepository, ITStockRepository tStockRepository, ITStockRefRepository tStockRefRepository, IMCustomerRepository mCustomerRepository, IMRoomRepository mRoomRepository, IMEmployeeRepository mEmployeeRepository, ITTransDetRepository tTransDetRepository, ITTransRoomRepository tTransRoomRepository, IMPacketRepository mPacketRepository, IMPacketItemCatRepository mPacketItemCatRepository, ITTransDetItemRepository tTransDetItemRepository, IMAccountRefRepository mAccountRefRepository, ITJournalRepository tJournalRepository, ITJournalDetRepository tJournalDetRepository, IMAccountRepository mAccountRepository, IMActionRepository mActionRepository, ITCommissionRepository tCommissionRepository, IMActionCommRepository mActionCommRepository, ITJournalRefRepository tJournalRefRepository)
        {
            Check.Require(tTransRepository != null, "tTransRepository may not be null");
            Check.Require(mWarehouseRepository != null, "mWarehouseRepository may not be null");
            Check.Require(mSupplierRepository != null, "mSupplierRepository 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(tTransRefRepository != null, "tTransRefRepository may not be null");
            Check.Require(tStockRepository != null, "tStockRepository may not be null");
            Check.Require(tStockRefRepository != null, "tStockRefRepository may not be null");
            Check.Require(mCustomerRepository != null, "mCustomerRepository may not be null");
            Check.Require(mRoomRepository != null, "mRoomRepository may not be null");
            Check.Require(mEmployeeRepository != null, "mEmployeeRepository may not be null");
            Check.Require(tTransDetRepository != null, "tTransDetRepository may not be null");
            Check.Require(tTransRoomRepository != null, "tTransRoomRepository may not be null");
            Check.Require(mPacketRepository != null, "mPacketRepository may not be null");
            Check.Require(mPacketItemCatRepository != null, "mPacketItemCatRepository may not be null");
            Check.Require(tTransDetItemRepository != null, "tTransDetItemRepository may not be null");
            //Check.Require(mPacketCommRepository != null, "mPacketCommRepository may not be null");
            Check.Require(mAccountRefRepository != null, "mAccountRefRepository may not be null");
            Check.Require(tJournalRepository != null, "tJournalRepository may not be null");
            Check.Require(tJournalDetRepository != null, "tJournalDetRepository may not be null");
            Check.Require(mAccountRepository != null, "mAccountRepository may not be null");
            Check.Require(mActionRepository != null, "mActionRepository may not be null");
            Check.Require(tCommissionRepository != null, "tCommissionRepository may not be null");
            Check.Require(mActionCommRepository != null, "mActionCommRepository may not be null");
            Check.Require(tJournalRefRepository != null, "tJournalRefRepository may not be null");

            this._tTransRepository         = tTransRepository;
            this._mWarehouseRepository     = mWarehouseRepository;
            this._mSupplierRepository      = mSupplierRepository;
            this._mItemRepository          = mItemRepository;
            this._tStockCardRepository     = tStockCardRepository;
            this._tStockItemRepository     = tStockItemRepository;
            this._tTransRefRepository      = tTransRefRepository;
            this._tStockRepository         = tStockRepository;
            this._tStockRefRepository      = tStockRefRepository;
            this._mCustomerRepository      = mCustomerRepository;
            this._mRoomRepository          = mRoomRepository;
            this._mEmployeeRepository      = mEmployeeRepository;
            this._tTransDetRepository      = tTransDetRepository;
            this._tTransRoomRepository     = tTransRoomRepository;
            this._mPacketRepository        = mPacketRepository;
            this._mPacketItemCatRepository = mPacketItemCatRepository;
            this._tTransDetItemRepository  = tTransDetItemRepository;
            // this._mPacketCommRepository = mPacketCommRepository;
            this._mAccountRefRepository = mAccountRefRepository;
            this._tJournalRepository    = tJournalRepository;
            this._tJournalDetRepository = tJournalDetRepository;
            this._mAccountRepository    = mAccountRepository;
            this._mActionRepository     = mActionRepository;
            this._tCommissionRepository = tCommissionRepository;
            this._mActionCommRepository = mActionCommRepository;
            this._tJournalRefRepository = tJournalRefRepository;
        }
コード例 #4
0
        public ReportController(IMBrandRepository mBrandRepository, IMSupplierRepository mSupplierRepository, IMWarehouseRepository mWarehouseRepository, IMItemRepository mItemRepository, ITStockCardRepository tStockCardRepository, ITStockItemRepository tStockItemRepository, ITTransDetRepository tTransDetRepository, ITTransRepository tTransRepository)
        {
            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");

            this._mBrandRepository     = mBrandRepository;
            this._mSupplierRepository  = mSupplierRepository;
            this._mWarehouseRepository = mWarehouseRepository;
            this._mItemRepository      = mItemRepository;
            this._tStockCardRepository = tStockCardRepository;
            this._tStockItemRepository = tStockItemRepository;
            this._tTransDetRepository  = tTransDetRepository;
            this._tTransRepository     = tTransRepository;
        }
コード例 #5
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;
        }
コード例 #6
0
        public ReportController(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, ITRealRepository tRealRepository, IVJournalDetFlowRepository vJournalDetFlowRepository, IVStockCardFlowRepository vStockCardFlowRepository)
        {
            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(tRealRepository != null, "tRealRepository may not be null");
            Check.Require(vJournalDetFlowRepository != null, "vJournalDetFlowRepository may not be null");
            Check.Require(vStockCardFlowRepository != null, "vStockCardFlowRepository 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._tRealRepository           = tRealRepository;
            this._vJournalDetFlowRepository = vJournalDetFlowRepository;
            this._vStockCardFlowRepository  = vStockCardFlowRepository;
        }
コード例 #7
0
        public static ReportParamViewModel CreateReportParamViewModel(IMCostCenterRepository mCostCenterRepository, IMWarehouseRepository mWarehouseRepository, IMSupplierRepository mSupplierRepository, ITRecPeriodRepository tRecPeriodRepository, IMItemRepository mItemRepository)
        {
            ReportParamViewModel viewModel = new ReportParamViewModel();

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

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

            IList <MWarehouse> listWarehouse = mWarehouseRepository.GetAll();
            MWarehouse         account       = new MWarehouse();

            account.WarehouseName = "-Semua Gudang-";
            listWarehouse.Insert(0, account);
            viewModel.WarehouseList = new SelectList(listWarehouse, "Id", "WarehouseName");

            IList <MSupplier> listSupplier = mSupplierRepository.GetAll();
            MSupplier         supplier     = new MSupplier();

            supplier.SupplierName = "-Semua Supplier-";
            listSupplier.Insert(0, supplier);
            viewModel.SupplierList = new SelectList(listSupplier, "Id", "SupplierName");

            IList <TRecPeriod> listRecPeriod = tRecPeriodRepository.GetAll();

            //TRecPeriod recPeriod = new TRecPeriod();
            //recPeriod.PeriodDesc = "-Pilih Period-";
            //listRecPeriod.Insert(0, recPeriod);
            viewModel.RecPeriodList = new SelectList(listRecPeriod, "Id", "PeriodDesc");

            IList <MItem> listItem = mItemRepository.GetAll();
            MItem         item     = new MItem();

            item.ItemName = "-Semua Item-";
            listItem.Insert(0, item);
            viewModel.ItemList = new SelectList(listItem, "Id", "ItemName");

            ArrayList arr = new ArrayList();

            for (int i = 1; i <= 5; i++)
            {
                var sel = new { Id = i };
                arr.Add(sel);
            }
            viewModel.ShiftNoList = new SelectList(arr, "Id", "Id");

            arr = new ArrayList();
            arr.Add(new { Id = 1, Name = "Januari" });
            arr.Add(new { Id = 2, Name = "Februari" });
            arr.Add(new { Id = 3, Name = "Maret" });
            arr.Add(new { Id = 4, Name = "April" });
            arr.Add(new { Id = 5, Name = "Mei" });
            arr.Add(new { Id = 6, Name = "Juni" });
            arr.Add(new { Id = 7, Name = "Juli" });
            arr.Add(new { Id = 8, Name = "Agustus" });
            arr.Add(new { Id = 9, Name = "September" });
            arr.Add(new { Id = 10, Name = "Oktober" });
            arr.Add(new { Id = 11, Name = "November" });
            arr.Add(new { Id = 12, Name = "Desember" });
            viewModel.MonthList = new SelectList(arr, "Id", "Name");

            viewModel.DateFrom = DateTime.Today;
            viewModel.DateTo   = DateTime.Today;
            return(viewModel);
        }
コード例 #8
0
        public static ReportParamViewModel CreateReportParamViewModel(IMCostCenterRepository mCostCenterRepository, IMWarehouseRepository mWarehouseRepository, IMSupplierRepository mSupplierRepository, ITRecPeriodRepository tRecPeriodRepository, IMItemRepository mItemRepository)
        {
            ReportParamViewModel viewModel = new ReportParamViewModel();

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

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

            IList <MWarehouse> listWarehouse = mWarehouseRepository.GetAll();
            MWarehouse         account       = new MWarehouse();

            account.WarehouseName = "-Semua Gudang-";
            listWarehouse.Insert(0, account);
            viewModel.WarehouseList = new SelectList(listWarehouse, "Id", "WarehouseName");

            IList <MSupplier> listSupplier = mSupplierRepository.GetAll();
            MSupplier         supplier     = new MSupplier();

            supplier.SupplierName = "-Semua Supplier-";
            listSupplier.Insert(0, supplier);
            viewModel.SupplierList = new SelectList(listSupplier, "Id", "SupplierName");

            IList <TRecPeriod> listRecPeriod = tRecPeriodRepository.GetAll();
            TRecPeriod         recPeriod     = new TRecPeriod();

            recPeriod.PeriodDesc = "-Pilih Period-";
            listRecPeriod.Insert(0, recPeriod);
            viewModel.RecPeriodList = new SelectList(listRecPeriod, "Id", "PeriodDesc");

            IList <MItem> listItem = mItemRepository.GetAll();
            MItem         item     = new MItem();

            item.ItemName = "-Semua Item-";
            listItem.Insert(0, item);
            viewModel.ItemList = new SelectList(listItem, "Id", "ItemName");

            viewModel.DateFrom = DateTime.Today;
            viewModel.DateTo   = DateTime.Today;
            return(viewModel);
        }
コード例 #9
0
        public static TransactionFormViewModel CreateTransactionFormViewModel(EnumTransactionStatus enumTransactionStatus, ITTransRepository transRepository, IMWarehouseRepository mWarehouseRepository, IMSupplierRepository mSupplierRepository, IMCustomerRepository mCustomerRepository)
        {
            TransactionFormViewModel viewModel = new TransactionFormViewModel();

            viewModel.Trans = SetNewTrans(enumTransactionStatus);

            switch (enumTransactionStatus)
            {
            case EnumTransactionStatus.PurchaseOrder:
                viewModel.ViewWarehouse     = true;
                viewModel.Title             = "Order Pembelian";
                viewModel.ViewWarehouseTo   = false;
                viewModel.ViewTransBy       = true;
                viewModel.ViewDate          = true;
                viewModel.ViewFactur        = true;
                viewModel.ViewPrice         = true;
                viewModel.ViewPaymentMethod = false;
                viewModel.TransByText       = "Supplier :";
                viewModel.TransByList       = GetSupplierList();
                viewModel.UsePrice          = EnumPrice.Purchase;
                break;

            case EnumTransactionStatus.Purchase:
                viewModel.ViewWarehouse     = true;
                viewModel.Title             = "Pembelian";
                viewModel.ViewWarehouseTo   = false;
                viewModel.ViewTransBy       = true;
                viewModel.ViewDate          = true;
                viewModel.ViewFactur        = true;
                viewModel.ViewPrice         = true;
                viewModel.ViewPaymentMethod = true;
                viewModel.TransByText       = "Supplier :";
                viewModel.TransByList       = GetSupplierList();
                viewModel.UsePrice          = EnumPrice.Purchase;
                break;

            case EnumTransactionStatus.ReturPurchase:
                viewModel.ViewWarehouse     = true;
                viewModel.Title             = "Retur Pembelian";
                viewModel.ViewWarehouseTo   = false;
                viewModel.ViewTransBy       = true;
                viewModel.ViewDate          = true;
                viewModel.ViewFactur        = true;
                viewModel.ViewPrice         = true;
                viewModel.ViewPaymentMethod = true;
                viewModel.TransByText       = "Supplier :";
                viewModel.TransByList       = GetSupplierList();
                viewModel.UsePrice          = EnumPrice.Purchase;
                break;

            case EnumTransactionStatus.Sales:
                viewModel.ViewWarehouse     = true;
                viewModel.Title             = "Penjualan";
                viewModel.ViewWarehouseTo   = false;
                viewModel.ViewTransBy       = true;
                viewModel.ViewDate          = true;
                viewModel.ViewFactur        = true;
                viewModel.ViewPrice         = true;
                viewModel.ViewPaymentMethod = true;
                viewModel.TransByText       = "Konsumen :";
                viewModel.TransByList       = GetCustomerList();
                viewModel.UsePrice          = EnumPrice.Sale;
                break;

            case EnumTransactionStatus.ReturSales:
                viewModel.ViewWarehouse     = true;
                viewModel.Title             = "Retur Penjualan";
                viewModel.ViewWarehouseTo   = false;
                viewModel.ViewTransBy       = true;
                viewModel.ViewDate          = true;
                viewModel.ViewFactur        = true;
                viewModel.ViewPrice         = true;
                viewModel.ViewPaymentMethod = true;
                viewModel.TransByText       = "Konsumen :";
                viewModel.TransByList       = GetCustomerList();
                viewModel.UsePrice          = EnumPrice.Sale;
                break;

            case EnumTransactionStatus.Using:
                viewModel.ViewWarehouse     = true;
                viewModel.Title             = "Pemakaian Material";
                viewModel.ViewWarehouseTo   = false;
                viewModel.ViewTransBy       = false;
                viewModel.ViewDate          = true;
                viewModel.ViewFactur        = true;
                viewModel.ViewPrice         = false;
                viewModel.ViewPaymentMethod = false;
                viewModel.UsePrice          = EnumPrice.None;
                break;

            case EnumTransactionStatus.Mutation:
                viewModel.ViewWarehouse     = true;
                viewModel.Title             = "Mutasi Stok";
                viewModel.ViewWarehouseTo   = true;
                viewModel.ViewTransBy       = false;
                viewModel.ViewDate          = true;
                viewModel.ViewFactur        = true;
                viewModel.ViewPrice         = false;
                viewModel.ViewPaymentMethod = false;
                viewModel.UsePrice          = EnumPrice.None;
                break;

            case EnumTransactionStatus.Adjusment:
                viewModel.ViewWarehouse     = true;
                viewModel.Title             = "Penyesuaian Stok";
                viewModel.ViewWarehouseTo   = false;
                viewModel.ViewTransBy       = false;
                viewModel.ViewDate          = true;
                viewModel.ViewFactur        = true;
                viewModel.ViewPrice         = false;
                viewModel.ViewPaymentMethod = false;
                viewModel.UsePrice          = EnumPrice.None;
                break;

            case EnumTransactionStatus.Received:
                viewModel.ViewWarehouse     = true;
                viewModel.Title             = "Penerimaan Stok";
                viewModel.ViewWarehouseTo   = false;
                viewModel.ViewTransBy       = true;
                viewModel.ViewDate          = true;
                viewModel.ViewFactur        = true;
                viewModel.ViewPaymentMethod = false;
                viewModel.UsePrice          = EnumPrice.None;
                break;

            case EnumTransactionStatus.Budgeting:
                viewModel.ViewWarehouse     = true;
                viewModel.Title             = "Rencana Anggaran Belanja";
                viewModel.ViewWarehouseTo   = false;
                viewModel.ViewTransBy       = false;
                viewModel.ViewDate          = false;
                viewModel.ViewFactur        = false;
                viewModel.ViewPrice         = true;
                viewModel.ViewPaymentMethod = false;
                viewModel.UsePrice          = EnumPrice.Purchase;
                break;
            }

            //get if not add stock
            bool calculateStock = false;
            bool addStock       = false;

            GetIsCalculateStock(enumTransactionStatus, out addStock, out calculateStock);
            viewModel.IsAddStock = addStock;

            //fill warehouse if it visible
            if (viewModel.ViewWarehouse || viewModel.ViewWarehouseTo)
            {
                IList <MWarehouse> list       = mWarehouseRepository.GetAll();
                MWarehouse         mWarehouse = new MWarehouse();
                mWarehouse.WarehouseName = "-Pilih Gudang-";
                list.Insert(0, mWarehouse);
                viewModel.WarehouseList = new SelectList(list, "Id", "WarehouseName");
                if (viewModel.ViewWarehouseTo)
                {
                    viewModel.WarehouseToList = new SelectList(list, "Id", "WarehouseName");
                }
            }


            //IList<MSupplier> listSupplier = mSupplierRepository.GetAll();
            //MSupplier mSupplier = new MSupplier();
            //mSupplier.SupplierName = "-Pilih Supplier-";
            //listSupplier.Insert(0, mSupplier);
            //viewModel.SupplierList = new SelectList(listSupplier, "Id", "SupplierName");

            //var listCustomer = mCustomerRepository.GetAll();
            //MCustomer mCustomer = new MCustomer();
            ////mCustomer.SupplierName = "-Pilih Supplier-";
            //listCustomer.Insert(0, mCustomer);
            //var custs = from cust in listCustomer
            //            select new { Id = cust.Id, Name =cust.PersonId.PersonName };
            //viewModel.TransByList = new SelectList(custs, "Id", "Name");

            //fill payment method
            var values = from EnumPaymentMethod e in Enum.GetValues(typeof(EnumPaymentMethod))
                         select new { ID = e, Name = e.ToString() };

            viewModel.PaymentMethodList = new SelectList(values, "Id", "Name");

            //viewModel.MinusStock = GetIsCalculateStock(sta)
            return(viewModel);
        }
コード例 #10
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);
        }
コード例 #11
0
        public static TransactionFormViewModel Create(EnumTransactionStatus enumTransactionStatus, ITTransRepository transRepository, IMWarehouseRepository mWarehouseRepository, IMSupplierRepository mSupplierRepository, IMUnitTypeRepository mUnitTypeRepository, IMJobTypeRepository mJobTypeRepository)
        {
            TransactionFormViewModel viewModel = new TransactionFormViewModel();
            TTrans trans = SetNewTrans(enumTransactionStatus);

            viewModel.Trans = trans;
            Helper.CommonHelper.SetViewModelByStatus(viewModel, enumTransactionStatus);

            viewModel.TransFactur   = trans.TransFactur;
            viewModel.TransDate     = trans.TransDate;
            viewModel.TransId       = trans.Id;
            viewModel.TransStatus   = trans.TransStatus;
            viewModel.WarehouseId   = trans.WarehouseId;
            viewModel.WarehouseIdTo = trans.WarehouseIdTo;
            viewModel.UnitTypeId    = trans.UnitTypeId;
            viewModel.JobTypeId     = trans.JobTypeId;
            viewModel.TransDesc     = trans.TransDesc;

            IList <MWarehouse> list       = mWarehouseRepository.GetAll();
            MWarehouse         mWarehouse = new MWarehouse();

            mWarehouse.WarehouseName = "-Pilih Gudang-";
            list.Insert(0, mWarehouse);
            viewModel.WarehouseList   = new SelectList(list, "Id", "WarehouseName");
            viewModel.WarehouseToList = new SelectList(list, "Id", "WarehouseName");

            IList <MSupplier> listSupplier = mSupplierRepository.GetAll();
            MSupplier         mSupplier    = new MSupplier();

            mSupplier.SupplierName = "-Pilih Supplier-";
            listSupplier.Insert(0, mSupplier);
            viewModel.SupplierList = new SelectList(listSupplier, "Id", "SupplierName");

            IList <MUnitType> listUnitType = mUnitTypeRepository.GetAll();
            MUnitType         mUnitType    = new MUnitType();

            mUnitType.UnitTypeName = "-Pilih Unit-";
            listUnitType.Insert(0, mUnitType);
            viewModel.UnitTypeList = new SelectList(listUnitType, "Id", "UnitTypeName");

            IList <MJobType> listJobType = mJobTypeRepository.GetAll();
            MJobType         mJobType    = new MJobType();

            mJobType.JobTypeName = "-Pilih Jenis Pekerjaan-";
            listJobType.Insert(0, mJobType);
            viewModel.JobTypeList = new SelectList(listJobType, "Id", "JobTypeName");

            //fill payment method
            var values = from EnumPaymentMethod e in Enum.GetValues(typeof(EnumPaymentMethod))
                         select new { ID = e, Name = e.ToString() };

            viewModel.PaymentMethodList = new SelectList(values, "Id", "Name");

            //viewModel.ViewWarehouseTo = false;
            //viewModel.ViewSupplier = false;
            //viewModel.ViewDate = false;
            //viewModel.ViewFactur = false;

            return(viewModel);
        }
コード例 #12
0
        public static ReportParamViewModel CreateReportParamViewModel(IMWarehouseRepository mWarehouseRepository, IMSupplierRepository mSupplierRepository, IMItemRepository mItemRepository)
        {
            ReportParamViewModel viewModel = new ReportParamViewModel();

            IList <MWarehouse> listWarehouse = mWarehouseRepository.GetAll();
            MWarehouse         account       = new MWarehouse();

            account.WarehouseName = "-Semua Gudang-";
            listWarehouse.Insert(0, account);
            viewModel.WarehouseList = new SelectList(listWarehouse, "Id", "WarehouseName");

            IList <MSupplier> listSupplier = mSupplierRepository.GetAll();
            MSupplier         supplier     = new MSupplier();

            supplier.SupplierName = "-Semua Supplier-";
            listSupplier.Insert(0, supplier);
            viewModel.SupplierList = new SelectList(listSupplier, "Id", "SupplierName");

            //IList<TRecPeriod> listRecPeriod = tRecPeriodRepository.GetAll();
            ////TRecPeriod recPeriod = new TRecPeriod();
            ////recPeriod.PeriodDesc = "-Pilih Period-";
            ////listRecPeriod.Insert(0, recPeriod);
            //viewModel.RecPeriodList = new SelectList(listRecPeriod, "Id", "PeriodDesc");

            IList <MItem> listItem = mItemRepository.GetAll();
            MItem         item     = new MItem();

            item.ItemName = "-Semua Item-";
            listItem.Insert(0, item);
            viewModel.ItemList = new SelectList(listItem, "Id", "ItemName");

            ArrayList arr = new ArrayList();

            for (int i = 1; i <= 5; i++)
            {
                var sel = new { Id = i };
                arr.Add(sel);
            }
            viewModel.ShiftNoList = new SelectList(arr, "Id", "Id");

            viewModel.DateFrom = DateTime.Today;
            viewModel.DateTo   = DateTime.Today;

            return(viewModel);
        }