public ActionResult GenerateIRS941Form(PayrollReportViewModel vm)
        {
            PDFFormManager pdf = new PDFFormManager();
            ComputePayrollForPerson p = new ComputePayrollForPerson(this.unitOfWork, vm.PersonPrimaryInfoID.GetValueOrDefault(), vm.StartDate.GetValueOrDefault(), vm.EndDate.GetValueOrDefault());

            byte[] form = pdf.FillIRS941Form(p.GetReportPayrollCompanyTotal());
            Response.AppendHeader("Content-Disposition", "inline; filename=IRS941Form.pdf");
            return File(form, "application/pdf");
        }
        public ActionResult Index(PayrollReportViewModel vm)
        {
            if (vm.PersonPrimaryInfoID.HasValue && vm.PersonPrimaryInfoID != 0)
            {
                ComputePayrollForPerson p = new ComputePayrollForPerson(this.unitOfWork, vm.PersonPrimaryInfoID.GetValueOrDefault(), vm.StartDate.GetValueOrDefault(), vm.EndDate.GetValueOrDefault());
                vm.ReportPersonPayroll = p.GetReportPersonPayroll();
            }

            return View(SetupPayrollReportViewModel(vm));
        }
        private PayrollReportViewModel SetupPayrollReportViewModel(PayrollReportViewModel vm)
        {
            if (!vm.StartDate.HasValue)
            {
                vm.StartDate = DateTime.Now.AddMonths(-1);
            }

            if (!vm.EndDate.HasValue)
            {
                vm.EndDate = DateTime.Now;
            }

            ComputePayrollForPerson p = new ComputePayrollForPerson(this.unitOfWork, vm.PersonPrimaryInfoID.GetValueOrDefault(), vm.StartDate.GetValueOrDefault(), vm.EndDate.GetValueOrDefault());
            vm.ReportCompanyPayroll = p.GetReportPayrollCompanyTotal();

            IEnumerable<PayrollPersonTransaction> transForPerson = this.unitOfWork.PayrollPersonTransactionRepository.Get(x => x.Active).ToArray();

            vm.ListOfPeople = this.unitOfWork.PersonPrimaryInfoRepository.PeopleSelectList(vm.PersonPrimaryInfoID).Where(x => transForPerson.Any(pt => pt.PersonPrimaryInfoID == Convert.ToInt32(x.Value)));
            return vm;
        }