public ActionResult Edit(MeasureModel model) { if (ModelState.IsValid) { db.Entry(model).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Details/" + model.MeasureId.ToString())); } return(View(model)); }
public ActionResult Edit([Bind(Include = "Id,Name,Active,ShowCloset")] Room room) { if (ModelState.IsValid) { db.Entry(room).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(room)); }
public ActionResult Edit2(Customer customer) { if (ModelState.IsValid) { EntityState state = db.Entry(customer).State; db.Entry(customer).State = EntityState.Modified; try { customer.LastModifiedById = User.Identity.GetUserId(); customer.LastModifiedDateTime = DateTime.Now; db.SaveChanges(); return(RedirectToAction("Index")); } catch (System.Data.Entity.Validation.DbEntityValidationException e) { } } return(View(customer)); }
public ActionResult Edit([Bind(Include = "Id,Name,ImageName,Logo,QBClass")] StoreType storetype) { if (ModelState.IsValid) { db.Entry(storetype).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(storetype)); }
public ActionResult Edit([Bind(Include = "Id,Description")] MaterialType materialtype) { if (ModelState.IsValid) { db.Entry(materialtype).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(materialtype)); }
public ActionResult Edit([Bind(Include = "Id,Name,PrinterName,PrinterPort,PrinterDriver,Address,City,State,ZipCode,PhoneNumber,FaxNumber,ManagerId,Active,Latitude,Longitude,LabelPrinter")] Branch branch) { if (ModelState.IsValid) { db.Entry(branch).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ManagerId = new SelectList(db.Employees, "Id", "FirstName", branch.ManagerId); return(View(branch)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Description")] EmailType emailtype) { if (ModelState.IsValid) { db.Entry(emailtype).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(emailtype)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,EmailTypeId,Name,Content,Active")] EmailTemplate emailtemplate) { if (ModelState.IsValid) { emailtemplate.Content = Server.UrlDecode(emailtemplate.Content); db.Entry(emailtemplate).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.EmailTypeId = new SelectList(db.EmailTypes, "Id", "Description", emailtemplate.EmailTypeId); return(View(emailtemplate)); }
public ActionResult AddTech(Models.AddTech item) { if (ModelState.IsValid) { RandREng.MeasureDBEntity.Store store = db.Stores.Find(item.Id); RandREng.MeasureDBEntity.Tech tech = db.Teches.Find(item.TechId); if ((store == null || tech == null)) { return(HttpNotFound()); } if (!store.Techs.Contains(tech)) { store.Techs.Add(tech); db.Entry(store).State = EntityState.Modified; int c = db.SaveChanges(); } return(RedirectToAction("Details", "Store", new { id = item.Id })); } ViewBag.TechId = new SelectList(db.Teches, "Id", "Name", item.TechId); return(View(item)); }
public async Task <ActionResult> Edit([Bind(Include = "NickName,Address1,Address2,City,State,Zip,SSN,Email,SMTPEmail,ReceiveCallNotes,UserId,Active,PhoneNumber1,PhoneNumber2")] Employee employee) { if (ModelState.IsValid) { employee.PhoneNumber1 = PhoneNumber10.Reformat(employee.PhoneNumber1); employee.PhoneNumber2 = PhoneNumber10.Reformat(employee.PhoneNumber2); db.Entry(employee).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.UserId = new SelectList(db.AspNetUsers, "Id", "UserName", employee.UserId); return(View(employee)); }