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