protected void btnExtract_Click(object sender, EventArgs e) { DateTime fromdate; DateTime todate; DataSet dsBackOfficeAccountingExtract = new DataSet(); // DataTable dtBackOfficeAccountingExtract = new DataTable(); if (ddlExtractType.SelectedValue == "0") { return; } if (ddlExtractType.SelectedValue == "43" || ddlExtractType.SelectedValue == "44" || ddlExtractType.SelectedValue == "45") { orderDate = Convert.ToDateTime(txtExtractDate.SelectedDate); fromdate = Convert.ToDateTime(txtFromDate.SelectedDate); todate = Convert.ToDateTime(txtToDate.SelectedDate); string filename = GetFilename(Convert.ToInt32(ddlExtractType.SelectedValue)); string delimit = ","; dsBackOfficeAccountingExtract = OnlineOrderBackOfficeBo.GetExtractTypeDataForFileCreation(orderDate, advisorVo.advisorId, Convert.ToInt32(ddlExtractType.SelectedValue), Convert.ToDateTime(txtFromDate.SelectedDate), Convert.ToDateTime(txtToDate.SelectedDate), ddlOrderStatus.SelectedValue); if (dsBackOfficeAccountingExtract.Tables.Count <= 0) { ShowMessage("No Data Available"); return; } else if (dsBackOfficeAccountingExtract.Tables[0].Rows.Count <= 0) { ShowMessage("No Data Available"); return; } DownloadBidFile(dsBackOfficeAccountingExtract.Tables[0], filename, delimit); } else { CreateFileForextractAndSaveinServer(); GetExtractTypeDataForFileCreation(); } }