public ActionResult EditEndResult(int id) { BL_EndResult db = new BL_EndResult(); ModelState.Clear(); return(View(db.GetEndResult(id))); }
public JsonResult ShowEndResult() { BL_EndResult db = new BL_EndResult(); return(new JsonResult { Data = db.SelectAllData(), JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
public ActionResult Delete(int EndResultID) { string val = ""; BL_EndResult db = new BL_EndResult(); if (db.DeleteEndResult(EndResultID)) { val = "EndResult Deleted Successfully"; } // Response.Redirect("TestMasterAdd.cshtml"); return(Json(val)); }
public ActionResult EndResult(EndResult obj1, FormCollection collection) { BL_EndResult db = new BL_EndResult(); try { if (db.CheckEndResult(obj1.EndResultID, obj1.EndResultName)) { if (db.Save(obj1)) { if (obj1.EndResultID > 0) { ModelState.Clear(); TempData["Msg"] = "EndResult Update Successfully"; return(RedirectToAction("EndResult", "EndResult")); } else { ModelState.Clear(); TempData["Msg"] = "EndResult Saved Successfully"; return(RedirectToAction("EndResult", "EndResult")); } } } else { //TempData["Msg"] = "Error"; TempData["Msg"] = "EndResult Already Exist's"; return(RedirectToAction("EndResult", "EndResult")); } return(RedirectToAction("EndResult", "EndResult")); } catch (Exception ex) { TempData["Msg"] = ex.Message; return(RedirectToAction("EndResult", "EndResult")); } }