public ActionResult Edit(Office ofc) { if (Session["uname"] != null) { officeService.Update(ofc); return(RedirectToAction("Index", "Office")); } return(RedirectToAction("Index", "Home")); }
public ActionResult Edit(OfficeViewModel objOfficeViewModel) { if (ModelState.IsValid) { _OfficeService.Update(objOfficeViewModel.objoffice); return(RedirectToAction("Index")); } return(View(objOfficeViewModel)); }
public ActionResult Edit(Office model) { try { OfficeService service = new OfficeService(); service.Update(model); return(RedirectToAction("Index", "Office")); } catch { return(View()); } }
private void btnSave_Click(object sender, EventArgs e) { object dataTable = gridControl1.DataSource; OfficeService officeService = new OfficeService(new CoffeShopContext()); if (officeService.Update(dataTable)) { MessageBox.Show("Lưu Thành Công", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Thất Bại", "Thông Báo", MessageBoxButtons.OKCancel, MessageBoxIcon.Error); } loadData(); }
public ActionResult Edit(Office ofc) { officeService.Update(ofc); return(RedirectToAction("Index", "Office")); }