public ActionResult Delete(int id, FormCollection collection) { try { Emp model = Emp.GetById(id); model.Delete(); return(RedirectToAction("Index")); } catch (Exception e) { ViewBag.error = e.ToString(); return(View()); } }
public ActionResult Edit(int id, FormCollection collection) { try { Emp model = Emp.GetById(id); model.payed_at = DateTime.Now;// Convert.ToDateTime(collection.Get("payed_at")); model.probeg = Convert.ToInt32(collection.Get("probeg")); model.litrs = Convert.ToInt32(collection.Get("litrs")); model.summa = Convert.ToDecimal(collection.Get("summa")); model.Update(); return(RedirectToAction("Index")); } catch (Exception ex) { return(this.Edit(id)); } }
public ActionResult Delete(int id) { Emp model = Emp.GetById(id); return(View(model)); }