public ActionResult saveuser(int id, string propertyName, string value) { var status = false; var message = ""; //Update data to database using (sithar_dbEntities1 dc = new sithar_dbEntities1()) { var user = dc.ConstructorRequests.Find(id); if (user != null) { dc.Entry(user).Property(propertyName).CurrentValue = value; dc.SaveChanges(); status = true; } else { message = "Error!"; } } var response = new { value = value, status = status, message = message }; JObject o = JObject.FromObject(response); return(Content(o.ToString())); }
public ActionResult UpdateSupplier(int id, Supplier sup) { try { using (sithar_dbEntities1 db = new sithar_dbEntities1()) { db.Entry(sup).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } // TODO: Add update logic here return(RedirectToAction("getSuppliers")); } catch { return(View()); } }
public ActionResult UpdatePolicy(int id, Policy pol) { try { using (sithar_dbEntities1 db = new sithar_dbEntities1()) { db.Entry(pol).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } // TODO: Add update logic here return(RedirectToAction("Policies")); } catch { return(View()); } }
public ActionResult UpdateSiteItemQty(int id, SiteItemQuantity siq) { try { using (sithar_dbEntities1 db = new sithar_dbEntities1()) { db.Entry(siq).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } // TODO: Add update logic here return(RedirectToAction("SiteItemQty")); } catch { return(View()); } }
public ActionResult EditLog(int id, Log log) { try { using (sithar_dbEntities1 db = new sithar_dbEntities1()) { db.Entry(log).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } // TODO: Add update logic here return(RedirectToAction("getLogs")); } catch { return(View()); } }
public ActionResult UpdateEmployee(int id, AuthEmployee emp) { try { using (sithar_dbEntities1 db = new sithar_dbEntities1()) { db.Entry(emp).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } // TODO: Add update logic here return(RedirectToAction("Initial")); } catch { return(View()); } }
public ActionResult UpdateRequest(int id, ConstructorRequest cq) { try { using (sithar_dbEntities1 db = new sithar_dbEntities1()) { db.Entry(cq).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } // TODO: Add update logic here return(RedirectToAction("getConRequest")); } catch { return(View()); } }