Beispiel #1
0
        // GET: Requisitions/Create
        public ActionResult Create()
        {
            try
            {
                ViewBag.EmployeeId = new SelectList(_employeeManager.GetAllEmployees(), "Id", "FullName");

                ICollection <Requisition> requisitions = _requisitionManager.GetAll();

                IEnumerable <RequisitionViewModel> requisitionViewModels =
                    Mapper.Map <IEnumerable <RequisitionViewModel> >(requisitions);

                //Get employee Id by user login id
                var loginUserId = Convert.ToInt32(User.Identity.GetUserId());
                var empId       = _employeeManager.FindByLoginId(loginUserId);

                //Notifications for assignd vehicle from controller
                //var notification = _notificationManager.GetNotificationsForSender("Unseen",empId.Id);
                //var notificationCount = notification.Count;
                //if (notification != null)
                //{
                //    ViewBag.Notification = notification;
                //    ViewBag.count = notificationCount;
                //}
                ViewBag.Requisition = _requisitionStatusManager.GetAllById(empId.Id);

                return(View());
            }
            catch (Exception ex)
            {
                ExceptionMessage(ex);
                return(View("Error", new HandleErrorInfo(ex, "Requisitions", "Create")));
            }
        }
Beispiel #2
0
 public ActionResult CreateRequestForOther()
 {
     try
     {
         ViewBag.EmployeeId = new SelectList(_employeeManager.GetAllEmployees(), "Id", "FullName");
         return(View());
     }
     catch (Exception ex)
     {
         return(View("Error", new HandleErrorInfo(ex, "Requisitions", "CreateRequestForOther")));
     }
 }
        //Get Only Employee
        public ActionResult GetAllEmployee()
        {
            ICollection <Employee>          employee           = _employeeManager.GetAllEmployees();
            IEnumerable <EmployeeViewModel> employeeViewModels = Mapper.Map <IEnumerable <EmployeeViewModel> >(employee);

            return(View(employeeViewModels));
        }
        public ActionResult Index()
        {
            var employees        = _employeeManager.GetAllEmployees();
            var companyEmployees = _companyEmployeeManager.GetAllCompanyEmployee();
            var companies        = _companyManager.GetAllCompany();

            // UNDONE: Проверить полученные данные из БД

            var employeesViewModels = new List <EmployeeViewModel>();

            foreach (var employee in employees)
            {
                var companyEmployee = companyEmployees.Find(c => c.EmployeeId == employee.Id);
                var company         = companies.Find(c => c.Id == companyEmployee.CompanyId);

                employeesViewModels.Add(new EmployeeViewModel
                {
                    Id          = employee.Id,
                    Name        = employee.Name,
                    Surname     = employee.Surname,
                    SecondName  = employee.SecondName,
                    HiringDate  = employee.HiringDate,
                    Position    = employee.Position,
                    CompanyName = company.Name
                });
            }

            return(View(employeesViewModels));
        }
Beispiel #5
0
 // GET: Requisitions/Create
 public ActionResult Create()
 {
     try
     {
         ViewBag.EmployeeId = new SelectList(_employeeManager.GetAllEmployees(), "Id", "FullName");
         ICollection <Requisition>          requisitions          = _requisitionManager.GetAll();
         IEnumerable <RequisitionViewModel> requisitionViewModels =
             Mapper.Map <IEnumerable <RequisitionViewModel> >(requisitions);
         ViewBag.Requisition = requisitionViewModels;
         return(View());
     }
     catch (Exception ex)
     {
         return(View("Error", new HandleErrorInfo(ex, "Requisitions", "Create")));
     }
 }
Beispiel #6
0
        public ICollection <Employee> GetAllEmployees()
        {
            var employeeList = _employeeManager.GetAllEmployees();

            if (employeeList.Count.Equals(0))
            {
                throw new Exception($"No employee has been found");
            }

            return(employeeList);
        }
        // GET: Setup All Queue

        public ActionResult SetupQueue()
        {
            try
            {
                ViewBag.OrganizationCount = _organizationManager.GetAll().Count;
                ViewBag.DepartmentCount   = _departmentManager.GetAll().Count;
                ViewBag.DesignationCount  = _designationManager.GetAll().Count;
                ViewBag.EmployeeTypeCount = _employeeTypeManager.GetAll().Count;
                ViewBag.EmployeeCount     = _employeeManager.GetAllEmployees().Count;
                ViewBag.DriverCount       = _employeeManager.GetAllDriver().Count;
                ViewBag.VehicleCount      = _vehicleManager.GetAll().Count;
                ViewBag.VehicleTypeCount  = _vehicleTypeManager.GetAll().Count;
                return(View());
            }
            catch (Exception ex)
            {
                ExceptionMessage(ex);
                return(View("Error", new HandleErrorInfo(ex, "Queue", "SetupQueue")));
            }
        }
 public ActionResult RequisitionQueue()
 {
     ViewBag.requisitionCount       = _requisitionManager.GetAll().Count;
     ViewBag.RequisitionStatusCount = _requisitionStatusManager.GetAllStatusNew().Count;
     ViewBag.CompleteRequisition    =
         _requisitionStatusManager.GetAll().Where(c => c.StatusType == "Completed").Count();
     ViewBag.OnProcessRequest = _requisitionStatusManager.GetAllStatusExecute().Count;
     ViewBag.EmployeeCount    = _employeeManager.GetAllEmployees().Count;
     ViewBag.DriverCount      = _employeeManager.GetAllDriver().Count;
     ViewBag.VehicleCount     = _vehicleManager.GetAll().Count;
     ViewBag.VehicleTypeCount = _vehicleTypeManager.GetAll().Count;
     return(View());
 }
 //Get Only Employee
 public ActionResult GetAllEmployee()
 {
     try
     {
         ICollection <Employee>          employee           = _employeeManager.GetAllEmployees();
         IEnumerable <EmployeeViewModel> employeeViewModels = Mapper.Map <IEnumerable <EmployeeViewModel> >(employee);
         return(View(employeeViewModels));
     }
     catch (Exception ex)
     {
         ExceptionMessage(ex);
         return(View("Error", new HandleErrorInfo(ex, "Employees", "GetAllEmployee")));
     }
 }
Beispiel #10
0
 public ActionResult Get()
 {
     return(StatusCode(200, _EmployeeManager.GetAllEmployees().ToList()));
 }
Beispiel #11
0
        public ActionResult ViewAll()
        {
            var employees = _iEmployeeManager.GetAllEmployees();

            return(View(employees));
        }
Beispiel #12
0
        // Get all Employees
        public IActionResult Index()
        {
            var employee = _employeeManager.GetAllEmployees();

            return(View(employee));
        }
Beispiel #13
0
        public List <Employee> GetAllEmployees()
        {
            List <Employee> employees = employeeManager.GetAllEmployees();

            return(employees);
        }
Beispiel #14
0
        public ActionResult <ApiResponse <Employee> > Get()
        {
            var response = employeeManager.GetAllEmployees();

            return(response.ToApiResponse());
        }
        public IActionResult List()
        {
            var result = _EmployeeManager.GetAllEmployees().ToList();

            return(View(result));
        }
Beispiel #16
0
 public IActionResult GetAllEmployee()
 {
     return(Ok(_dbManager.GetAllEmployees()));
 }
Beispiel #17
0
        public async Task <IActionResult> Get()
        {
            var response = await _employeeManager.GetAllEmployees();

            return(Ok(response));
        }