public ActionResult Edit(string id)
        {
            sp_DepartmentSelect_Result model = new sp_DepartmentSelect_Result();
            var deptData = DepartmentBusinessLogic.getInstance().getDepartmentById(id);

            model.DepartmentId   = deptData.DepartmentId;
            model.DepartmentName = deptData.DepartmentName;
            return(View(model));
        }
 public ActionResult Delete(string id)
 {
     if (DepartmentBusinessLogic.getInstance().DeleteDepartment(id) == -1)
     {
         TempData["Success"] = "Department was successfully deleted";
     }
     else
     {
         TempData["Error"] = "Department was unsuccessfully deleted";
     }
     return(RedirectToAction("Index"));
 }
 public ActionResult Edit(sp_DepartmentSelect_Result model)
 {
     if (DepartmentBusinessLogic.getInstance().UpdateDepartment(model) == -1)
     {
         TempData["Success"] = "Department was successfully updated";
     }
     else
     {
         TempData["Error"] = "Department was unsuccessfully updated";
     }
     return(RedirectToAction("Index"));
 }
Esempio n. 4
0
        public ActionResult Edit(string id)
        {
            sp_UserSelect_Result model = new sp_UserSelect_Result();
            var userData = UserBusinessLogic.getInstance().getUserById(id);

            model.UserId           = userData.UserId;
            model.UserName         = userData.UserName;
            model.Name             = userData.Name;
            model.Password         = userData.Password;
            model.RoleId           = userData.RoleId;
            model.DepartmentId     = userData.DepartmentId;
            ViewBag.RoleList       = common.ToSelectList(RoleBusinessLogic.getInstance().getRoleDDL(), "ID", "NAME", model.RoleId);
            ViewBag.DepartmentList = common.ToSelectList(DepartmentBusinessLogic.getInstance().getDepartmentDDL(), "ID", "NAME", model.DepartmentId);
            return(View(model));
        }
Esempio n. 5
0
 public ActionResult Create()
 {
     ViewBag.RoleList       = common.ToSelectList(RoleBusinessLogic.getInstance().getRoleDDL(), "ID", "NAME", string.Empty);
     ViewBag.DepartmentList = common.ToSelectList(DepartmentBusinessLogic.getInstance().getDepartmentDDL(), "ID", "NAME", string.Empty);
     return(View());
 }
 public ActionResult Index()
 {
     return(View(DepartmentBusinessLogic.getInstance().ListDepartment()));
 }