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