private void btnReportProductSearch_Click(object sender, EventArgs e) { ReportProductArgument arg = new ReportProductArgument(); arg.fromDate = dtpProductReportFrom.Value; arg.toDate = dtpProductReportTo.Value; arg.categoryId = (int)cmbProductReportCategory.SelectedValue; if (!bwReportProduct.IsBusy) { bwReportProduct.RunWorkerAsync(arg); } }
private void dgvReportProduct_SelectionChanged(object sender, EventArgs e) { if (dgvReportProduct.SelectedRows.Count > 0) { var productid = Int32.Parse(dgvReportProduct.SelectedRows[0].Cells[0].Value.ToString()); ReportProductArgument arg = new ReportProductArgument(); arg.fromDate = dtpProductReportFrom.Value; arg.toDate = dtpProductReportTo.Value; arg.categoryId = productid; if (!bwReportProductDate.IsBusy) { bwReportProductDate.RunWorkerAsync(arg); } } }