87,902
社区成员
发帖
与我相关
我的任务
分享
<asp:DropDownList ID="DropDLLot" runat="server" Height="16px" Width="126px"
Enabled="False" onclick ="ShadeResult()">
</asp:DropDownList>
function ShadeResult()
{
var PONO=document.getElementById("txtPONO");
var Lot=document.getElementById("DropDLLot");
AjaxTransfer.GetShadeList(PONO.value,Lot.item(Lot.selectedindex).text,get_Shade_Result_CallBack);
document.getElementById("DropDLLot").disabled = false;
document.getElementById("DropDLShade").disabled = false;
document.getElementById("DropDLLocation1").disabled = true;
document.getElementById("DropDLLocation2").disabled = true;
}
function get_Shade_Result_CallBack(response)
{
if (response.value != null)
{
document.all("DropDLShade").length=0;
var ds = response.value;
if(ds != null && typeof(ds) == "object" && ds.Tables != null)
{
for(var i=0; i<ds.Tables[0].Rows.length; i++)
{
var name=ds.Tables[0].Rows[i].Shade;
document.all("DropDLShade").options.add(new Option(name));
}
}
}
return
}
<Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.Read)> _
Public Function GetShadeList(ByVal PONO As String, ByVal Lot As String) As DataSet
Return GetDataSet(PONO, "LOT", Lot, "", "", "")
End Function
<Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.Read)> _
Public Function GetDataSet(ByVal PONO As String, ByVal SearchType As String, ByVal Lot As String _
, ByVal Shade As String, ByVal Loc1 As String, ByVal Loc2 As String) As DataSet
Dim ConnectionString As String = System.Configuration.ConfigurationManager.AppSettings("WarehouseConstr")
Dim sda As SqlDataAdapter
sda = New SqlDataAdapter("wingreat.sys_LocTransfer;1", ConnectionString)
sda.SelectCommand.Parameters.Add("@PONO", SqlDbType.VarChar, 30).Value = PONO
sda.SelectCommand.Parameters.Add("@Type", SqlDbType.VarChar, 5).Value = SearchType
If SearchType.ToUpper = "LOT" Then
sda.SelectCommand.Parameters.Add("@LOT", SqlDbType.VarChar, 20).Value = Lot
ElseIf SearchType.ToUpper = "SHADE" Then
sda.SelectCommand.Parameters.Add("@LOT", SqlDbType.VarChar, 20).Value = Lot
sda.SelectCommand.Parameters.Add("@SHADE", SqlDbType.VarChar, 5).Value = Shade
ElseIf SearchType.ToUpper = "LOC1" Then
sda.SelectCommand.Parameters.Add("@LOT", SqlDbType.VarChar, 20).Value = Lot
sda.SelectCommand.Parameters.Add("@SHADE", SqlDbType.VarChar, 5).Value = Shade
sda.SelectCommand.Parameters.Add("@Loc1", SqlDbType.VarChar, 15).Value = Loc1
ElseIf SearchType.ToUpper = "LOC2" Then
sda.SelectCommand.Parameters.Add("@LOT", SqlDbType.VarChar, 20).Value = Lot
sda.SelectCommand.Parameters.Add("@SHADE", SqlDbType.VarChar, 5).Value = Shade
sda.SelectCommand.Parameters.Add("@Loc1", SqlDbType.VarChar, 15).Value = Loc1
sda.SelectCommand.Parameters.Add("@Loc2", SqlDbType.VarChar, 15).Value = Loc2
End If
sda.SelectCommand.CommandType = CommandType.StoredProcedure
Dim ds As DataSet = New DataSet()
sda.Fill(ds)
Return ds
End Function