Exemplo n.º 1
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;
        }
        public static BillingFormViewModel CreateBillingViewModel(IMRoomRepository mRoomRepository, IMEmployeeRepository mEmployeeRepository, IMCustomerRepository mCustomerRepository, ITTransRoomRepository transRoomRepository)
        {
            BillingFormViewModel viewModel = new BillingFormViewModel();

            viewModel.SpaManRoomList   = GetRoomViewModel(transRoomRepository, mRoomRepository.GetListByRoomType(EnumRoomType.SpaMan));
            viewModel.SpaWomanRoomList = GetRoomViewModel(transRoomRepository, mRoomRepository.GetListByRoomType(EnumRoomType.SpaWomen));
            viewModel.ReflexyRoomList  = GetRoomViewModel(transRoomRepository, mRoomRepository.GetListByRoomType(EnumRoomType.Reflexy));

            //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 != null ? cust.PersonId.PersonName : "-Pilih Konsumen-" };
            //viewModel.CustomerList = new SelectList(custs, "Id", "Name");

            //var listEmployee = mEmployeeRepository.GetAll();
            //MEmployee employee = new MEmployee();
            ////mCustomer.SupplierName = "-Pilih Supplier-";
            //listEmployee.Insert(0, employee);
            //var employees = from emp in listEmployee
            //                select new { Id = emp.Id, Name = emp.PersonId != null ? emp.PersonId.PersonName : "-Pilih Terapis-" };
            //viewModel.TherapistList = new SelectList(employees, "Id", "Name");


            TTrans trans = new TTrans();

            trans.SetAssignedIdTo(Guid.NewGuid().ToString());
            trans.TransDiscount = 0;
            trans.TransDate     = DateTime.Today;
            viewModel.Trans     = trans;

            TTransRoom transRoom = new TTransRoom();

            transRoom.RoomInDate  = DateTime.Now;
            transRoom.RoomOutDate = DateTime.Now;
            viewModel.TransRoom   = transRoom;

            return(viewModel);
        }
Exemplo n.º 3
0
        public RoomController(IMRoomRepository mRoomRepository)
        {
            Check.Require(mRoomRepository != null, "mRoomRepository may not be null");

            this._mRoomRepository = mRoomRepository;
        }