Here are the files
GeneralInformat ion.ascx
<%@ Register TagPrefix="igsc h"
Namespace="Infr agistics.WebUI. WebSchedule"
Assembly="Infra gistics.WebUI.W ebDateChooser.v 1" %>
<%@ Control Language="vb" AutoEventWireup ="false"
Codebehind="Gen eralInformation .ascx.vb"
Inherits="Sulfa Treat.MySulfaTr eat.OnlineOrder s.GeneralInform ation"
TargetSchema="h ttp://schemas.microso ft.com/intellisense/ie5" %>
<%@ Register TagPrefix="date " Namespace="Pete rBlum.DateTextB oxControls"
Assembly="DateT extBoxControls" %>
<asp:validation summary id="svalGeneral Info" Height="16px" Width="152px"
runat="server"> </asp:validations ummary>
<table width="90%"> <!-- style="Z-INDEX: 102; LEFT: 8px; POSITION:
absolute; TOP: 56px">-->
<TR>
<TD noWrap>
<TABLE style="WIDTH: 344px; HEIGHT: 138px">
<TR>
<TD>Order Type:</TD>
<TD><asp:dropdo wnlist id="dropOrderTy pe"
Runat="server"> </asp:dropdownlis t></TD>
</TR>
<TR>
<TD noWrap>Date Received:</TD>
<TD><igsch:webd atechooser id="RecievedDat e" Width="153"
runat="server">
<CalendarLayo ut PrevMonthImageU rl="ig_cal_gray P0.gif"
ShowTitle="Fals e" NextMonthImageU rl="ig_cal_gray N0.gif">
<DayStyle BorderWidth="1p x" BorderColor="#9 09090"
BorderStyle="So lid" BackgroundImage ="ig_cal_light3 .gif"></DayStyle>
<FooterStyle Height="16pt" Font-Size="8pt" ForeColor="#707 070"
BackgroundImage ="ig_cal_light2 .gif"></FooterStyle>
<SelectedDaySty le ForeColor="Blac k"
BackgroundImage ="ig_cal_light2 .gif"></SelectedDayStyl e>
<OtherMonthDayS tyle ForeColor="#909 090"></OtherMonthDaySt yle>
<NextPrevStyl e
BackgroundImage ="ig_cal_light1 .gif"></NextPrevStyle>
<CalendarStyl e BorderWidth="1p x" Font-Size="9pt"
Font-Names="Verdana" BorderColor="Gr ay" BorderStyle="So lid"
ForeColor="#505 050" BackColor="#C0C 0C0"></CalendarStyle>
<TodayDayStyl e ForeColor="Blac k"
BackgroundImage ="ig_cal_light1 .gif"></TodayDayStyle>
<DayHeaderSty le Height="1pt" Font-Size="8pt" Font-Bold="True"
ForeColor="#606 060" BackgroundImage ="ig_cal_light2 .gif"
BackColor="#C0C 0C0"></DayHeaderStyle>
<TitleStyle Height="18pt" Font-Size="10pt" Font-Bold="True"
ForeColor="#606 060" BackgroundImage ="ig_cal_light1 .gif"
BackColor="#E0E 0E0"></TitleStyle>
</CalendarLayout>
<ExpandEffect s ShadowColor="Li ghtGray"></ExpandEffects>
</igsch:webdatech ooser></TD>
</TR>
<TR>
<TD>Currency: </TD>
<TD><asp:dropdo wnlist id="dropCurrenc yList" Width="88px"
runat="server"> </asp:dropdownlis t></TD>
</TR>
<TR>
<TD>Purchase Order #:</TD>
<TD><asp:textbo x id="txtPurchase OrderNum" Width="153px"
runat="server"> </asp:textbox></TD>
</TR>
<TR>
<TD noWrap>Req. Delivery Date:</TD>
<TD><igsch:webd atechooser id="ReqDelvDate " Width="153"
runat="server" NullDateLabel=" ">
<CalendarLayo ut PrevMonthImageU rl="ig_cal_gray P0.gif"
ShowTitle="Fals e" NextMonthImageU rl="ig_cal_gray N0.gif">
<DayStyle BorderWidth="1p x" BorderColor="#9 09090"
BorderStyle="So lid" BackgroundImage ="ig_cal_light3 .gif"></DayStyle>
<FooterStyle Height="16pt" Font-Size="8pt" ForeColor="#707 070"
BackgroundImage ="ig_cal_light2 .gif"></FooterStyle>
<SelectedDaySty le ForeColor="Blac k"
BackgroundImage ="ig_cal_light2 .gif"></SelectedDayStyl e>
<OtherMonthDayS tyle ForeColor="#909 090"></OtherMonthDaySt yle>
<NextPrevStyl e
BackgroundImage ="ig_cal_light1 .gif"></NextPrevStyle>
<CalendarStyl e BorderWidth="1p x" Font-Size="9pt"
Font-Names="Verdana" BorderColor="Gr ay" BorderStyle="So lid"
ForeColor="#505 050" BackColor="#C0C 0C0"></CalendarStyle>
<TodayDayStyl e ForeColor="Blac k"
BackgroundImage ="ig_cal_light1 .gif"></TodayDayStyle>
<DayHeaderSty le Height="1pt" Font-Size="8pt" Font-Bold="True"
ForeColor="#606 060" BackgroundImage ="ig_cal_light2 .gif"
BackColor="#C0C 0C0"></DayHeaderStyle>
<TitleStyle Height="18pt" Font-Size="10pt" Font-Bold="True"
ForeColor="#606 060" BackgroundImage ="ig_cal_light1 .gif"
BackColor="#E0E 0E0"></TitleStyle>
</CalendarLayout>
<ExpandEffect s ShadowColor="Li ghtGray"></ExpandEffects>
</igsch:webdatech ooser></TD>
</TR>
</TABLE>
</TD>
<TD>
<TABLE>
<TR>
<TD>Special Instructions:</TD>
</TR>
<TR>
<TD><asp:textbo x id="txtSpecialI nstructions" Height="114px"
Width="280px" Runat="server" TextMode="Multi Line"></asp:textbox></TD>
</TR>
</TABLE>
</TD>
</TR>
</table>
<date:datetextb oxvalidator id="dvalDateRec eived" runat="server"
ErrorMessage="P lease enter or select a valid date."
Display="None"
ControlToValida te="RecievedDat e"></date:datetextbo xvalidator><dat e:datet
extboxvalidator id="dvalReqDeli vDate" runat="server"
ErrorMessage="P lease enter or select a valid date."
Display="None"
ControlToValida te="ReqDelvDate "></date:datetextbo xvalidator><asp :button
id="Submit" runat="server" Text="Button" Visible="False" ></asp:button>
GeneralInformat ion.ascx.vb
Imports System.Diagnost ics
Imports SulfaTreat.Comm on.Data
Imports SulfaTreat.Busi nessRules
Public Class GeneralInformat ion
Inherits System.Web.UI.U serControl
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()
End Sub
Public WithEvents txtSpecialInstr uctions As
System.Web.UI.W ebControls.Text Box
Public WithEvents dropCurrencyLis t As
System.Web.UI.W ebControls.Drop DownList
Public WithEvents txtPurchaseOrde rNum As
System.Web.UI.W ebControls.Text Box
Protected WithEvents dvalReqDelivDat e As
PeterBlum.DateT extBoxControls. DateTextBoxVali dator
Protected WithEvents svalGeneralInfo As
System.Web.UI.W ebControls.Vali dationSummary
Public WithEvents dropOrderType As
System.Web.UI.W ebControls.Drop DownList
Protected WithEvents dvalDateReceive d As
PeterBlum.DateT extBoxControls. DateTextBoxVali dator
Public WithEvents ReqDelvDate As
Infragistics.We bUI.WebSchedule .WebDateChooser
Public WithEvents RecievedDate As
Infragistics.We bUI.WebSchedule .WebDateChooser
Public WithEvents Submit As System.Web.UI.W ebControls.Butt on
'NOTE: The following placeholder declaration is required by the Web
Form Designer.
'Do not delete or move it.
Private designerPlaceho lderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeCompo nent()
End Sub
#End Region
#Region "Enum"
Public Enum CurrencyType As Integer
US
Canadian
End Enum
#End Region
Private _ds As DataSet
Private _OrderData As OrderData
Private _OrderID As String
#Region "Properties "
Public ReadOnly Property OrderID() As String
Get
If Not IsNothing(Sessi on("OrderID")) Then
Return CStr(Session("O rderID"))
Else
Return Nothing
End If
End Get
End Property
Public Property OrderTypeID() As Integer
Get
If dropOrderType.S electedIndex <> -1 Then
Return CInt(dropOrderT ype.SelectedIte m.Value)
Else
dropOrderType.S electedIndex = 0
Return CInt(dropOrderT ype.SelectedIte m.Value)
End If
End Get
Set(ByVal Value As Integer)
dropOrderType.S electedIndex = Value
End Set
End Property
Public Property DateRecieved() As Date
Get
If dvalDateReceive d.IsValid = False Then
SulfaTreat.Syst emSupport.Appli cationLog.Write Error("Please select a
valid date.")
Else
Return CDate(Me.Reciev edDate.Text)
End If
End Get
Set(ByVal Value As Date)
Me.RecievedDate .Value = Value
End Set
End Property
Public Property CurrencyID() As Integer
Get
Return CInt(dropCurren cyList.Selected Item.Value)
End Get
Set(ByVal Value As Integer)
dropCurrencyLis t.SelectedIndex = Value
End Set
End Property
Public Property PurchaseOrderNu m() As String
Get
Return txtPurchaseOrde rNum.Text
End Get
Set(ByVal Value As String)
txtPurchaseOrde rNum.Text = Value
End Set
End Property
Public Property ReqDevliveryDat e() As Date
Get
If Me.dvalReqDeliv Date.IsValid = False Then
SulfaTreat.Syst emSupport.Appli cationLog.Write Error("Please select a
valid date.")
Else
Return CDate(Me.ReqDel vDate.Text)
End If
End Get
Set(ByVal Value As Date)
Me.ReqDelvDate. Value = Value
End Set
End Property
Public Property SpecialInstruct ions() As String
Get
Return txtSpecialInstr uctions.Text
End Get
Set(ByVal Value As String)
txtSpecialInstr uctions.Text = Value
End Set
End Property
Private Property CurrencyList() As DataSet
Get
If Not IsNothing(HttpC ontext.Current. Cache("Currency List"))
Then
Return CType(HttpConte xt.Current.Cach e("CurrencyList "),
DataSet)
Else
Me.LoadCurrency List()
Return _ds
End If
End Get
Set(ByVal Value As DataSet)
HttpContext.Cur rent.Cache("Cur rencyList") = Value
End Set
End Property
Private Property OrderTypeList() As DataSet
Get
If Not IsNothing(HttpC ontext.Current. Cache("OrderTyp eList"))
Then
Return CType(HttpConte xt.Current.Cach e("OrderTypeLis t"),
DataSet)
Else
LoadOrderTypeLi st()
Return _ds
End If
End Get
Set(ByVal Value As DataSet)
HttpContext.Cur rent.Cache("Ord erTypeList") = Value
End Set
End Property
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
If Not IsPostBack Then
Me.RecievedDate .Value = Date.Today
LoadDropLists()
End If
End Sub
Private Sub LoadDropLists()
With Me.dropCurrency List
.DataSource = Me.CurrencyList
.DataTextField = "Currency"
.DataValueField = "CurrencyID "
.DataBind()
End With
With Me.dropOrderTyp e
.DataSource =
Me.OrderTypeLis t.Tables(OrderD ata.OrderTypes_ TABLE)
.DataTextField = OrderData.Order TypeDescription _FIELD
.DataValueField = OrderData.Order TypeID_FIELD
.DataBind()
End With
End Sub
Private Sub LoadCurrencyLis t()
Dim ord As New Orders
_ds = ord.GetCurrency List()
HttpContext.Cur rent.Cache("Cur rencyList") = _ds
End Sub
Private Sub LoadOrderTypeLi st()
Dim ord As New Orders
_ds = ord.GetOrderTyp es()
HttpContext.Cur rent.Cache("Ord erTypeList") = _ds
End Sub
Public Sub Clear()
Me.RecievedDate .Value = Date.Today
Me.dropCurrency List.SelectedIn dex = 0
Me.dropOrderTyp e.SelectedIndex = 0
Me.ReqDelvDate. Value = ""
Me.txtPurchaseO rderNum.Text = ""
Me.txtSpecialIn structions.Text = ""
End Sub
Public Sub SaveOrder()
Dim order As New Orders
Dim _OrderData As New OrderData
If
CStr(_OrderData .Tables(OrderDa ta.OrderHistory _TABLE).Rows(0) (OrderData.O
rderID_FIELD)) = "new" Then
_OrderID = order.CreateOrd erID
Dim dr As DataRow =
_OrderData.Tabl es(OrderData.Or derHistory_TABL E).NewRow
dr(OrderData.Or derDate_FIELD) = CDate(Me.Reciev edDate.Text)
dr(OrderData.Or derTypeID_FIELD ) =
Me.dropOrderTyp e.SelectedItem. Value
dr(OrderData.Cu rrencyID_FIELD) =
Me.dropCurrency List.SelectedIt em.Value
dr(OrderData.Pu rchOrderNumber_ FIELD) =
Me.txtPurchaseO rderNum.Text
dr(OrderData.Re qDelDate_FIELD) = CDate(Me.ReqDel vDate.Text)
dr(OrderData.Sp ecialInstructio ns_FIELD) =
Me.txtSpecialIn structions
_OrderData.Tabl es(OrderData.Or derHistory_TABL E).Rows.Add(dr)
Else
End If
End Sub
Public Sub Submit_Click(By Val sender As System.Object, ByVal e As
System.EventArg s) Handles Submit.Click
SaveOrder()
End Sub
End Class
webform1.aspx
<%@ Register TagPrefix="uc1" TagName="Genera lInformation"
Src="Controls/GeneralInformat ion.ascx" %>
<%@ Page Language="vb" AutoEventWireup ="false"
Codebehind="Web Form1.aspx.vb"
Inherits="Sulfa Treat.MySulfaTr eat.OnlineOrder s.WebForm1"%>
<%@ Register TagPrefix="uc1" TagName="Custom erInformation"
Src="Controls/CustomerInforma tion.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm1 </title>
<meta content="Micros oft Visual Studio .NET 7.1" name="GENERATOR ">
<meta content="Visual Basic .NET 7.1" name="CODE_LANG UAGE">
<meta content="JavaSc ript" name="vs_defaul tClientScript">
<meta content="http://schemas.microso ft.com/intellisense/ie5"
name="vs_target Schema">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<P>
<uc1:GeneralInf ormation id="GeneralInfo rmation1"
runat="server"> </uc1:GeneralInfo rmation></P>
<P>
<asp:Button id="Button1" runat="server"
Text="Button"></asp:Button></P>
</form>
</body>
</HTML>
webform1.aspx.v b
Imports SulfaTreat.Comm on.Data
Imports SulfaTreat.Busi nessRules
Public Class WebForm1
Inherits System.Web.UI.P age
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()
End Sub
Protected WithEvents Button1 As System.Web.UI.W ebControls.Butt on
Protected WithEvents GenInfo As
SulfaTreat.MySu lfaTreat.Online Orders.GeneralI nformation
'NOTE: The following placeholder declaration is required by the Web
Form Designer.
'Do not delete or move it.
Private designerPlaceho lderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeCompo nent()
End Sub
#End Region
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Session("OrderI D") = "new"
System.Diagnost ics.Debug.Write (GenInfo.Client ID)
GenInfo.SaveOrd er()
End Sub
End Class
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!