示例#1
0
        protected void LoadReports(int rid, int userid, string username)
        {
            switch (rid)
            {
            case 1:
                lblDetailDate.Text = DateTime.Now.ToShortDateString();
                pnl_EmployeeDetailReport.Visible = true;
                EmployeeDetailReport.LoadPTODetailsToDate(userid, username);
                break;

            case 2:
                pnl_EmployeeBalanceReport.Visible = true;
                EmployeeBalanceReport.LoadEmployeeBalanceReport(userid);
                break;

            case 3:
                lblBalanceDate.Text      = DateTime.Now.ToShortDateString();
                pnl_ScheduledPTO.Visible = true;
                ScheduledPTO.LoadScheduledPTO(userid, username);
                break;

            default:
                break;
            }
        }
示例#2
0
 protected void rptEmployeeDetailReport_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item ||
         e.Item.ItemType == ListItemType.AlternatingItem)
     {
         DataRowView          employee = (DataRowView)e.Item.DataItem;
         EmployeeDetailReport control  = (EmployeeDetailReport)e.Item.FindControl("EmployeeDetailReport");
         control.LoadPTODetailsToDate(Convert.ToInt32(employee["userid"]), Convert.ToString(employee["name"]));
     }
 }
示例#3
0
        public ActionResult Index(int? id)
        {
            ApplicationUser user = userManager.FindById(User.Identity.GetUserId());
            var companies = companyService.GetCompaniesByUser(user);
            var positions = positionService.GetPositions();
            ViewBag.Companies = companies;
            ViewBag.Positions = positions;
            ViewBag.FirstComapanyId = (companies.Count() != 0) ?  companies.FirstOrDefault().Id : 0;
            ViewBag.FirstPositionId = (positions.Count() != 0 ) ?  positions.FirstOrDefault().Id : 0;

            if (id.HasValue && id != 0)
            {
                var employee = employeeService.GetEmployee(id.Value);
                if (employee != null)
                {
                    EmployeeInfoModel employeeInfor = new EmployeeInfoModel()
                    {
                        Id = employee.Id,
                        LastName = employee.LastName,
                        FirstName = employee.FirstName,
                        EmployeeCode = employee.EmployeeCode,
                        IdentityNo = employee.Identity.IdentityNo,
                        IdentityDateOfIssue = employee.Identity.DateOfIssue,
                        Gender = employee.Gender,
                        MaritalStatus = employee.MaritalStatus,
                        Nationality = employee.Nationality,
                        Salary = employee.Salary,
                        Photo = employee.Photo,
                        BirthDay = (DateTime)employee.BirthDay,
                        RealSalary = employeeService.GetEmployeeRealSalaryAtDate(employee,DateTime.Now)
                    };

                    ViewData["employeeInfor"] = employeeInfor;
                    //
                    EmployeeDetailReport empDetailReport = new EmployeeDetailReport(employee);
                    ViewData["report"] = empDetailReport;
                    Session["Empreport"] = empDetailReport;
                    EmployeeFunctionTabViewModel employeeFunctionTabViewModel = CreateEmployeeFunctionViewModelFromEmployee(employee);
                    employeeFunctionTabViewModel.report1 = empDetailReport;
                    return View("EmployeeDetail",employeeFunctionTabViewModel);
                }
            }
            return View();
        }