public async Task <ActionResult> DeleteConfirmed(int id) { MerchandiseProductSize merchandiseProductSize = await db.MerchandiseProductSizes.FindAsync(id); db.MerchandiseProductSizes.Remove(merchandiseProductSize); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MerchandiseProductSize merchandiseProductSize = await db.MerchandiseProductSizes.FindAsync(id); if (merchandiseProductSize == null) { return(HttpNotFound()); } return(View(merchandiseProductSize)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Size,CreatedOn,CreatedBy")] MerchandiseProductSize merchandiseProductSize) { if (ModelState.IsValid) { merchandiseProductSize.ModifiedBy = HttpContext.User.Identity.Name; merchandiseProductSize.ModifiedOn = DateTime.Now; db.Entry(merchandiseProductSize).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(merchandiseProductSize)); }