Ejemplo n.º 1
0
        //private void ComBox_ATTA_MouseClick(object sender, MouseEventArgs e)
        //{
        //    ComboBox box = sender as ComboBox;
        //    NameRef nr = (NameRef)box.SelectedItem;
        //    DbElement dbElement = DbElement.GetElement(nr.Ref);
        //    CurrentElement.Element = dbElement;

        //}
        public void BindHS()
        {
            // XmlHelper xmlHelper = new XmlHelper();
            //System.Xml.XmlNodeList list= xmlHelper.GetXmlNodeListByXpath(@"C:\AVEVA\Plant\PDMS12.1.SP4\HS.xml", "//standards//standard");
            // ComBox_Standard.Items.Clear();
            // foreach (System.Xml.XmlNode node in list)
            // {
            //     ComBox_Standard.Items.Add(new NameNode( node.Attributes["name"].Value,node));
            // }
            HSData.HSDal dal = new HSData.HSDal();
            ComBox_Standard.DataSource    = dal.GetStandardList();
            ComBox_Standard.DisplayMember = "Name";
            ComBox_Standard.ValueMember   = "Node";
        }
Ejemplo n.º 2
0
        private void ComBox_Standard_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboBox comb = sender as ComboBox;

            HSData.StandardModel model = (HSData.StandardModel)comb.SelectedItem;
            //XmlHelper helper = new XmlHelper();
            //System.Xml.XmlNodeList list = helper.GetXmlNodeListByXmlNode("types/type", nr.Node);
            //ComBox_Type.Items.Clear();
            //foreach (System.Xml.XmlNode node in list)
            //{
            //    ComBox_Type.Items.Add(new NameNode(node.Attributes["name"].Value, node));
            //}
            HSData.HSDal dal = new HSData.HSDal();
            ComBox_Type.DataSource    = dal.GetTypeListByStandard(model.Node);
            ComBox_Type.DisplayMember = "Name";
            ComBox_Type.ValueMember   = "Node";
        }