Пример #1
0
 public string Edit(int Id, string Tax_name, string Tax_Percentage, string gender, string date)
 {
     demo_dbEntities db = new demo_dbEntities();
     string msg;
     try
     {
         if (ModelState.IsValid)
         {
            // Tax_Enter Emp = new Tax_Enter();
             Tax_Enter Emp = db.Tax_Enter.First(em1 => em1.Id == Id);
             Emp.Tax_name = Tax_name;
             Emp.Tax_Percentage = Tax_Percentage;
             Emp.gender = gender;
             Emp.date = date;
             db.SaveChanges();
             msg = "Saved Successfully";
         }
         else
         {
             msg = "Validation data not successfull";
         }
     }
     catch (Exception ex)
     {
         msg = "Error occured:" + ex.Message;
     }
     return msg;
 }
Пример #2
0
        public JsonResult show()
        {
            demo_dbEntities db = new demo_dbEntities();
            List<Tax_Enter> Emp = db.Tax_Enter.ToList();

            return Json(Emp, JsonRequestBehavior.AllowGet);
        }
Пример #3
0
 public string Delete(int Id)
 {
     demo_dbEntities db = new demo_dbEntities();
     Tax_Enter Emp = db.Tax_Enter.First(em1 => em1.Id == Id);
     db.DeleteObject(Emp);
     db.SaveChanges();
     return "Deleted successfully";
 }
Пример #4
0
 //
 // GET: /webgrid/
 public ActionResult Index()
 {
     using (demo_dbEntities db = new demo_dbEntities())
     {
         var list = db.Tax_Enter.ToList();
         return View(list);
     }
 }