public async Task <JsonResult> AjaxRequest(NameType?nameType, NameGender?nameGender, int limit) { if (nameType == null && nameGender == null) { nameList = await NameService.GetNameList(limit); return(Json(nameList)); } else if (nameType == null && nameGender != null) { nameList = await NameService.GetNameList(nameGender, limit); return(Json(nameList)); } else if (nameGender == null && nameType != null) { nameList = await NameService.GetNameList(nameType, limit); return(Json(nameList)); } else { nameList = await NameService.GetNameList(nameType, nameGender, limit); return(Json(nameList)); } }
public async Task <ActionResult> UpdateRequest(NameType?nameType, NameGender?nameGender, int limit) { if (nameType == null && nameGender == null) { nameList = await NameService.GetNameList(limit); return(View("Index", nameList)); } else if (nameType == null && nameGender != null) { nameList = await NameService.GetNameList(nameGender, limit); return(View("Index", nameList)); } else if (nameGender == null && nameType != null) { nameList = await NameService.GetNameList(nameType, limit); return(View("Index", nameList)); } else { nameList = await NameService.GetNameList(nameType, nameGender, limit); return(View("Index", nameList)); } }
public async Task <ActionResult> Index() { //Default request när sidan laddas nameList = await NameService.GetNameList(10); return(View(nameList)); }
public ActionResult Index() { // starting limit of 10 names with NameType=Both and NameGender=Both int limit = 10; // Getting the list from the NameAPI library nameList = NameService.GetNameList(limit); return(View(nameList)); }
public ActionResult Reload(NameGender gender, NameType type, int limit) { // storing the choises in the predefined variables ctrlGender = gender; ctrlType = type; ctrlLimit = limit; // Getting the list from the NameAPI library nameList = NameService.GetNameList(type, gender, limit); return(View("Index", nameList)); }
public ActionResult AjaxReload() { nameList = NameService.GetNameList(ctrlType, ctrlGender, ctrlLimit); return(PartialView("_AjaxView", nameList)); }