Exemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "DepartmentId,DeptName,DeptCode,DeptCredit,Adminstrator,StratDate,Building")] Department department)
 {
     if (ModelState.IsValid)
     {
         if (!_departmentBusiness.IsDeptNameExists(department.DeptName))
         {
             if (!_departmentBusiness.IsDeptCodeExists(department.DeptCode))
             {
                 _departmentBusiness.Update(department);
                 // return RedirectToAction("Index");
                 ViewBag.Message = "Department Updated Successfully!";
                 // return RedirectToAction("Index");
             }
             else
             {
                 ViewBag.Message = "Department Code Already Exists !";
             }
         }
         else
         {
             ViewBag.Message = "Department Name Already Exists !";
         }
     }
     return(View(department));
 }
Exemplo n.º 2
0
        public ActionResult Edit(DepartmentViewModel model)
        {
            var data = new DepartmentModel();

            data.departmentId       = model.DepartmentId;
            data.departmentname     = model.DepartmentName;
            data.description        = model.Description;
            data.VisibleOnDashboard = model.VisibleOnDashboard ?? false;
            idepartmentBusiness.Update(data);
            // return RedirectToAction("Index");
            return(Json(new
            {
                success = true
            }));
        }
Exemplo n.º 3
0
 public DepartmentModel UpdateAcount([FromBody] DepartmentModel model)
 {
     _itemBusiness.Update(model);
     return(model);
 }