示例#1
0
        public List <KeyValuePair <string, string> > GetListProyects()
        {
            List <KeyValuePair <string, string> > Proyects = new List <KeyValuePair <string, string> >();

            try
            {
                IEnumerable <XElement> XItems = XMLUtil.XMLDocument
                                                .Element(RootXmlTableName)
                                                .Elements(XmlTableName);

                foreach (var XItem in XItems)
                {
                    if (string.IsNullOrEmpty(XItem.Attribute("Id").Value))
                    {
                        continue;
                    }

                    string Name = XItem.Element("Name").Value;

                    Proyects.Add(new KeyValuePair <string, string>(Name, Name));
                }
            }
            catch (Exception Ex)
            {
                MessageBox.Show(Ex.Message);
            }

            return(Proyects);
        }
示例#2
0
        public List <Proyect> GetProyects()
        {
            List <Proyect> Proyects = new List <Proyect>();

            try
            {
                IEnumerable <XElement> XItems = XMLUtil.XMLDocument
                                                .Element(RootXmlTableName)
                                                .Elements(XmlTableName);

                foreach (var XItem in XItems)
                {
                    if (string.IsNullOrEmpty(XItem.Attribute("Id").Value))
                    {
                        continue;
                    }

                    Proyects.Add(
                        new Proyect(
                            XItem.Attribute("Id").Value,
                            XItem.Element("Name").Value,
                            XItem.Element("Customer").Value,
                            XItem.Element("TechnicalLeader").Value
                            )
                        );
                }
            }
            catch (Exception Ex)
            {
                MessageBox.Show(Ex.Message);
            }

            return(Proyects);
        }