private DataSet GetData() { #region Configure Parameters int clientId = 0; try { clientId = Convert.ToInt32(cboClient.SelectedValue); } catch { } int invoiceTypeId = 0; try { eInvoiceType invoiceType = (eInvoiceType)Enum.Parse(typeof(eInvoiceType), cboInvoiceType.SelectedValue.Replace(" ", "")); invoiceTypeId = (int)invoiceType; } catch { } DateTime startDate = dteInvoiceStartDate.SelectedDate.Value; startDate = startDate.Subtract(startDate.TimeOfDay); DateTime endDate = dteInvoiceEndDate.SelectedDate.Value; endDate = endDate.Subtract(endDate.TimeOfDay); endDate = endDate.Add(new TimeSpan(23, 59, 59)); int dateType = int.Parse(rblDateType.SelectedValue); int?invoiceID = null; try { invoiceID = Convert.ToInt32(txtInvoiceId.Text); } catch { } bool showCancelled = chkShowCancelled.Checked; bool showPosted = chkShowPosted.Checked; #endregion Facade.IInvoice facInvoice = new Facade.Invoice(); return(facInvoice.GetInvoicesForAuditTrail(clientId, invoiceTypeId, dateType, startDate, endDate, showCancelled, showPosted, invoiceID)); }