public ActionResult Detail(string salespersonId) { var salesperson = _salespersonDynamicsRepository.GetSalesperson(salespersonId); SalespersonViewModel model = new SalespersonConverter().ConvertToView(salesperson); return(View(model)); }
public JsonResult GetSalespersonByCustomer(string customerId) { var customer = _customerDynamicsRepository.GetCustomer(customerId); var salesperson = _salespersonDynamicsRepository.GetSalespersons().FirstOrDefault(x => x.SLPRSNID.Replace(" ", string.Empty).ToLower() == customer.SLPRSNID.Replace(" ", string.Empty).ToLower()); SalespersonViewModel model = new SalespersonConverter().ConvertToView(salesperson); return(Json(model, JsonRequestBehavior.AllowGet)); }
public ActionResult Index() { var model = new SalespersonViewModel(); var salespersons = new List <SalespersonViewModel>(); var tempSalespersons = _salespersonDynamicsRepository.GetSalespersons().Where(x => x.INACTIVE != 1).ToList(); if (tempSalespersons != null && tempSalespersons.Count > 0) { foreach (var tempSalesperson in tempSalespersons) { SalespersonViewModel convertedModel = new SalespersonConverter().ConvertToView(tempSalesperson); salespersons.Add(convertedModel); } } model.Salespersons = salespersons.OrderBy(x => x.SalespersonName).ToList(); return(View(model)); }
public JsonResult GetInactiveSalespersons() { var model = new SalespersonViewModel(); var salespersons = new List <SalespersonViewModel>(); var tempSalespersons = _salespersonDynamicsRepository.GetSalespersons().Where(x => x.INACTIVE != 0).ToList(); if (tempSalespersons != null && tempSalespersons.Count > 0) { foreach (var tempSalesperson in tempSalespersons) { SalespersonViewModel convertedModel = new SalespersonConverter().ConvertToView(tempSalesperson); salespersons.Add(convertedModel); } } model.Salespersons = salespersons.OrderBy(x => x.SalespersonName).ToList(); return(Json(model, JsonRequestBehavior.AllowGet)); }