コード例 #1
0
        //
        // GET: /AgentCommission/

        public ActionResult Index()
        {
            var bookingRepository             = new BookingRepository();
            var agentTourCommissionRepository = new AgentTourCommissionRepository();

            List <SelectListItem> selectListItems1 = new List <SelectListItem>();
            SelectListItem        item             = new SelectListItem();

            foreach (BookingModel c in bookingRepository.GetTourCodes())
            {
                item       = new SelectListItem();
                item.Value = c.Tour.ToString();
                item.Text  = c.tourcodevalues;
                selectListItems1.Add(item);
            }
            ViewBag.TourCodes = selectListItems1;

            List <SelectListItem> selectListItems2 = new List <SelectListItem>();

            foreach (RegisterModel c in bookingRepository.GetUsers())
            {
                item       = new SelectListItem();
                item.Value = c.ID.ToString();
                item.Text  = c.Name;
                selectListItems2.Add(item);
            }
            ViewBag.Users = selectListItems2;

            var agentTourCommissions = agentTourCommissionRepository.GetList();

            return(View(agentTourCommissions));
        }
コード例 #2
0
        public JsonResult getAgentTourCommissions(int UserID)
        {
            var repository = new AgentTourCommissionRepository();

            return(Json(repository.GetList(UserID)));
        }