Exemple #1
0
        public static SalesViewModel Create(IMAgentRepository mAgentRepository)
        {
            SalesViewModel viewModel = new SalesViewModel();

            viewModel.SalesDate = DateTime.Today;

            IList <MAgent> list  = mAgentRepository.GetAll();
            MAgent         agent = new MAgent();

            agent.AgentName = "-Pilih Agen-";
            list.Insert(0, agent);
            viewModel.AgentList = new SelectList(list, "Id", "AgentName");
            viewModel.SalesId   = Guid.NewGuid().ToString();
            return(viewModel);
        }
        public static ReportParamViewModel Create(IMAgentRepository mAgentRepository, IMGameRepository mGameRepository)
        {
            ReportParamViewModel viewModel = new ReportParamViewModel();

            IList <MAgent> list       = mAgentRepository.GetAll();
            MAgent         costCenter = new MAgent();

            costCenter.AgentName = "-Semua Agen-";
            list.Insert(0, costCenter);
            viewModel.AgentList = new SelectList(list, "Id", "AgentName");

            IList <MGame> listGame = mGameRepository.GetAll();
            MGame         game     = new MGame();

            game.GameName = "-Semua Game-";
            listGame.Insert(0, game);
            viewModel.GameList = new SelectList(listGame, "Id", "GameName");

            viewModel.DateFrom = DateTime.Today;
            viewModel.DateTo   = DateTime.Today;
            return(viewModel);
        }