public async Task <ActionResult> Update(FurnitureSalon salon) { if (ModelState.IsValid) { await _db.Update(salon); return(Json(new { success = true, message = "Updated Successfully" }, JsonRequestBehavior.AllowGet)); } return(View(salon)); }
public async Task Update(FurnitureSalon furnitureSalon) { db.Entry(furnitureSalon).State = System.Data.Entity.EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { throw; } }
public async Task <ActionResult> Add(FurnitureSalon salon) { if (ModelState.IsValid) { await _db.Add(salon); await _db.SaveAsync(); return(Json(new { success = true, message = "Added Successfully" })); } return(View(salon)); }
public async Task <FurnitureSalon> Add(FurnitureSalon furnitureSalon) { return(db.FurnitureSalons.Add(furnitureSalon)); }