public ActionResult EditEmployee(int mod)
        {
            int EmployeeID = mod;

            DepartmentProcess department = new DepartmentProcess();
            PositionProcess   position   = new PositionProcess();

            ViewBag.Departments = department.GetDepartments();
            ViewBag.Positions   = position.GetPositions();

            EmployeeManagementProcess employeeManagement = new EmployeeManagementProcess();
            var EmployeeDetails = employeeManagement.GetAllEmployee().Where(k => k.EmployeeID == EmployeeID).Select(k => new EmployeeViewModel
            {
                FirstName         = k.FirstName,
                MiddleName        = k.MiddleName,
                LastName          = k.LastName,
                EmployeeID        = k.EmployeeID,
                Gender            = k.Gender,
                Position          = k.Position,
                PositionID        = k.PositionID,
                PhoneNumber       = k.PhoneNumber,
                EmailAddress      = k.EmailAddress,
                Department        = k.Department,
                DepartmentID      = k.DepartmentID,
                IsCompany         = k.IsCompany,
                CompanyName       = k.CompanyName,
                Status            = k.Status,
                Status_booleanVal = k.Status == 1 ? true:false
            }).FirstOrDefault();

            return(View(EmployeeDetails));
        }
Пример #2
0
        public HttpResponseMessage GetDepartments(HttpRequestMessage request)
        {
            HttpResponseMessage response = new HttpResponseMessage();

            response = _process.GetDepartments();
            return(response);
        }
        public ActionResult NewEmployee()
        {
            DepartmentProcess department = new DepartmentProcess();
            PositionProcess   position   = new PositionProcess();

            ViewBag.Departments = department.GetDepartments();
            ViewBag.Positions   = position.GetPositions();
            return(View(new EmployeeViewModel()));
        }
Пример #4
0
        public ActionResult EmployeeReport()
        {
            ReportsProcess reportsProcess = new ReportsProcess();
            int            employeeStatus = (int)EmployeeStatus.Active;
            var            employeeList   = reportsProcess.GetEmployeeList(employeeStatus).ToList();

            DepartmentProcess department = new DepartmentProcess();
            PositionProcess   position   = new PositionProcess();

            ViewBag.Departments = department.GetDepartments().ToList();
            ViewBag.Positions   = position.GetPositions().ToList();

            return(View(employeeList));
        }
Пример #5
0
        public void EmployeeReport(vwEmployeeList emp)
        {
            DepartmentProcess department = new DepartmentProcess();
            PositionProcess   position   = new PositionProcess();

            ViewBag.Departments = department.GetDepartments().ToList();
            ViewBag.Positions   = position.GetPositions().ToList();

            ReportsProcess reportsProcess = new ReportsProcess();
            int            employeeStatus = (int)EmployeeStatus.Active;

            List <vwEmployeeList> sourcefile = new List <vwEmployeeList>();

            if (emp.DepartmentID != 0 && emp.PositionID != 0)
            {
                sourcefile = (reportsProcess.GetEmployeeListByDepartmentIDPositionID(employeeStatus, emp.DepartmentID, emp.PositionID));
            }
            else if (emp.DepartmentID > 0 && emp.PositionID == 0)
            {
                sourcefile = (reportsProcess.GetEmployeeListByDepartmentID(employeeStatus, emp.DepartmentID));
            }
            else if (emp.PositionID > 0 && emp.DepartmentID == 0)
            {
                sourcefile = (reportsProcess.GetEmployeeListByPositionID(employeeStatus, emp.PositionID));
            }
            else
            {
                sourcefile = (reportsProcess.GetEmployeeList(employeeStatus));
            }

            WebGrid grid     = new WebGrid(source: sourcefile, canPage: false, canSort: false);
            string  gridHtml = grid.GetHtml(
                tableStyle: "table table-striped table-hover",
                //mode: WebGridPagerModes.All,
                //firstText: "First",
                //previousText: "Prev",
                //nextText: "Next",
                //lastText: "Last",
                //htmlAttributes: new
                //{
                //    id = "grid"
                //},
                columns: grid.Columns(
                    grid.Column("EmployeeID", "Employee ID"),
                    grid.Column("FullName", "Full Name"),
                    grid.Column("FirstName", "First Name"),
                    grid.Column("MiddleName", "Middle Name"),
                    grid.Column("LastName", "Last Name"),
                    grid.Column("ManagerID", "Manager ID"),
                    grid.Column("Gender", "Gender"),
                    grid.Column("EmailAddress", "Email"),
                    grid.Column("PhoneNumber", "Phone #"),
                    grid.Column("DepartmentName", "Department"),
                    grid.Column("GroupName", "Group"),
                    grid.Column("Description", "Position"),
                    grid.Column("Status", "Status")
                    )
                ).ToString();

            Response.ClearContent();
            Response.AddHeader("content-disposition", "attachment; filename=ListOfEmployees.xls");
            Response.ContentType = "application/excel";
            Response.Write(gridHtml);
            Response.End();
        }