public ActionResult Index() { try { var Category = Connection.GDgetAllSchoolCategory("Y"); List <GDgetAllSchoolCategory_Result> Categorylist = Category.ToList(); SchoolCategoryModel tcm = new SchoolCategoryModel(); List <SchoolCategoryModel> tcmlist = Categorylist.Select(x => new SchoolCategoryModel { SchoolCategoryId = x.SchoolCategoryId, SchoolCategoryName = x.SchoolCategoryName, CreatedBy = x.CreatedBy, CreatedDate = x.CreatedDate, IsActive = x.IsActive, ModifiedBy = x.ModifiedBy, ModifiedDate = x.ModifiedDate }).ToList(); return(View(tcmlist)); } catch (Exception ex) { Errorlog.ErrorManager.LogError(ex); return(View()); } }
public ActionResult Delete(int Code) { try { SchoolCategoryModel TModel = new SchoolCategoryModel(); TModel.SchoolCategoryId = Code; return(PartialView("DeleteView", TModel)); } catch (Exception ex) { Errorlog.ErrorManager.LogError(ex); return(View()); } }
public ActionResult Delete(SchoolCategoryModel Model) { UserId = USession.User_Id; try { Connection.GDdeleteSchoolCategory("N", Model.SchoolCategoryId, UserId); Connection.SaveChanges(); return(Json(true, JsonRequestBehavior.AllowGet)); //return RedirectToAction("Index"); } catch (Exception ex) { Errorlog.ErrorManager.LogError(ex); return(View()); } }
public ActionResult Edit(SchoolCategoryModel Model) { UserId = USession.User_Id; try { tblSchoolCategory TCtable = Connection.tblSchoolCategories.SingleOrDefault(x => x.SchoolCategoryId == Model.SchoolCategoryId); Connection.GDModifySchoolCategory(Model.SchoolCategoryName, Model.SchoolCategoryId, UserId); Connection.SaveChanges(); return(RedirectToAction("Index")); } catch (Exception ex) { Errorlog.ErrorManager.LogError(ex); return(View()); } }
public ActionResult Edit(int Code) { try{ SchoolCategoryModel TModel = new SchoolCategoryModel(); tblSchoolCategory TCtable = Connection.tblSchoolCategories.SingleOrDefault(x => x.SchoolCategoryId == Code); TModel.IsActive = TCtable.IsActive; TModel.SchoolCategoryId = TCtable.SchoolCategoryId; TModel.SchoolCategoryName = TCtable.SchoolCategoryName; return(PartialView("EditView", TModel)); } catch (Exception ex) { Errorlog.ErrorManager.LogError(ex); return(View()); } }