예제 #1
0
        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());
            }
        }
예제 #2
0
 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));
     }
 }
예제 #3
0
        public ActionResult Delete(int id)
        {
            Emp model = Emp.GetById(id);

            return(View(model));
        }