Exemplo n.º 1
0
        void makeData()
        {
            try
            {
                string url = App.BaseURL + "AppArray/GetAllArray?id=" + _arrayID + "&pageIndex=0&pageSize=30";
                Console.WriteLine(url);
                string result = EasyWebRequest.sendGetHttpWebRequest(url);
                Console.WriteLine("请求结果:" + result);
                devisResult dev = JsonConvert.DeserializeObject <devisResult>(result);
                if (pageIndex == 0)
                {
                    dataList.Clear();
                }
                if (dev.Items.Count < 20)
                {
                    haveMole = false;
                }

                for (int i = 0; i < dev.Items.Count; i++)
                {
                    DeviesModel item = dev.Items[i];

                    dataList.Add(item);
                }
            }
            catch (Exception ex)
            {
                DisplayAlert("错误提示", ex.Message, "OK");
            }
        }
 void makeData()
 {
     try
     {
         string url = App.BaseURL + "AppFlow/GetFlowDesInfo?id=" + _flow.flowid;
         Console.WriteLine("请求接口:" + url);
         string result = EasyWebRequest.sendGetHttpWebRequest(url);
         Console.WriteLine("请求结果:" + result);
         result = result.Replace("null", "0");
         list   = JsonConvert.DeserializeObject <List <FlowDesInfo> >(result);
     }
     catch (Exception ex)
     {
     }
 }
Exemplo n.º 3
0
        void makeData()
        {
            try
            {
                string url = App.BaseURL + "AppAlarm/GetParamByAlarm?id=" + _alert.alarmid;
                Console.WriteLine("请求接口:" + url);
                string result = EasyWebRequest.sendGetHttpWebRequest(url);
                Console.WriteLine("请求结果:" + result);

                list = JsonConvert.DeserializeObject <AlertInfo>(result);
            }
            catch (Exception ex)
            {
                DisplayAlert("Alert", ex.Message, "OK");
            }
        }
        void makeData()
        {
            try
            {
                string url = App.BaseURL + "AppPushAlarm/GetPush?id=" + _alertOrAlarmId;
                Console.WriteLine("请求接口:" + url);
                string result = EasyWebRequest.sendGetHttpWebRequest(url);
                Console.WriteLine("请求结果:" + result);

                list = JsonConvert.DeserializeObject <List <PushRecordType> >(result);
            }
            catch (Exception ex)
            {
                DisplayAlert("Alert", ex.Message, "OK");
            }
        }
Exemplo n.º 5
0
 void makeData()
 {
     try
     {
         string url = App.BaseURL + "AppOperParam/GetAllOper?id=" + _eqId + "&pageIndex=0&pageSize=30";
         Console.WriteLine(url);
         string result = EasyWebRequest.sendGetHttpWebRequest(url);
         Console.WriteLine("请求结果:" + result);
         entlisttype ENT = JsonConvert.DeserializeObject <entlisttype>(result);
         list = ENT.Items;
     }
     catch (Exception ex)
     {
         DisplayAlert("错误提示", ex.Message, "OK");
     }
 }
Exemplo n.º 6
0
        void makeData()
        {
            try
            {
                string url = App.BaseURL + "AppFlow/GetFlowOperById?id=" + _flow.flowid;

                Console.WriteLine("请求接口:" + url);
                string result = EasyWebRequest.sendGetHttpWebRequest(url);
                Console.WriteLine("请求结果:" + result);

                dataList = JsonConvert.DeserializeObject <ObservableCollection <WaterDataModel> >(result);
            }
            catch (Exception ex)
            {
                DisplayAlert("错误提示", ex.Message, "OK");
            }
        }
Exemplo n.º 7
0
        void makeData()
        {
            try
            {
                string url = App.BaseURL + "AppFlow/GetAllROEquipment?id=" + _flow.flowid;
                Console.WriteLine(url);
                string result = EasyWebRequest.sendGetHttpWebRequest(url);
                Console.WriteLine("请求结果:" + result);

                dataList = JsonConvert.DeserializeObject <ObservableCollection <ROEquipmentModel> >(result);
                CrossHud.Current.Dismiss();
            }
            catch (Exception ex)
            {
                CrossHud.Current.Dismiss();
                CrossHud.Current.ShowError(message: "网络错误", timeout: new TimeSpan(0, 0, 4));
            }
        }
Exemplo n.º 8
0
        void makeData()
        {
            try
            {
                DateTime sd  = startDatePicker.Date + startTime;
                DateTime ed  = endDatePicker.Date + endTime;
                string   url = App.BaseURL + "AppOperParam/GetDataByTime?id=" + _parametId + "&startTime=" + sd.ToString("yyyy-MM-dd HH:mm") + "&endTime=" + ed.ToString("yyyy-MM-dd HH:mm");

                Console.WriteLine("请求接口:" + url);
                string result = EasyWebRequest.sendGetHttpWebRequest(url);
                Console.WriteLine("请求结果:" + result);
                result     = result.Replace("null", "0");
                resultData = JsonConvert.DeserializeObject <resultParama>(result);
            }
            catch (Exception ex)
            {
                DisplayAlert("错误提示", ex.Message, "OK");
            }
        }
Exemplo n.º 9
0
        private void reqGoEnt()
        {
            BackgroundWorker wrk = new BackgroundWorker();

            wrk.DoWork += (sender1, e1) =>
            {
                string url2 = App.BaseURL + "AppEnterprise/GeteEnterpriseByKey?searchKey=" + "&pageIndex=0" + "&pageSize=30";
                result = EasyWebRequest.sendGetHttpWebRequest(url2);
            };
            wrk.RunWorkerCompleted += (sender1, e1) =>
            {
                var retv   = JsonConvert.DeserializeObject <entlisttype>(result);
                var list   = retv.Items;
                var busine = new BusinessDetailsPage(list[0], 0);
                CrossHud.Current.Dismiss();
                Navigation.PushAsync(busine);
                pushDeviceTokenToServie();
            };
            wrk.RunWorkerAsync();
        }
Exemplo n.º 10
0
        void makeData()
        {
            try
            {
                string url = App.BaseURL + "AppFlow/GetFlowOparamter?id=" + _flow.flowid + "&equipmentid=" + _equipment.id;
                Console.WriteLine(url);
                string result = EasyWebRequest.sendGetHttpWebRequest(url);
                Console.WriteLine("请求结果前:" + result);
                result = result.Replace("null", "0");
                Console.WriteLine("请求结果后:" + result);

                dataList = JsonConvert.DeserializeObject <ObservableCollection <FlowDesInfo> >(result);
                CrossHud.Current.Dismiss();
            }
            catch (Exception ex)
            {
                CrossHud.Current.Dismiss();
                CrossHud.Current.ShowError(message: "网络错误", timeout: new TimeSpan(0, 0, 4));
            }
        }
Exemplo n.º 11
0
        void makeData()
        {
            try
            {
                string url = App.BaseURL + "AppEnterprise/GetEnterpriseDetail?id=" + _ent.id;
                Console.WriteLine(url);
                string result = EasyWebRequest.sendGetHttpWebRequest(url);
                Console.WriteLine("请求结果:" + result);

                var list = JsonConvert.DeserializeObject <List <BusinessDetails> >(result);

                if (list.Count > 0)
                {
                    details = list[0];
                }
            }
            catch (Exception ex)
            {
                DisplayAlert("Alert", ex.Message, "OK");
            }
        }
Exemplo n.º 12
0
        private void reqUserInfo()
        {
            string           userinfoResult = "";
            BackgroundWorker wrk            = new BackgroundWorker();

            wrk.DoWork += (sender1, e1) =>
            {
                string url = App.BaseURL + "appflow/GetUserInfo";
                Console.WriteLine(url);
                userinfoResult = EasyWebRequest.sendGetHttpWebRequest(url);
            };
            wrk.RunWorkerCompleted += (sender1, e1) =>
            {
                userInfo userinfo = JsonConvert.DeserializeObject <userInfo>(userinfoResult);

                if (userinfo.userInf_roleid == null)
                {
                    return;
                }
                if (userinfo.userInf_roleid == "4")
                {//企业管理员直接进入企业
                    try
                    {
                        reqGoEnt();
                    }
                    catch (Exception ex)
                    {
                        DisplayAlert("错误提示", ex.Message, "OK");
                    }
                }
                else
                {
                    CrossHud.Current.Dismiss();
                    Navigation.PushAsync(new EnterpriseListPage());
                    pushDeviceTokenToServie();
                }
            };
            wrk.RunWorkerAsync();
        }
Exemplo n.º 13
0
        void makeData()
        {
            try
            {
                string url = App.BaseURL + "AppEnterprise/GeteEnterpriseByKey?searchKey=" + searchB.Text + "&pageIndex=" + pageIndex + "&pageSize=30";
                Console.WriteLine("请求url:" + url);

                string result = EasyWebRequest.sendGetHttpWebRequest(url);
                Console.WriteLine("请求结果:" + result);

                var retv = JsonConvert.DeserializeObject <entlisttype>(result);
                if (retv == null)
                {
                    DisplayAlert("retv null", result, "OK");
                }
                if (pageIndex == 0)
                {
                    dataList.Clear();
                }
                for (int i = 0; i < retv.Items.Count; i++)
                {
                    Enttype item = retv.Items[i];
                    dataList.Add(item);
                }

                if (retv.Totals <= dataList.Count)
                {
                    haveMole = false;
                }
                else
                {
                    haveMole = true;
                }
            }
            catch (Exception ex)
            {
                DisplayAlert("Alert", ex.Message, "OK");
            }
        }
Exemplo n.º 14
0
        void makeData()
        {
            try
            {
                DateTime end   = DateTime.Now;
                DateTime start = end.AddHours(-6);

                var endStr   = end.ToString("yyyy-MM-dd HH:mm:ss");
                var startStr = start.ToString("yyyy-MM-dd");
                startStr = startStr + " 00:00:00";
                string url = App.BaseURL + "AppAlarm/GetAlarmCountByFlowid?id=" + _flow.flowid + "&sdt=" + startStr + "&edt=" + endStr;
                Console.WriteLine(url);
                string result = EasyWebRequest.sendGetHttpWebRequest(url);
                Console.WriteLine("请求结果:" + result);

                aaaa = JsonConvert.DeserializeObject <List <resutlDic> >(result);
            }
            catch (Exception ex)
            {
                DisplayAlert("Alert", ex.Message, "OK");
            }
        }
Exemplo n.º 15
0
        void haveAlertOrAlarm()
        {
            try
            {
                DateTime sd  = startDatePicker.Date + startTime;
                DateTime ed  = endDatePicker.Date + endTime;
                string   url = App.BaseURL + "AppAlarm/GetAllAlarm?id=" + _businessId + "&startTime=" + sd.ToString("yyyy-MM-dd HH:mm") + "&endTime=" + ed.ToString("yyyy-MM-dd HH:mm") + "&pageIndex=" + pageIndex +
                               "&pageSize=20" + "&flag=" + _flag;
                Console.WriteLine("请求接口:" + url);
                string result = EasyWebRequest.sendGetHttpWebRequest(url);
                Console.WriteLine("请求结果:" + result);

                resutlDic resultList = JsonConvert.DeserializeObject <resutlDic>(result);
                if (pageIndex == 0)
                {
                    dataList.Clear();
                }
                for (int i = 0; i < resultList.Items.Count; i++)
                {
                    AlertAndAlarmt item = resultList.Items[i];

                    dataList.Add(item);
                }

                if (resultList.Totals <= dataList.Count)
                {
                    haveMole = false;
                }
                else
                {
                    haveMole = true;
                }
            }
            catch (Exception ex)
            {
                DisplayAlert("Alert", ex.Message, "OK");
            }
        }
Exemplo n.º 16
0
        void makeData()
        {
            try
            {
                string url = App.BaseURL + "AppFlow/GetDataByFlow?id=" + _flow.flowid + "&searchKey=" + searchB.Text + "&pageIndex=" + pageIndex + "&pageSize=20";

                Console.WriteLine("请求接口:" + url);
                string result = EasyWebRequest.sendGetHttpWebRequest(url);
                Console.WriteLine("请求结果:" + result);

                var list = JsonConvert.DeserializeObject <entlisttype>(result);

                if (pageIndex == 0)
                {
                    dataList.Clear();
                }

                for (int i = 0; i < list.Items.Count; i++)
                {
                    Parameter item = list.Items[i];
                    dataList.Add(item);
                }
                if (dataList.Count >= list.Totals)
                {
                    haveMole = false;
                }
                else
                {
                    haveMole = true;
                }
            }
            catch (Exception ex)
            {
                DisplayAlert("错误提示", ex.Message, "OK");
            }
        }