Beispiel #1
0
        public ActionResult Department(DepartmentModel model)
        {
            ViewBag.Company = _accountService.GetAllCompany();
            if (ModelState.IsValid)
            {
                string currentUser      = HttpContext.User.Identity.Name;
                bool   departmentstatus = _accountService.CreateDepartment(model.FormSubmit.SelectedCompanyID, model.FormSubmit.DepartmentName, model.FormSubmit.DepartmentDirNme, model.FormSubmit.DepartmentFloorno, model.FormSubmit.DepartmentRoomno);

                if (departmentstatus == true)
                {
                    ViewBag.SuccessMsg = 1;
                }
                else
                {
                    ViewBag.FailMsg = 0;
                }
            }

            DepartmentModel       Dd             = new DepartmentModel();
            List <DepartmentList> departmentData = _accountService.GetAllDepartment();
            DepartmentListModel   model2         = new DepartmentListModel();

            model2.DepartmentList = departmentData;
            Dd.DisplayDepartment  = model2;
            return(View(Dd));
        }