public async Task <ActionResult> DeleteConfirmed(int id) { ProductUnitOfMeasurement productUnitOfMeasurement = await db.ProductUnitOfMeasurements.FindAsync(id); db.ProductUnitOfMeasurements.Remove(productUnitOfMeasurement); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "ProductUnitOfMeasurementID,UnitName,UnitAbbreviation")] ProductUnitOfMeasurement productUnitOfMeasurement) { if (ModelState.IsValid) { db.Entry(productUnitOfMeasurement).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(productUnitOfMeasurement)); }
public async Task <ActionResult> Create([Bind(Include = "ProductUnitOfMeasurementID,UnitName,UnitAbbreviation")] ProductUnitOfMeasurement productUnitOfMeasurement) { if (ModelState.IsValid) { db.ProductUnitOfMeasurements.Add(productUnitOfMeasurement); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(productUnitOfMeasurement)); }
// GET: ProductUnitOfMeasurements/Delete/5 public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ProductUnitOfMeasurement productUnitOfMeasurement = await db.ProductUnitOfMeasurements.FindAsync(id); if (productUnitOfMeasurement == null) { return(HttpNotFound()); } return(View(productUnitOfMeasurement)); }