public ActionResult newUser()
        {
            UserModel         userModel = new UserModel();
            List <Department> DepList   = new List <Department>();

            userModel.Departments = _departmentService.GetAllDepartments();
            ViewBag.depList       = userModel.Departments;

            if (Company.CurrentUser != null && (Company.CurrentUser.UserType).Equals(UserType.Administrator)) //Administrator can create new Admin, Manager & Employee
            {
                return(View("newUserByUserType"));
            }
            else
            {
                return(View());  //creating new Employee
            }
        }
예제 #2
0
        public HomeEntity Get()
        {
            HomeEntity entity = new HomeEntity();

            entity.News        = newsServices.GetLatestNews();
            entity.Events      = eventServices.GetAllEvents();
            entity.Departments = deptServices.GetAllDepartments();
            return(entity);
        }
예제 #3
0
 public HttpResponseMessage Get(int CompanyId)
 {
     try
     {
         var Department = _departmentServices.GetAllDepartments(CompanyId);
         return(Request.CreateResponse(HttpStatusCode.OK, Department));
     }
     catch (Exception ex)
     {
         throw new ApiDataException(1000, "Department Not Found", HttpStatusCode.NotFound);
     }
 }
예제 #4
0
        // GET: api/Department
        public HttpResponseMessage Get()
        {
            //  return new string[] { "value1", "value2" };
            var departments       = _departmentService.GetAllDepartments();
            var departmenEntities = departments as List <hmisDepartmentMaster> ?? departments.ToList();

            if (departmenEntities.Any())
            {
                return(Request.CreateResponse(HttpStatusCode.OK, departmenEntities));
            }
            throw new ApiDataException(1000, "Department not found", HttpStatusCode.NotFound);
        }
예제 #5
0
        public ActionResult getDepartments()
        {
            if ((Company.CurrentUser.UserType).Equals(UserType.Administrator))
            {
                DepartmentModel depModel = new DepartmentModel();
                List <Company>  ComList  = new List <Company>();
                depModel.Companies = _companyService.GetAllCompanies();
                ViewBag.comList    = depModel.Companies;

                var dep = _departmentService.GetAllDepartments();
                return(View(dep));
            }
            else
            {
                return(RedirectToAction("NotAdministrator"));
            }
        }
 public IEnumerable <DepartmentEntity> GetAllDepartments()
 {
     return(deptServices.GetAllDepartments());
 }