Beispiel #1
0
        public static List <KeyValuePair <string, string> > GetCongressList(this CongressXml congressXml)
        {
            var getCongressList = new List <KeyValuePair <string, string> >();

            foreach (var congressModelXml in congressXml.CongressModelXml)
            {
                getCongressList.Add(new KeyValuePair <string, string>(congressModelXml.CongressId.ToString(), congressModelXml.Title));
            }

            return(getCongressList);
        }
Beispiel #2
0
        public CongressXml GetXmlData(IConnectionHandler connectionHandler)
        {
            var homaXml = new CongressXml
            {
                AttendanceType = new List <KeyValueXml>()
                {
                    new KeyValueXml()
                    {
                        Key = "Congress", Value = "همایش"
                    },
                    new KeyValueXml()
                    {
                        Key = "WorkShop", Value = "کارگاه"
                    },
                }
            };
            var currentCongress = new HomaBO().GetCurrentCongress(connectionHandler);

            foreach (var homa in currentCongress)
            {
                var congressModelXml = new CongressModelXml()
                {
                    CongressId = homa.Id, Title = homa.CongressTitle
                };
                var users = new UserBO().SelectKeyValuePair(connectionHandler, x => x.Number, x => x.EnterpriseNode.RealEnterpriseNode.FirstName + " " + x.EnterpriseNode.RealEnterpriseNode.LastName + "(" + x.Username + ")", x => x.CongressId == homa.Id);
                foreach (var user in users)
                {
                    congressModelXml.UserList.Add(new KeyValueXml()
                    {
                        Value = user.Value, Key = user.Key
                    });
                }
                var @where = new WorkShopBO().Where(connectionHandler, x => x.CongressId == homa.Id);
                foreach (var shop in @where)
                {
                    var shopModelXml = new WorkShopModelXml()
                    {
                        Key = shop.Id.ToString(), Value = shop.Subject
                    };
                    var shopUsers = new WorkShopUserBO().SelectKeyValuePair(connectionHandler, x => x.User.Number, x => x.User.EnterpriseNode.RealEnterpriseNode.FirstName + " " + x.User.EnterpriseNode.RealEnterpriseNode.LastName + "(" + x.User.Username + ")", x => x.WorkShopId == shop.Id);
                    foreach (var user in shopUsers)
                    {
                        shopModelXml.UserList.Add(new KeyValueXml()
                        {
                            Value = user.Value, Key = user.Key
                        });
                    }
                    congressModelXml.WorkShopModelList.Add(shopModelXml);
                }
                homaXml.CongressModelXml.Add(congressModelXml);
            }
            return(homaXml);
        }
Beispiel #3
0
        public static List <KeyValuePair <string, string> > GetWorkShopList(this  CongressXml congressXml, Guid congressId)
        {
            var getCongressList   = new List <KeyValuePair <string, string> >();
            var firstOrDefault    = congressXml.CongressModelXml.FirstOrDefault(x => x.CongressId == congressId);
            var workShopModelXmls = firstOrDefault.WorkShopModelList;

            foreach (var congressModelXml in workShopModelXmls)
            {
                getCongressList.Add(new KeyValuePair <string, string>(congressModelXml.Key, congressModelXml.Value));
            }

            return(getCongressList);
        }