示例#1
0
    private void PatchSysInfoRequest()//Patch info
    {
        Print(new wResult()
        {
            Des = "PatchSysInfoRequest"
        });
        servAct = ServiceAction.PatchSysInfo;

        int temp_idx = indx - 8;

        JavaScriptSerializer serializer = new JavaScriptSerializer();
        //string sz_Jsonify = serializer.Serialize(ChangeDataArry[temp_idx]);
        string sz_Jsonify = serializer.Serialize(new SysChgData {
            En = 1, Adr = IpTable[temp_idx]
        });

        m_HttpRequest.SendPATCHRequest(Device.Account, Device.Password, GetURL(Device.IPAddress, Device.Port
                                                                               , WISE_RESTFUL_URI.accessctrl.ToString() + "/idx_" + temp_idx.ToString()), sz_Jsonify);
        //
        ExeRes = new wResult()
        {
            Method = HttpRequestOption.PATCH,
            Ins    = WISE_RESTFUL_URI.accessctrl,
            Res    = ExeCaseRes.Pass,
            Des    = "/idx_" + temp_idx.ToString(),
        }; Print(ExeRes);

        this.InvokeWaitStep();
    }
示例#2
0
    private void PatchSysInfoRequest()//Patch info
    {
        Print(new wResult()
        {
            Des = "PatchSysInfoRequest"
        });
        servAct = ServiceAction.PatchSysInfo;

        JavaScriptSerializer serializer = new JavaScriptSerializer();
        string sz_Jsonify = serializer.Serialize(GetChangeDataArray());

        //string sz_Jsonify = serializer.Serialize(ChangeDataArry);

        m_HttpRequest.SendPATCHRequest(Device.Account, Device.Password, GetURL(Device.IPAddress, Device.Port
                                                                               , WISE_RESTFUL_URI.wlan_config.ToString()), sz_Jsonify);
        changeFlg = true;
        //
        ExeRes = new wResult()
        {
            Method = HttpRequestOption.PATCH,
            Ins    = WISE_RESTFUL_URI.wlan_config,
            Res    = ExeCaseRes.Pass,
        }; Print(ExeRes);

        this.InvokeWaitStep();
    }
示例#3
0
    //Request Cmd
    private void GetNetConfigRequest()
    {
        Print(new wResult()
        {
            Des = "GetNetConfigRequest"
        });
        //dataHld.SavePara(Application.StartupPath, textBox1.Text);
        //Device.IPAddress = textBox1.Text;
        servAct = ServiceAction.GetNetConfig;

        int temp_idx = indx > 14 ? indx - 16 : indx;

        m_HttpRequest.SendGETRequest(Device.Account, Device.Password, GetURL(Device.IPAddress, Device.Port
                                                                             , WISE_RESTFUL_URI.accessctrl.ToString()) + "/idx_" + temp_idx.ToString());
        //
        if (changeFlg)
        {
            servAct = ServiceAction.GetNetConfig_ag;
        }
        //
        ExeRes = new wResult()
        {
            Method = HttpRequestOption.GET,
            Ins    = WISE_RESTFUL_URI.accessctrl,
            Des    = "/idx_" + temp_idx.ToString(),
        };
    }
示例#4
0
 //Request Cmd
 private void GetDevInfoRequest()
 {
     Print(new wResult()
     {
         Des = "GetDevInfoRequest"
     });
     servAct = ServiceAction.Connection;
     m_HttpRequest.SendGETRequest(Device.Account, Device.Password,
                                  "http://" + Device.IPAddress + "/profile");
     //
     ExeRes = new wResult()
     {
         Method = HttpRequestOption.GET,
         Ins    = WISE_RESTFUL_URI.profile,
     };
 }
示例#5
0
 //Request Cmd
 private void GetNetConfigRequest()
 {
     Print(new wResult()
     {
         Des = "GetNetConfigRequest"
     });
     dataHld.SavePara(Application.StartupPath, textBox1.Text);
     Device.IPAddress = textBox1.Text;
     servAct          = ServiceAction.GetNetConfig;
     m_HttpRequest.SendGETRequest(Device.Account, Device.Password,
                                  "http://" + Device.IPAddress + "/wlan_value");
     //
     ExeRes = new wResult()
     {
         Method = HttpRequestOption.GET,
         Ins    = WISE_RESTFUL_URI.wlan_value,
     };
 }
示例#6
0
    //Request Cmd
    private void GetNetConfigRequest()
    {
        if (GetRTUConfg)
        {
            Print(new wResult()
            {
                Des = "GetNetConfigRequest"
            });
            dataHld.SavePara(Application.StartupPath, textBox1.Text);
            Device.IPAddress = textBox1.Text;
            servAct          = ServiceAction.GetNetConfig;
            m_HttpRequest.SendGETRequest(Device.Account, Device.Password,
                                         "http://" + Device.IPAddress + "/modbusslave_genconfig/com_1");
            //
            if (changeFlg)
            {
                servAct = ServiceAction.GetNetConfig_ag;
            }
        }
        else
        {
            Print(new wResult()
            {
                Des = "GetNetConfigRequest"
            });
            dataHld.SavePara(Application.StartupPath, textBox1.Text);
            Device.IPAddress = textBox1.Text;
            servAct          = ServiceAction.GetNetConfig;
            m_HttpRequest.SendGETRequest(Device.Account, Device.Password,
                                         "http://" + Device.IPAddress + "/serial_config/com_1");
            //
            if (changeFlg)
            {
                servAct = ServiceAction.GetNetConfig_ag;
            }
        }

        ExeRes = new wResult()
        {
            Method = HttpRequestOption.GET,
            Ins    = WISE_RESTFUL_URI.serial_config,
        };
    }
示例#7
0
    private void PatchSysInfoRequest()//Patch info
    {
        Print(new wResult()
        {
            Des = "PatchSysInfoRequest"
        });
        if (GetRTUConfg)
        {
            servAct = ServiceAction.PatchSysInfo;

            JavaScriptSerializer serializer = new JavaScriptSerializer();
            string sz_Jsonify = serializer.Serialize(ChangeDataArryRTU);

            m_HttpRequest.SendPATCHRequest(Device.Account, Device.Password, GetURL(
                                               Device.IPAddress, Device.Port
                                               , WISE_RESTFUL_URI.modbusslave_genconfig.ToString() + "/com_1")
                                           , sz_Jsonify);
            changeFlg = true;
        }
        else
        {
            servAct = ServiceAction.PatchSysInfo;

            JavaScriptSerializer serializer = new JavaScriptSerializer();
            string sz_Jsonify = serializer.Serialize(ChangeDataArry);

            m_HttpRequest.SendPATCHRequest(Device.Account, Device.Password, GetURL(
                                               Device.IPAddress, Device.Port
                                               , WISE_RESTFUL_URI.serial_config.ToString() + "/com_1")
                                           , sz_Jsonify);
            changeFlg = true;
        }

        ExeRes = new wResult()
        {
            Method = HttpRequestOption.PATCH,
            Ins    = WISE_RESTFUL_URI.net_basic,
            Res    = ExeCaseRes.Pass,
        }; Print(ExeRes);
        this.InvokeWaitStep();
    }
示例#8
0
 private void GetSysInfoRequest()//Get info
 {
     Print(new wResult()
     {
         Des = "GetSysInfo"
     });
     servAct = ServiceAction.GetSysInfo;
     m_HttpRequest.SendGETRequest(Device.Account, Device.Password,
                                  "http://" + Device.IPAddress + "/log_dataoption");
     //
     if (changeFlg)
     {
         servAct = ServiceAction.GetSysInfo_ag;
     }
     //
     ExeRes = new wResult()
     {
         Method = HttpRequestOption.GET,
         Ins    = WISE_RESTFUL_URI.log_dataoption,
     };
 }
示例#9
0
文件: Form1.cs 项目: IAGDQA/WISE
 private void GetNetConfigRequestforReg()
 {
     Print(new wResult()
     {
         Des = "GetNetConfigRequest"
     });
     dataHld.SavePara(Application.StartupPath, textBox1.Text);
     Device.IPAddress = textBox1.Text;
     servAct          = ServiceAction.GetNetConfigforReg;
     m_HttpRequest.SendGETRequest(Device.Account, Device.Password,
                                  "http://" + Device.IPAddress + "/modbus_regconfig");
     //
     if (changeFlg)
     {
         servAct = ServiceAction.GetNetConfig_ag_forReg;
     }
     //
     ExeRes = new wResult()
     {
         Method = HttpRequestOption.GET,
         Ins    = WISE_RESTFUL_URI.modbus_regconfig,
     };
 }
示例#10
0
文件: Form1.cs 项目: windygu/WISE
    void Print(wResult obj)
    {
        DataGridViewRow  dgvRow;
        DataGridViewCell dgvCell;

        dgvRow = new DataGridViewRow();
        //dgvRow.DefaultCellStyle.Font = new Font(this.Font, FontStyle.Regular);
        dgvCell = new DataGridViewTextBoxCell(); //Column Time
        var dataTimeInfo = DateTime.Now.ToString("yyyy-MM-dd HH:MM:ss");

        dgvCell.Value = dataTimeInfo;
        dgvRow.Cells.Add(dgvCell);
        //
        dgvCell       = new DataGridViewTextBoxCell();
        dgvCell.Value = obj.Method;
        dgvRow.Cells.Add(dgvCell);
        //
        dgvCell       = new DataGridViewTextBoxCell();
        dgvCell.Value = obj.Ins;
        dgvRow.Cells.Add(dgvCell);
        //
        dgvCell       = new DataGridViewTextBoxCell();
        dgvCell.Value = obj.Des;
        dgvRow.Cells.Add(dgvCell);
        //
        dgvCell       = new DataGridViewTextBoxCell();
        dgvCell.Value = obj.Res;
        dgvRow.Cells.Add(dgvCell);
        //
        dgvCell       = new DataGridViewTextBoxCell();
        dgvCell.Value = obj.Err;
        dgvRow.Cells.Add(dgvCell);

        m_DataGridViewCtrlAddDataRow(dgvRow);

        ExeRes = new wResult();
    }
示例#11
0
文件: Form1.cs 项目: windygu/WISE
 //Request Cmd
 private void GetNetConfigRequest()
 {
     Print(new wResult()
     {
         Des = "GetNetConfigRequest"
     });
     dataHld.SavePara(Application.StartupPath, textBox1.Text);
     Device.IPAddress = textBox1.Text;
     servAct          = ServiceAction.GetNetConfig;
     m_HttpRequest.SendGETRequest(Device.Account, Device.Password,
                                  GetURL(Device.IPAddress, Device.Port
                                         , WISE_RESTFUL_URI.net_config.ToString()));
     //
     if (changeFlg)
     {
         servAct = ServiceAction.GetNetConfig_ag;
     }
     //
     ExeRes = new wResult()
     {
         Method = HttpRequestOption.GET,
         Ins    = WISE_RESTFUL_URI.net_config,
     };
 }
示例#12
0
文件: Form1.cs 项目: windygu/WISE
 //Request Cmd
 private void GetNetConfigRequest()
 {
     Print(new wResult()
     {
         Des = "GetNetConfigRequest"
     });
     //dataHld.SavePara(Application.StartupPath, textBox1.Text);
     //Device.IPAddress = textBox1.Text;
     Device.IPAddress = textBox1.Text = dataHld.GetPara(Application.StartupPath);
     servAct          = ServiceAction.GetNetConfig;
     m_HttpRequest.SendGETRequest(Device.Account, Device.Password,
                                  "http://" + Device.IPAddress + "/logsys_output");
     //
     if (changeFlg)
     {
         servAct = ServiceAction.GetNetConfig_ag;
     }
     //
     ExeRes = new wResult()
     {
         Method = HttpRequestOption.GET,
         Ins    = WISE_RESTFUL_URI.logsys_output,
     };
 }
示例#13
0
        public JsonResult SyncUpDeliverysByRecord(CMSDeliveryWModels SyncUpData)
        {
            var     currentdate = StoredProcedure.GetCurrentDate();
            var     cmsService  = new MobileService();
            Boolean IsPass      = false;
            var     _result     = new wResult();

            if (SyncUpData != null)
            {
                IsPass = false;
                CMS_Delivery _Delivery = new CMS_Delivery();
                var          cri       = new MobileCri();
                cri.Delivery_ID = SyncUpData.Delivery_ID;
                var result = cmsService.GetCMSDelivery(cri);
                if (result.Code == ReturnCode.SUCCESS)
                {
                    var deliverys = result.Object as List <CMS_Delivery>;
                    if (deliverys != null && deliverys.Count() == 1)
                    {
                        IsPass                      = true;
                        _Delivery                   = deliverys.FirstOrDefault();
                        _Delivery.Delivery_ID       = SyncUpData.Delivery_ID;
                        _Delivery.Delivery_Order_No = SyncUpData.Delivery_Order_No;
                        _Delivery.Completed         = true;
                        _Delivery.Update_By         = SyncUpData.Update_By;
                        _Delivery.Update_On         = currentdate;

                        List <CMS_Delivery_Detail> _Details = new List <CMS_Delivery_Detail>();
                        if (SyncUpData.DeliveryDetail != null)
                        {
                            foreach (var row2 in SyncUpData.DeliveryDetail)
                            {
                                CMS_Delivery_Detail _Detail = new CMS_Delivery_Detail();
                                _Detail.CMS_Delivery_Detail_ID = row2.CMS_Delivery_Detail_ID;
                                _Detail.Delivery_ID            = row2.Delivery_ID;
                                _Detail.Drum_Code      = row2.Drum_Code.Trim();
                                _Detail.Update_By      = SyncUpData.Update_By;
                                _Detail.Update_On      = currentdate;
                                _Detail.Date_Delivered = DateUtil.ToDate(row2.Date_Delivered);
                                _Details.Add(_Detail);
                            }
                            _Delivery.CMS_Delivery_Detail = _Details;
                        }
                    }

                    if (!IsPass)
                    {
                        _result.status  = "1";
                        _result.message = "Error! can not found Delivery";
                        return(Json(new { Data = _result }, JsonRequestBehavior.AllowGet));
                    }
                    var result2 = cmsService.UpdateCMSDelivery(_Delivery);
                    if (result2.Code == ReturnCode.SUCCESS)
                    {
                        _result.status  = "200";
                        _result.message = "Update successfully";
                    }
                    else
                    {
                        _result.status  = "1";
                        _result.message = "Error! can not update data";
                    }
                }
            }
            else
            {
                _result.status  = "1";
                _result.message = "Error! can not update data";
            }
            return(Json(new { Data = _result }, JsonRequestBehavior.AllowGet));
        }