<%@ Page language="c#" Codebehind="qryPlant.aspx.cs" AutoEventWireup="false" Inherits="CQS.QueryDialog.qryPlant" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
    <HEAD>
        <title>select plant</title>
        <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
        <meta name="CODE_LANGUAGE" Content="C#">
        <meta name="vs_defaultClientScript" content="JavaScript">
        <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
        <LINK href="../CSS/style2.css" type="text/css" rel="stylesheet">
        <LINK href="../CSS/style1.css" type="text/css" rel="stylesheet">
        <script language="javascript">            
            var bgColorNotSelect = '#ffffff';  
            var bgColorSelected = '#fceade';  
            var selectedLine = null;  
            
            function SelectLine(trID)
            {  
                if (document.getElementById(trID) !=null)
                {      
                    if (selectedLine==trID)
                    {      
                        document.getElementById(trID).style.backgroundColor = bgColorNotSelect;  
                    } else {
                          if (selectedLine !=null){      
                              document.getElementById(selectedLine).style.background = bgColorNotSelect;      
                          }      
                        document.getElementById(trID).style.backgroundColor = bgColorSelected;
                    }  
                }  
                selectedLine=trID;
            }

            function CancelBtn_OnClick()
            {
                window.returnValue = null;
                window.opener = null;
                window.close();
            }
            
            function OkBtn_OnClick(strResult)
            {
                var ret = "";
                var obj = document.getElementById(strResult);
                
                var num = 0;
                /*for(var i=0;i<obj.options.length;i++)
                {
                    if(obj.options[i].selected)
                    {
                        num += 1;
                        ret = obj.options[i].value;
                    }
                }*/

                if (selectedLine != null)
                {
                    num += 1;
                    ret = selectedLine.substring(selectedLine.indexOf('_')+1,selectedLine.length);
                }

                if(num <=0 )
                {
                    alert("Please select a plant!");
                }
                else if(num >1)
                {
                    alert("Only one plant can be selected!");
                }
                else
                {
                    window.returnValue = ret;
                    window.opener = null;
                    window.close();
                }
            }
        </script>
        <base target="_self">
    </HEAD>
    <body MS_POSITIONING="GridLayout">
        <form );
            }
        }
    }
}

相关文章: