Advertisement
| 06.21.2008 at 04:46AM PDT, ID: 23504455 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: |
Imports System.Data.SqlClient
Imports System.Data
Partial Public Class OnDemandLine
Inherits System.Web.UI.Page
Public cnstring As String
Private Sub OnDemandLine_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Select Case Request.Item("t")
Case "ond"
CType(Me.Master.FindControl("lblPageTitle"), Label).Text = "On Demand Product Lines"
ViewState("type") = 3
Case "bwrk"
CType(Me.Master.FindControl("lblPageTitle"), Label).Text = "Bespoke Workbooks"
ViewState("type") = 4
Case "std", "pblc"
Response.Redirect("standardproductline.aspx?t=" & Request.Item("t"))
Case Else
Response.Redirect("standardproductline.aspx?t=" & Request.Item("t"))
End Select
cnstring = ConfigurationManager.ConnectionStrings("Rogensi").ConnectionString
If Not Me.IsPostBack Then
binddata()
End If
End Sub
Sub binddata()
Dim cmd As Data.SqlClient.SqlCommand
Dim da As New Data.SqlClient.SqlDataAdapter
Dim ds As New DataSet
Dim cn As New Data.SqlClient.SqlConnection
cn.ConnectionString = cnstring
cmd = New Data.SqlClient.SqlCommand
cmd.CommandText = "showproductline"
cmd.CommandType = CommandType.StoredProcedure
cmd.Connection = cn
Dim pagep As New SqlParameter("@type", ViewState("type")) 'ViewState("id")) '
cmd.Parameters.Add(pagep)
da.SelectCommand = cmd
da.Fill(ds)
Me.GridView1.DataSource = ds.Tables(0)
Me.GridView1.DataBind()
da.Dispose()
cmd.Dispose()
cn.Close()
End Sub
--------------ASPX page---------------
<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/RogenSi/Site1.Master" CodeBehind="OnDemandLine.aspx.vb" Inherits="RogenSi.OnDemandLine"
title="On Product Line" %>
<%@ MasterType VirtualPath="~/RogenSi/Site1.Master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BorderStyle="None" GridLines="None" HorizontalAlign="Left" DataKeyNames="id">
<Columns>
<asp:ImageField DataAlternateTextField="title" DataImageUrlField="image" DataImageUrlFormatString="~/siteimages/{0}" HeaderText="Item">
<ItemStyle Height="50px" Width="50px" />
</asp:ImageField>
<asp:TemplateField HeaderText="Short Description" SortExpression="SDescription">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("Title") %>'></asp:Label><br />
<asp:Label ID="Label2" runat="server" Text='<%# Bind("SDescription") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="UnitPrice" HeaderText="Unit Price" SortExpression="UnitPrice" />
<asp:BoundField DataField="StockLevel" HeaderText="Stock Qty" SortExpression="StockLevel" />
<asp:TemplateField HeaderText="Order Qty">
<ItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Width="50px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:ButtonField ButtonType="Button" CommandName="select" Text="ADD" />
<asp:BoundField DataField="LeadTime" HeaderText="LeadTime" SortExpression="LeadTime" Visible="False" />
<asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" ReadOnly="True"
SortExpression="id" Visible="False" />
<asp:BoundField DataField="ProductType" HeaderText="ProductType" SortExpression="ProductType"
Visible="False" />
<asp:BoundField DataField="ReStockLevel" HeaderText="ReStockLevel" SortExpression="ReStockLevel" Visible="False" />
</Columns>
<EmptyDataTemplate>
Sorry there is no data for this category
</EmptyDataTemplate>
</asp:GridView><br />
<asp:Label ID="Label3" runat="server" Text="Label4"></asp:Label>
</asp:Content>
|
Advertisement