public SVCMMeetingDetail()
 {
     VideoSet       = Model.VideoSet.Audio;
     this.Status    = "";
     ConfType       = ConferenceType.Furture;
     ConfMideaType  = MideaType.Local;
     Id             = string.Empty;
     Series         = new MeetingSeries();
     LeaderList     = new List <MeetingLeader>();
     MobileTermList = new List <MobileTerm>();
     Rooms          = new List <MeetingRoom>();
 }
 public SVCMMeetingDetail()
 {
     VideoSet = Model.VideoSet.Audio;
     this.Status = "";
     ConfType = ConferenceType.Furture;
     ConfMideaType = MideaType.Local;
     Id = string.Empty;
     Series = new MeetingSeries();
     LeaderList = new List<MeetingLeader>();
     MobileTermList = new List<MobileTerm>();
     Rooms = new List<MeetingRoom>();
 }
        public bool TryGetSeriesList(Model.HandlerSession session, out List<Model.MeetingSeries> seriesList)
        {
            seriesList = new List<Model.MeetingSeries>();
            try
            {
                session.AddMessageId();
                string xmlData = string.Format("<?xml version=\"1.0\" encoding=\"utf-8\"?><seriesList><messageId>{0}</messageId><token>{1}</token></seriesList>", session.MessageId, session.Token);
                ////logger.Debug(string.Format("TryGetSeriesList, xmldata: {0}", xmlData));
                var response = this._client.DoHttpWebRequest(session.BaseUrl + "seriesList", xmlData);
                ////logger.Debug(string.Format("TryGetSeriesList response, xmldata: {0}", response.OuterXml));
                XmlNode root = response.SelectSingleNode("seriesList");
                string status = root.SelectSingleNode("result").InnerText;

                if (status == "200")
                {
                    foreach (var item in root.SelectNodes("series"))
                    {
                        var node = item as XmlNode;
                        var series = new MeetingSeries();
                        series.Id = node.SelectSingleNode("seriesId").InnerText;
                        series.Name = node.SelectSingleNode("seriesName").InnerText;

                        seriesList.Add(series);
                    }

                    return true;
                }
                else
                {
                    ////logger.Error(string.Format("TryGetSeriesList failed, status: {0}, error:{1}", status, response.InnerXml));
                    this.ReLogin(session, root.SelectSingleNode("result"));
                    return false;
                }
            }
            catch (Exception ex)
            {
                ////logger.Error("TryGetSeriesList failed, error:" + ex.Message + "\n" + ex.StackTrace);
                this.Login(ref session);

            }

            return false;
        }
        public bool TryGetRegionCatagory(RegionCatagoryQuery query, Model.HandlerSession session, out Model.RegionCatagory regionCatagory)
        {
            regionCatagory = new RegionCatagory();

            try
            {
                session.AddMessageId();
                string xmlData = string.Format("<?xml version=\"1.0\" encoding=\"utf-8\"?><searchCity><messageId>{0}</messageId><token>{1}</token><seriesId>{2}</seriesId><provinceCode>{3}</provinceCode><cityCode>{4}</cityCode><boroughCode>{5}</boroughCode></searchCity>",
                                                session.MessageId,
                                                session.Token,
                                                query.SeriesId,
                                                query.ProvinceCode,
                                                query.CityCode,
                                                query.BoroughCode);
                //logger.Debug(string.Format("TryGetRegionCatagory, xmldata: {0}", xmlData));
                var response = this._client.DoHttpWebRequest(session.BaseUrl + "searchcity", xmlData);
                ////logger.Debug(string.Format("TryGetRegionCatagory response, xmldata: {0}", response.OuterXml));
                XmlNode root = response.SelectSingleNode("searchCity");
                string status = root.SelectSingleNode("result").InnerText;

                if (status == "200")
                {
                    regionCatagory.SeriesList = new List<MeetingSeries>();
                    if(root.SelectSingleNode("seriesList") != null)
                        foreach (var item in root.SelectSingleNode("seriesList").SelectNodes("series"))
                    {
                        var node = item as XmlNode;
                        var series = new MeetingSeries();
                        series.Id = node.SelectSingleNode("seriesId").InnerText;
                        series.Name = node.SelectSingleNode("seriesName").InnerText;

                        regionCatagory.SeriesList.Add(series);
                    }

                    regionCatagory.ProvinceList = new List<RegionInfo>();
                    if(root.SelectSingleNode("provinceList") != null)
                    foreach (var item in root.SelectSingleNode("provinceList").SelectNodes("provinceInfo"))
                    {
                        var node = item as XmlNode;
                        var region = new RegionInfo();
                        region.Code = node.SelectSingleNode("provinceCode").InnerText;
                        region.Name = node.SelectSingleNode("provinceName").InnerText;

                        regionCatagory.ProvinceList.Add(region);
                    }

                    regionCatagory.CityList = new List<RegionInfo>();
                    if (root.SelectSingleNode("cityList") != null)
                    foreach (var item in root.SelectSingleNode("cityList").SelectNodes("cityInfo"))
                    {
                        var node = item as XmlNode;
                        var region = new RegionInfo();
                        region.Code = node.SelectSingleNode("cityCode").InnerText;
                        region.Name = node.SelectSingleNode("cityName").InnerText;

                        regionCatagory.CityList.Add(region);
                    }

                    regionCatagory.BoroughList = new List<RegionInfo>();
                    if (root.SelectSingleNode("boroughList") != null)
                    foreach (var item in root.SelectSingleNode("boroughList").SelectNodes("boroughInfo"))
                    {
                        var node = item as XmlNode;
                        var region = new RegionInfo();
                        region.Code = node.SelectSingleNode("boroughCode").InnerText;
                        XmlNode nameNode = node.SelectSingleNode("boroughName");
                        if(nameNode == null)
                            nameNode = node.SelectSingleNode("cityName");
                        region.Name = nameNode.InnerText;

                        regionCatagory.BoroughList.Add(region);
                    }

                    return true;
                }
                else
                {
                    //logger.Error(string.Format("TryGetRegionCatagory failed, status: {0}, error:{1}", status, response.InnerXml));
                    this.ReLogin(session, root.SelectSingleNode("result"));
                    return false;
                }
            }
            catch(Exception ex)
            {
                //logger.Error("TryGetRegionCatagory failed, error:" + ex.Message + "\n" + ex.StackTrace);
                this.Login(ref session);

            }

            return false;
        }