Example #1
0
 public ActionResult Edit(Office ofc)
 {
     if (Session["uname"] != null)
     {
         officeService.Update(ofc);
         return(RedirectToAction("Index", "Office"));
     }
     return(RedirectToAction("Index", "Home"));
 }
Example #2
0
 public ActionResult Edit(OfficeViewModel objOfficeViewModel)
 {
     if (ModelState.IsValid)
     {
         _OfficeService.Update(objOfficeViewModel.objoffice);
         return(RedirectToAction("Index"));
     }
     return(View(objOfficeViewModel));
 }
Example #3
0
 public ActionResult Edit(Office model)
 {
     try
     {
         OfficeService service = new OfficeService();
         service.Update(model);
         return(RedirectToAction("Index", "Office"));
     }
     catch
     {
         return(View());
     }
 }
Example #4
0
        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();
        }
Example #5
0
 public ActionResult Edit(Office ofc)
 {
     officeService.Update(ofc);
     return(RedirectToAction("Index", "Office"));
 }