protected void OnOK(object sender, EventArgs e) { //Event handler for export button clicked // Session["LoadTenders"] = null; if (this.grdTenders.DataKeys.Count > 0) { //Get parameters for the query string _load = ""; string client = this.cboClient.SelectedValue; DateTime start = this.ddpTenders.FromDate; DateTime end = this.ddpTenders.ToDate; EnterpriseService enterprise = new EnterpriseService(); LoadTenderDS ds = new LoadTenderDS(); LoadTenderDS _ds = enterprise.GetLoadTenders(client, start, end); foreach (GridViewRow row in SelectedRows) { DataKey dataKey = (DataKey)this.grdTenders.DataKeys[row.RowIndex]; _load = dataKey["Load"].ToString(); ds.Merge(_ds.Tables[EnterpriseService.TBL_LOADTENDERS].Select("Load='" + _load + "'")); } Session["LoadTenders"] = ds; Response.Redirect("LoadTender.aspx"); } }
//Members //Interface protected void Page_Load(object sender, EventArgs e) { //Event handler for form load event Response.Write("<html>"); Response.Write("<head runat='server'>"); Response.Write("<title>Load Tenders</title>"); Response.Write("<style> HR { page-break-after: always; } </style>"); Response.Write("</head>"); Response.Write("<body>"); LoadTenderDS ds = (LoadTenderDS)Session["LoadTenders"]; for (int i = 0; i < ds.LoadTenderTable.Rows.Count; i++) { Response.Write("<table width=\"600px\" border=\"0\">"); Response.Write("<tr>"); Response.Write("<td>Loc #" + ds.LoadTenderTable[i].LocationNumber.ToString() + "</td>"); Response.Write("<td>" + ds.LoadTenderTable[i].Location.Trim() + "</td>"); Response.Write("</tr>"); Response.Write("<tr>"); Response.Write("<td>ID #" + ds.LoadTenderTable[i].LocationID.Trim() + "</td>"); Response.Write("<td>" + ds.LoadTenderTable[i].AddressLine1.Trim() + "</td>"); Response.Write("</tr>"); Response.Write("<tr>"); Response.Write("<td> </td>"); Response.Write("<td>" + ds.LoadTenderTable[i].AddressLine2.Trim() + "</td>"); Response.Write("</tr>"); Response.Write("<tr>"); Response.Write("<td>Ref #" + ds.LoadTenderTable[i].ReferenceNumber.Trim() + "</td>"); Response.Write("<td>" + ds.LoadTenderTable[i].City.Trim() + ", " + ds.LoadTenderTable[i].StateOrProvince.Trim() + " " + ds.LoadTenderTable[i].PostalCode.Trim() + "</td>"); Response.Write("</tr>"); Response.Write("</table>"); Response.Write("<br />"); Response.Write("<table width=\"600px\" border=\"0\">"); Response.Write("<tr><td align=\"center\"><img src=\"Image.aspx?barcode=" + ds.LoadTenderTable[i].Load.Trim() + "\" /></td></tr>"); Response.Write("<tr><td align=\"center\">" + ds.LoadTenderTable[i].Load.Trim() + "</td></tr>"); Response.Write("</table>"); Response.Write("<br />"); if (i < ds.LoadTenderTable.Rows.Count - 1) { Response.Write("<hr />"); } } Response.Write("</body>"); Response.Write("</html>"); }
public static LoadTenderDS GetLoadTenders(string clientNumber, DateTime startDate, DateTime endDate) { //Get load tenders for the selected client and date range LoadTenderDS lts = null; try { lts = new LoadTenderDS(); DataSet ds = new DataService().FillDataset(SQL_CONNID, USP_LOADTENDERS, TBL_LOADTENDERS, new object[] { clientNumber, startDate.ToString("yyyy-MM-dd"), endDate.ToString("yyyy-MM-dd") }); if (ds != null && ds.Tables[TBL_LOADTENDERS].Rows.Count > 0) { lts.Merge(ds); } } catch (Exception ex) { throw new ApplicationException(ex.Message); } return(lts); }
public LoadTenderDS GetLoadTenders(string clientNumber, DateTime startDate, DateTime endDate) { //Event handler for change in selected terminal LoadTenderDS lts = null; try { lts = new LoadTenderDS(); DataSet ds = fillDataset(USP_LOADTENDERS, TBL_LOADTENDERS, new object[] { clientNumber, startDate.ToString("yyyy-MM-dd"), endDate.ToString("yyyy-MM-dd") }); if (ds.Tables[TBL_LOADTENDERS].Rows.Count > 0) { lts.Merge(ds); } } catch (ApplicationException ex) { throw ex; } catch (Exception ex) { throw new ApplicationException("Unexpected exception while reading load tenders.", ex); } return(lts); }