public static void GetParkInfoEx()
        {
            DateTime start = DateTime.Now;

            InitInfo initInfo = CreateInitInfo();

            DateTime end = DateTime.Now;
            TimeSpan t   = end - start;

            string xml = XmlSerializeHelper.GetXmlText(initInfo);

            Gui.TextReport("获取整个园区", xml, 700, 500);
        }
Пример #2
0
        public static void GetRoomInfo()
        {
            DateTime start = DateTime.Now;

            TopoInfo topoInfo = GetRoomEx();

            DateTime end = DateTime.Now;
            TimeSpan t   = end - start;
            string   xml = "";

            if (topoInfo != null)
            {
                xml = XmlSerializeHelper.GetXmlText(topoInfo, true);
            }
            Gui.TextReport(topoInfo.Name + "|" + t, xml, 700, 500);
        }
Пример #3
0
        public static void GetInitInfo()
        {
            DateTime start = DateTime.Now;

            string txt = Interaction.GetString("输入园区名称");

            if (string.IsNullOrEmpty(txt))
            {
                txt = "园区";
            }

            TopoInfo floor = GetFloorInfo();

            InitInfo initInfo = CreateInitInfo(floor, txt);

            DateTime end = DateTime.Now;
            TimeSpan t   = end - start;

            string xml = XmlSerializeHelper.GetXmlText(initInfo);

            Gui.TextReport(floor.Name + "|" + t, xml, 700, 500);
        }
        public static void GetOneFloorWithRoot(string floorLayer, string parkName)
        {
            DateTime start = DateTime.Now;

            TopoInfo floor = GetOneFloorOpt(floorLayer);
            string   xml   = "";

            if (!string.IsNullOrEmpty(parkName))
            {
                InitInfo initInfo = GetRoomsCommand.CreateParkInitInfoByFloors(parkName, floorLayer, floor);
                xml = XmlSerializeHelper.GetXmlText(initInfo);
                MyTool.TextReport("获取一个楼层和园区", xml, 700, 500);
            }
            else
            {
                xml = XmlSerializeHelper.GetXmlText(floor, true);
                MyTool.TextReport("获取一个楼层", xml, 700, 500);
            }

            DateTime end = DateTime.Now;
            TimeSpan t   = end - start;
        }
        /// <summary>
        /// Thickness:厚度,层高
        /// IsRelative="true"
        /// BottomHeight:离地面高度,0层为0,6.5层为:6500
        /// </summary>
        /// <param name="name"></param>

        //获取楼层内的房间 //add by qclei 2020-07-10
        public static void GetAllFloors(string buildingName, int buildingFloorCount, string parkName)
        {
            DateTime        start  = DateTime.Now;
            List <TopoInfo> floors = GetFloorList(buildingName, buildingFloorCount);
            string          xml    = "";

            if (!string.IsNullOrEmpty(parkName))
            {
                InitInfo initInfo = GetRoomsCommand.CreateParkInitInfoByFloors(parkName, buildingName, floors.ToArray());
                xml = XmlSerializeHelper.GetXmlText(initInfo);
                MyTool.TextReport("获取整个大楼和园区", xml, 700, 500);
            }
            else
            {
                TopoInfo initInfo = GetRoomsCommand.CreateBuildingInitInfoByFloors(buildingName, floors.ToArray());
                xml = XmlSerializeHelper.GetXmlText(initInfo, true);
                MyTool.TextReport("获取整个大楼", xml, 700, 500);
            }


            DateTime end = DateTime.Now;
            TimeSpan t   = end - start;
        }
Пример #6
0
 public static string ToXml(this object obj)
 {
     return(XmlSerializeHelper.GetXmlText(obj));
 }
Пример #7
0
 public string toXml()
 {
     return(XmlSerializeHelper.GetXmlText(shapelist));
 }
Пример #8
0
        private void MenuZhongShan_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                //string result = WebApiHelper.GetString("http://127.0.0.1:8080/zhongshan/login");
                // Log.Info(result);


                //List<sis> list=WebApiHelper.GetEntity<List<sis>>("http://127.0.0.1:8080/zhongshan/login/Sis");
                //sis ss = list[0];
                //检查项列表
                // List<results> resultList = WebApiHelper.GetEntity<List<results>>("http://127.0.0.1:8080/zhongshan/Results/list");
                //results result = resultList[0];

                //两票列表
                //List<tickets> ticketsList = WebApiHelper.GetEntity<List<tickets>>("http://127.0.0.1:8080/zhongshan/Tickets/list");
                //int count = ticketsList.Count;
                //if (count > 0)
                //{
                //    tickets ticket = ticketsList[0];
                //}
                //Sis列表
                //string kks = "kks001";
                // List<sis>  sisList= WebApiHelper.GetEntity<List<sis>>("http://127.0.0.1:8080/zhongshan/Sis/list/kks/"+kks);
                //if (sisList.Count > 0)
                //{
                //    sis sis = sisList[0];
                //}

                //两票数据
                string result = WebApiHelper.GetString("http://120.25.195.214:18000/api/tickets?type=1");

                JsonSerializerSettings setting = new JsonSerializerSettings();
                setting.NullValueHandling = NullValueHandling.Ignore;
                Message <TwoTickets> message = JsonConvert.DeserializeObject <Message <TwoTickets> >(result, setting);
                int               total      = message.total;
                string            msg        = message.msg;
                List <TwoTickets> list       = message.data;


                //循环获取DetailsSet
                if (list != null)
                {
                    foreach (TwoTickets ticket in list)
                    {
                        string  results = ticket.detail;
                        Details details = JsonConvert.DeserializeObject <Details>(results, setting);
                        ticket.detail = "";
                        DetailsSet detalsSet = new DetailsSet();
                        detalsSet.optTicket = details.optTicket;
                        List <LinesSet> lineSet  = new List <LinesSet>();
                        List <LinesGet> lineList = details.lines;

                        //循环,给LineSet赋值
                        if (lineList != null)
                        {
                            foreach (LinesGet line in lineList)
                            {
                                LinesSet setline = new LinesSet();
                                setline.name = line.name;
                                List <Dictionary <string, string> > dicList = line.lineContentList;
                                List <LineContent> contentList = new List <LineContent>();
                                if (dicList != null)
                                {
                                    foreach (Dictionary <string, string> dic in dicList)
                                    {
                                        LineContent     linecontent = new LineContent();
                                        List <KeyValue> keyList     = new List <KeyValue>();
                                        if (dic != null)
                                        {
                                            foreach (KeyValuePair <string, string> kv in dic)
                                            {
                                                KeyValue keyValue = new KeyValue();
                                                keyValue.key   = kv.Key;
                                                keyValue.value = kv.Value;
                                                keyList.Add(keyValue);
                                            }
                                            linecontent.Content = keyList;
                                            contentList.Add(linecontent);
                                        }
                                    }
                                    setline.lineContentList = contentList;
                                    lineSet.Add(setline);
                                }
                            }
                            detalsSet.lines   = lineSet;
                            ticket.detailsSet = detalsSet;
                        }
                    }

                    Message <TwoTickets> aa = message;
                    var xml = XmlSerializeHelper.GetXmlText(aa);
                }
            }
            catch (Exception ex)
            {
                //错误
                Log.Error(ex.ToString());
            }
        }