Ejemplo n.º 1
0
        public Qprice()
        {
            InitializeComponent();

            var data = QuoteNames.GetNames();

            cmbQuoteNames.DataSource    = data;
            cmbQuoteNames.DisplayMember = "Name";
            cmbQuoteNames.ValueMember   = "Tel";
        }
Ejemplo n.º 2
0
        public static List <QuoteNames> GetXmlNames()
        {
            string   xmlfilePath            = AppDomain.CurrentDomain.BaseDirectory + "\\tools\\temp\\UserInfo.xml";
            XElement xe                     = XElement.Load(xmlfilePath);
            IEnumerable <XElement> elements = from ele in xe.Elements("Info")
                                              select ele;


            List <QuoteNames> nameList = new List <QuoteNames>();

            foreach (var ele in elements)
            {
                QuoteNames model = new QuoteNames();

                model.Name = ele.Attribute("Name").Value;

                model.Tel = ele.Attribute("Tel").Value;
                nameList.Add(model);
            }

            return(nameList);
        }