Ejemplo n.º 1
0
 public ActionResult Delete(int id)
 {
     using (HISDBEntities db = new HISDBEntities())
     {
         IntakeFrequency ifs = db.IntakeFrequencies.Where(x => x.FrequencyID == id)
                               .FirstOrDefault <IntakeFrequency>();
         db.IntakeFrequencies.Remove(ifs);
         db.SaveChanges();
         return(Json(new { success = true, message = "Deleted Successfully" }, JsonRequestBehavior.AllowGet));
     }
 }
Ejemplo n.º 2
0
 public ActionResult AddModify(IntakeFrequency ifs)
 {
     using (HISDBEntities db = new HISDBEntities())
     {
         if (ifs.FrequencyID == 0)
         {
             db.IntakeFrequencies.Add(ifs);
             db.SaveChanges();
             return(Json(new { success = true, message = "Saved Successfully" }, JsonRequestBehavior.AllowGet));
         }
         else
         {
             db.Entry(ifs).State = EntityState.Modified;
             db.SaveChanges();
             return(Json(new { success = true, message = "Updated Successfully" }, JsonRequestBehavior.AllowGet));
         }
     }
 }