public ActionResult EditTally(int id) { if (Session["employee"] == null) { return(RedirectToAction("Login", "Login", new { returnurl = HttpContext.Request.Url })); } else { CHistory newHist = new CHistory(); newHist.LoadTallyByID(id); return(View(newHist)); } }
public ActionResult EditTally(int id, CHistory newHist) { try { // TODO: Add update logic here newHist.UpdateTally(id); return(RedirectToAction("HistoryList")); } catch (Exception ex) { ViewBag.Error = ex.Message; return(View()); } }
public ActionResult CreateTally(CHistory newHist) { try { // TODO: Add insert logic here newHist.InsertTally(); return(RedirectToAction("HistoryList", "History")); } catch (Exception ex) { ViewBag.Error = ex.Message; return(View()); } }