private void btnReportInOut_Click(object sender, EventArgs e) { DateTime finish = cmbFinalSalesDare.Value; DateTime init = cmbInitialSalesDate.Value; String fin = finish.Year + "-" + finish.Month + "-" + (finish.Day + 1); String inicio = init.Year + "-" + init.Month + "-" + (init.Day - 1); List <ReportPOJO> reports = ReportDAO.getAllReportInOut(inicio, fin); dtgInputOutput.Rows.Clear(); for (int i = 0; i < reports.Count; i++) { dtgInputOutput.Rows.Add(reports[i].IdBatch, reports[i].DateBatch, reports[i].Reason, reports[i].QuantityBatch); } }
private void rdbYeadInputOutput_CheckedChanged(object sender, EventArgs e) { if (rdbYeadInputOutput.Checked) { cmbFinalDateInputOutput.Visible = false; cmbInitialDateInputOutput.Visible = false; label4.Visible = false; label3.Visible = false; btnReportInOut.Visible = false; DateTime finish = DateTime.Now; int today = int.Parse(DateTime.Today.DayOfYear.ToString()); DateTime init = DateTime.Today.AddDays(-(today)); String fin = finish.Year + "-" + finish.Month + "-" + (finish.Day + 1); String inicio = init.Year + "-" + init.Month + "-" + init.Day; List <ReportPOJO> reports = ReportDAO.getAllReportInOut(inicio, fin); dtgInputOutput.Rows.Clear(); for (int i = 0; i < reports.Count; i++) { dtgInputOutput.Rows.Add(reports[i].IdBatch, reports[i].DateBatch, reports[i].Reason, reports[i].QuantityBatch); } } }