コード例 #1
0
 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));
     }
 }
コード例 #2
0
 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());
     }
 }
コード例 #3
0
 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());
     }
 }