예제 #1
0
        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));
        }
예제 #2
0
 public IActionResult InputView(StudentRegisterationModel M)
 {
     if (M == null)
     {
         return(View());
     }
     return(View(M));
 }
예제 #3
0
        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"));
        }
예제 #4
0
        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));
        }
예제 #5
0
 public async Task <IActionResult> EditRecord(StudentRegisterationModel M)
 {
     try { await Handler.UpdateUser(M); }
     catch (Exception e) { Content(e.ToString()); }
     return(RedirectToAction("OutputView"));
 }