protected void Page_Load(object sender, EventArgs e) { string formType = Request["formType"]; string businessArea = Request["businessArea"]; string endingDateValue = Request["endDate"]; string startingDateValue = Request["startDate"]; string contactType = Request["contactType"]; string format = Request["format"]; string columnList = Request["columnList"]; string columnOrderList = Request["columnOrderList"]; string columnMap = Request["columnMap"]; if (string.IsNullOrEmpty(formType) && string.IsNullOrEmpty(businessArea)) { wf_Status.Text = "No form type provided."; wf_Status.Visible = true; } else { var service = new ContactFormService(); if (string.IsNullOrEmpty(columnMap)) { service.WriteContactListFileToResponse(formType, businessArea, endingDateValue, startingDateValue, contactType, format, columnList, columnOrderList, Response); } else { service.WriteContactListFileToResponseColumnMap(formType, businessArea, endingDateValue, startingDateValue, contactType, format, columnMap, Response); } Response.End(); } }
private void ExportResults(string format) { var service = new ContactFormService(); // Write the file. . . var success = service.WriteContactListFileToResponse(GetValidFormType(wf_FormTypes.SelectedValue), GetValidBusinessArea(wf_BusinessTypes.SelectedValue), wf_EndingOn.Text, wf_StartingFrom.Text, null, format, Response); if (!success) { wf_Status.Visible = true; wf_Status.Text = "The was an error processing your export."; } else { wf_Status.Visible = false; } Response.End(); }