public async Task <IActionResult> OutputView(StudentRegisterationModel M) { if (M.file == null) { return(Content("files not selected")); } await FManager.UploadFileAsync(M); try { if (M.id != 0) { await EditRecord(M); } else { await Handler.SaveUser(M); } } catch (Exception e) { Content(e.ToString()); } try { Pages.Currentpage = 1; Pages.StudentList = Handler.GetStudents(1, "Id", Pages.PageSize).Result; } catch (Exception e) { Content(e.ToString()); } return(View(Pages)); }
public IActionResult InputView(StudentRegisterationModel M) { if (M == null) { return(View()); } return(View(M)); }
public async Task <IActionResult> DeleteRecord(int id) { StudentRegisterationModel M = new StudentRegisterationModel(); M.id = id; try { await Handler.DeleteUser(M); } catch (Exception e) { Content(e.ToString()); } return(RedirectToAction("OutputView")); }
public async Task <IActionResult> OutputView(StudentRegisterationModel M) { if (M.file == null) { return(Content("files not selected")); } await FManager.UploadFileAsync(M); await Handler.SaveUser(M); StudentList.Add(M); return(View(StudentList)); }
public async Task <IActionResult> EditRecord(StudentRegisterationModel M) { try { await Handler.UpdateUser(M); } catch (Exception e) { Content(e.ToString()); } return(RedirectToAction("OutputView")); }