Exemple #1
0
        // GET: Products
        public ActionResult Index()
        {
            ProductViewModel model = new ProductViewModel();
            var custRepo           = new CustomerRepository();

            model.Customers = custRepo.GetCustomers();
            var salesPersonRepo = new SalesPersonRepository();

            model.SalesPersons = salesPersonRepo.GetSalesPersons();

            return(View(model));
        }
Exemple #2
0
        public JsonResult SalesPersonList()
        {
            var repo            = new SalesPersonRepository();
            var salesPersonList = repo.GetSalesPersons();

            var pdto = new DTResponse
            {
                recordsTotal    = salesPersonList.Count(),
                recordsFiltered = salesPersonList.Count(),
                data            = salesPersonList,
                draw            = 0,
                error           = ""
            };

            return(new JsonResult {
                Data = pdto, JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }