//It is for testing // GET api/values/5 public Object Get(int id) { const int PHONE_FILTER = 0; const int PROMO_FILTER = 1; var promoDisplay = new PromoUsersVisualizationHandler(); Object viewResult; switch (id) { case PROMO_FILTER: viewResult = promoDisplay.getUserByPromo("type-2"); break; case PHONE_FILTER: viewResult = promoDisplay.getUserByPhoneNumber("12345678"); break; default: viewResult = promoDisplay.getAllUsers(); break; } return(viewResult); }
public ActionResult SeeUsersByFilter(int filter, string valueFilter) { ActionResult viewResult; switch (filter) { case PROMO_FILTER: viewResult = View(promoDisplay.getUserByPromo(valueFilter)); break; case PHONE_FILTER: viewResult = View(promoDisplay.getUserByPhoneNumber(valueFilter)); break; case DATE_FILTER: viewResult = RedirectToAction("SelectDatesFilter"); break; default: viewResult = RedirectToAction("SeeUsersByFilter"); break; } return(viewResult); }