private void btnExport_Click(object sender, EventArgs e)
        {
            int year = (int)this.cbLowYear.SelectedItem;
            //List<ContingencyPast> cpListByYear = this.yearListCPsPairs[year];
            HashSet <ContingencyPast> cpListByYear = new HashSet <ContingencyPast>();
            IWorkbook workbook = DefaultExporterWorksheet.ExportCtgency13SalaryEmployeeList(cpListByYear, year);

            _SaveExcelFile(workbook);
        }
        private void btnExport_Click(object sender, EventArgs e)
        {
            int year  = (int)this.cbYears.SelectedItem;
            int month = (int)this.cbMonths.SelectedIndex;
            KeyValuePair <int, int> kvp = new KeyValuePair <int, int>(year, month + 1);
            List <ContingencyPast>  cpListByMonthYear = this.YearMonthCPsList[kvp];
            IWorkbook workbook = DefaultExporterWorksheet.ExportCtgencyEmployeeList(cpListByMonthYear, contFunds, contAliquots);

            _SaveExcelFile(workbook);
        }
Пример #3
0
        private void btnExport_Click(object sender, EventArgs e)
        {
            List <EmployeeHistory> employeeHistoriesChecked = new List <EmployeeHistory>();

            foreach (DataGridViewRow row in this.dgvEmployees.Rows)
            {
                //se tiver marcado com CHECKED o funcionário
                if (Convert.ToBoolean(row.Cells[0].Value) == true)
                {
                    foreach (EmployeeHistory eh in employeeHistoriesVacation)
                    {
                        if (eh.Employee.Matriculation == row.Cells["matriculaColumn"].Value.ToString())
                        {
                            List <DateTime> dateTimes = (List <DateTime>)row.Cells["perAqColumn"].Tag;
                            DateTime        dt1, dt2;
                            if (dateTimes.Count > 0 && dateTimes.Count < 2)
                            {
                                dt1 = dt2 = dateTimes[0];
                            }
                            else
                            {
                                dt1 = dateTimes[0];
                                dt2 = dateTimes[1];
                            }
                            if ((DateTime.Compare(eh.StartVacationTaken, dt1) == 0 || DateTime.Compare(eh.StartVacationTaken, dt2) == 0) &&
                                (DateTime.Compare(eh.EndVacationTaken, dt1) == 0 || DateTime.Compare(eh.EndVacationTaken, dt2) == 0))
                            {
                                employeeHistoriesChecked.Add(eh);
                            }
                        }
                    }
                }
            }

            HashSet <ContingencyPast> empHistoryContPast =
                _facade.GetContingencyPastsByEmployeeHistoryList(employeeHistoriesChecked, new ContingencyFund("Férias"));
            //int year = (int)this.cbLowYear.SelectedItem;
            //List<ContingencyPast> cpListByYear = this.yearListCPsPairs[year];
            ContingencyAliquot caInc = new ContingencyAliquot();

            foreach (ContingencyAliquot ca in taxFunds)
            {
                if (ca.ContingencyFund.Name.ToUpper().Equals("INCIDÊNCIA"))
                {
                    caInc = ca;
                }
            }
            IWorkbook workbook = DefaultExporterWorksheet.ExportCtgencyVacationEmployeeList(employeeHistoriesChecked, empHistoryContPast, caInc);

            _SaveExcelFile(workbook);
        }