<h2>Rebate Measures</h2> <asp:TextBox ID="ProjectID" runat="server"></asp:TextBox> <table border="1"> <tr style="background-color: beige"> <th>Delete</th> <th>Packet #</th> <th>EEC Ref #</th> <th class="auto-style1">PTR Ref #</th> <th>Residential Measure</th> <th>PTCS</th> <th>PTCS Ducts</th> <th>PTCS Comm</th> <th>Bus Bar KWh</th> <th>Saved KWh</th> <th>Msr Life</th> <th>BPA Credit Rate</th> <th>BPAtoFPUD Reimburse</th> <th># of Units</th> <th>Unit Type</th> <th>Funding Source</th> <th>Bid Cost</th> <th>Customer Rebate</th> </tr> <tr style="background-color:#E0E0E0"> <td> <asp:ImageButton Style="float:none; width: 20px; padding: 0; display: inline" ToolTip="Delete" OnClick="Delete_Click" ID="Delete" ImageUrl="Images/DeletePage.gif" runat="server"></asp:ImageButton> </td> <td> <asp:DropDownList ID="PacketNum" CssClass="ddl" Width="60px" OnTextChanged="PacketNum_TextChanged" AutoPostBack="true" runat="server"></asp:DropDownList> </td> <td> <asp:DropDownList CssClass="ddl" ID="EECNum" Width="115px" OnTextChanged="EECNum_TextChanged" AutoPostBack="true" runat="server"></asp:DropDownList> </td> <td class="auto-style1"> <asp:TextBox ID="PTRNum1" Width="100px" runat="server"></asp:TextBox> </td> <td> <asp:TextBox ID="Measure" Width="350px" runat="server" Wrap="true" ></asp:TextBox> </td> <td> <asp:TextBox ID="PTCS" MaxLength="3" Columns="1" runat="server" Width="34px"></asp:TextBox> </td> <td> <asp:TextBox ID="Ducts" runat="server" Width="61px"></asp:TextBox> </td> <td> <asp:TextBox ID="Comm" runat="server" Width="59px"></asp:TextBox> </td> <td> <asp:TextBox ID="Busbar" runat="server" Width="45px"></asp:TextBox> </td> <td> <asp:TextBox ID="SavedKWh" runat="server" Width="45px"></asp:TextBox> </td> <td> <asp:TextBox ID="MsrLife" runat="server" Width="30px"></asp:TextBox> </td> <td> <asp:TextBox ID="BPACredit" ReadOnly="true" runat="server" Width="78px"></asp:TextBox> </td> <td> <asp:TextBox ID="BPAReimburse" BackColor="LightPink" runat="server" Width="128px"></asp:TextBox> </td> <td> <asp:TextBox ID="Units" TextMode="Number" OnTextChanged="PacketNum_TextChanged" AutoPostBack="true" runat="server" Width="40px"></asp:TextBox> </td> <td> <asp:DropDownList ID="UnitType" CssClass="ddl" runat="server"> <asp:ListItem Text="EA" Value="EA"></asp:ListItem> <asp:ListItem Text="SqFt" Value="SqFt"></asp:ListItem> <asp:ListItem Text="LnFt" Value="LnFt"></asp:ListItem> </asp:DropDownList> </td> <td> <asp:DropDownList ID="Funding" CssClass="ddl" OnTextChanged="PacketNum_TextChanged" AutoPostBack="true" runat="server"> <asp:ListItem Text="EEI" Value="EEI" Selected="True"></asp:ListItem> <asp:ListItem Text="Self" Value="Self"></asp:ListItem> <asp:ListItem Text="Delta" Value="Delta"></asp:ListItem> </asp:DropDownList> </td> <td> <asp:TextBox ID="BidCost" runat="server" Width="63px"></asp:TextBox> </td> <td> <asp:TextBox ID="CustomerRebate" runat="server" Width="93px"></asp:TextBox> </td> </tr> </table>
string CS = ConfigurationManager.ConnectionStrings["CARD"].ConnectionString; using (SqlConnection con = new SqlConnection(CS)) {String sql = "Select * from tbl_Measures_New1 Where Project_ID = @ProjectID and Project_ID like 'R%'"; SqlDataAdapter Msrda = new SqlDataAdapter(sql, con); Msrda.SelectCommand.Parameters.AddWithValue("@ProjectID", ProjectID.Text); DataSet Msrds = new DataSet(); Msrda.Fill(Msrds, "Msr"); ViewState["SQL"] = sql; ViewState["Msr"] = Msrds; if (Msrds.Tables["Msr"].Rows.Count > 0) { DataRow Msrdr = Msrds.Tables["Msr"].Rows[0]; AccountSelect.Text = Msrdr["Account_Num"].ToString(); OccCode.Text = Msrdr["Occ_Code"].ToString(); Measure.Text = Msrdr["Measure"].ToString(); Funding.SelectedValue = Msrdr["Funding_Source"].ToString(); PacketNum.Text = Msrdr["FPUD_Packet_No"].ToString(); EECNum.Text = Msrdr["EEC_Ref_Num"].ToString(); PTRNum1.Text = Msrdr["BPA_Ref_Num"].ToString(); VendorList.SelectedValue = Msrdr["Vendor_ID"].ToString(); SecVendorList.SelectedValue = Msrdr["Secondary_Vendor_ID"].ToString(); BidCost.Text = "$" + Msrdr["Measure_Cost"].ToString().Replace(".0000", ".00"); CustomerRebate.Text = "$" + Msrdr["Customer_Rebate"].ToString().Replace(".0000", ".00"); SavedKWh.Text = Msrdr["Saved_Kwh"].ToString(); Busbar.Text = Msrdr["BusBar_Kwh"].ToString(); BPACredit.Text = "$" + Msrdr["BPA_Credit"].ToString().Replace(".0000", ".00"); BPAReimburse.Text = "$" + Msrdr["BPA-FPUD_Reimburse"].ToString().Replace(".0000", ".00"); Units.Text = Msrdr["Measure_Units"].ToString(); if (Units.Text != "") { Units.Text = Msrdr["Measure_Units"].ToString(); } else { Units.Text = "1"; } UnitType.SelectedValue = Msrdr["Unit_Type"].ToString(); MsrLife.Text = Msrdr["Measure_Life"].ToString(); PTCS.Text = Msrdr["PTCS"].ToString(); Ducts.Text = Msrdr["PTCS_Ducts"].ToString(); Comm.Text = Msrdr["PTCS_Comm"].ToString(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)