Esempio n. 1
0
        public Dictionary <int, Mst_payitem> GetPayitem()
        {
            IEnumerable <XElement>        enumerable  = Utils.Xml_Result(Mst_payitem.tableName, Mst_payitem.tableName, null);
            IEnumerable <XElement>        source      = Utils.Xml_Result("mst_payitemtext", "mst_payitemtext", null);
            Dictionary <int, string>      dictionary  = source.ToDictionary((XElement key) => int.Parse(key.Element("Id").Value), (XElement value) => value.Element("Description").Value);
            Dictionary <int, Mst_payitem> dictionary2 = new Dictionary <int, Mst_payitem>(enumerable.Count());

            foreach (XElement item in enumerable)
            {
                Mst_payitem instance = null;
                Model_Base.SetMaster(out instance, item);
                instance.setText(dictionary[instance.Id]);
                dictionary2.Add(instance.Id, instance);
            }
            return(dictionary2);
        }
        public Dictionary <int, Mst_payitem> GetPayitem()
        {
            IEnumerable <XElement>        enumerable  = Utils.Xml_Result(Mst_payitem.tableName, Mst_payitem.tableName, null);
            IEnumerable <XElement>        enumerable2 = Utils.Xml_Result("mst_payitemtext", "mst_payitemtext", null);
            Dictionary <int, string>      dictionary  = Enumerable.ToDictionary <XElement, int, string>(enumerable2, (XElement key) => int.Parse(key.Element("Id").get_Value()), (XElement value) => value.Element("Description").get_Value());
            Dictionary <int, Mst_payitem> dictionary2 = new Dictionary <int, Mst_payitem>(Enumerable.Count <XElement>(enumerable));

            using (IEnumerator <XElement> enumerator = enumerable.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    XElement    current     = enumerator.get_Current();
                    Mst_payitem mst_payitem = null;
                    Model_Base.SetMaster <Mst_payitem>(out mst_payitem, current);
                    mst_payitem.setText(dictionary.get_Item(mst_payitem.Id));
                    dictionary2.Add(mst_payitem.Id, mst_payitem);
                }
            }
            return(dictionary2);
        }