Beispiel #1
0
        private void sbSave_Click(object sender, EventArgs e)
        {
            SimpleButton[] buttons = { sbRefresh, sbSave };
            ButtonEnable(false, buttons);
            //获取旧的参数,保存失败则回溯
            DTDeviceInfo dt = DeviceCommViewModel.VM.PlatEntities;
            PlatParam    pp = new PlatParam();

            pp.platNum           = tePlatNumber.Text.ToString();
            pp.unloadInvalidData = ceUnloadData.Checked;
            string param = JsonNewtonsoft.ToJSON(pp);

            bool rs = SaveDeviceComChanges(
                DeviceCommViewModel.DeviceName.Plat,
                cbeCommunication.Text, null, param);

            if (!rs)
            {
                BackDeviceComChanges(dt);
            }
            ButtonEnable(true, buttons);
            RefreshUI();
            if (!rs)
            {
                return;
            }

            DeviceNotifyEventArgs args = new DeviceNotifyEventArgs();

            args.Key   = "PlatDevice";
            args.Param = param;
            onDeviceNotify(args);
        }
Beispiel #2
0
 /// <summary>
 /// 站点设置被修改后下发命令通知服务端
 /// </summary>
 private void SendCmdToSOA()
 {
     try
     {
         OtherParamInfo oth = new OtherParamInfo();
         oth.StationNumber   = teID.Text;
         oth.Name            = teStationName.Text;
         oth.Longitude       = teLangitude.Text;
         oth.Latitude        = teLatitude.Text;
         oth.Highly          = Convert.ToDouble(teHighly.Text);
         oth.Slope           = Convert.ToDouble(teSlope.Text);
         oth.DetialedAddress = teDetialedAddress.Text;
         oth.Tips            = meTips.Text;
         oth.StationType     = cbeStationType.SelectedIndex;
         string str = JsonNewtonsoft.ToJSON(oth);
         if (str != "")
         {
             BusinessServiceHelper.Instanse.ExecuteBusiness(ExternalBusinessCmd.SetStationInfo, str);
         }
     }
     catch (Exception ex)
     {
         ErrorLog.Error(ex.ToString());
     }
 }
 private void sbSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtNO.Text.Trim() == "" || txtCO.Text.Trim() == "" || txtHC.Text.Trim() == "" || mmTips.Text.Trim() == "")
         {
             XtraMessageBox.Show(Program.infoResource.GetLocalizedString(language.InfoId.InputNotNull));
         }
         else
         {
             string          log  = Program.infoResource.GetLocalizedString(language.InfoId.LimitingInfoChange);
             CarLimitingInfo info = new CarLimitingInfo();
             GasolineCarInfo gaso = new GasolineCarInfo();
             gaso.NOLimiting       = Convert.ToDouble(txtNO.Text);
             gaso.COLimiting       = Convert.ToDouble(txtCO.Text);
             gaso.HCLimiting       = Convert.ToDouble(txtHC.Text);
             info.GasolimitCarInfo = gaso;
             string str = JsonNewtonsoft.ToJSON(info);
             if (str != "")
             {
                 BusinessResult br = BusinessServiceHelper.Instanse.ExecuteBusiness(ExternalBusinessCmd.SetCarLimitInfo, str, BusinessType.Set);
                 if (br == null || !br.Result)
                 {
                     XtraMessageBox.Show(Program.infoResource.GetLocalizedString(language.InfoId.SaveFail));
                     log += Program.infoResource.GetLocalizedString(language.InfoId.OperateFail);
                     ErrorLog.SystemLog(DateTime.Now, log, this.OwnerForm.GetUserName());
                     return;
                 }
             }
             ResultDataViewModel.VM.Execute(new List <object> {
                 ResultDataViewModel.ExecuteCommand.ec_InsertGasolineLimiting,
                 System.DateTime.Now,
                 txtNO.Text,
                 txtCO.Text,
                 txtHC.Text,
                 mmTips.Text
             });
             log += lcNOLimiting.Text + ":" + txtNO.Text;
             log += lcCOLimiting.Text + ":" + txtCO.Text;
             log += lcHCLimiting.Text + ":" + txtHC.Text;
             log += lcTips.Text + ":" + mmTips.Text;
             if (ResultDataViewModel.VM.InsertGasolineLimitingResult)
             {
                 log += Program.infoResource.GetLocalizedString(language.InfoId.OpearteSuccess);
                 XtraMessageBox.Show(Program.infoResource.GetLocalizedString(language.InfoId.SaveCompleted));
             }
             else
             {
                 log += Program.infoResource.GetLocalizedString(language.InfoId.OperateFail);
                 XtraMessageBox.Show(Program.infoResource.GetLocalizedString(language.InfoId.SaveFail));
             }
             ErrorLog.SystemLog(DateTime.Now, log, this.OwnerForm.GetUserName());
         }
     }
     catch (Exception ex)
     {
         ErrorLog.Error(ex.ToString());
     }
 }
Beispiel #4
0
        private void saveInventory(List <InventorySupply> list)
        {
            IDictionary <string, string> textParams = new Dictionary <string, string>();

            textParams.Add("shopId", shopId.ToString());
            textParams.Add("inventoryJson", JsonNewtonsoft.ToJSON(list));
            textParams.Add("loginToken", AppConstant.loginToken);
            String resJson = new HttpUtils().DoPost(AppConstant.saveInventoryUrl, textParams);
            BaseResponse <Object> baseResponse = JsonNewtonsoft.FromJSON <BaseResponse <Object> >(resJson);

            AppConstant.SynTaskInfo.InventoryTask.SynDataNumber += list.Count;
        }
Beispiel #5
0
        private void dealOrder(int shopId, Order order)
        {
            String dealInfo = "dealOrder AmazonOrderId: " + order.AmazonOrderId;

            AppConstant.SynTaskInfo.OrderTask.dealInfoAppend(dealInfo);
            List <OrderItem> orderItems     = getOrderItems(order.AmazonOrderId);
            String           orderItemsJson = JsonNewtonsoft.ToJSON(orderItems);
            String           orderJson      = JsonNewtonsoft.ToJSON(order);

            saveOrder(shopId, orderJson, orderItemsJson);
            ShopService.updateLastUpdatedAfter(shopId, order.LastUpdateDate);
            AppConstant.SynTaskInfo.OrderTask.SynDataNumber += 1;
            lastUpdatedAfter = order.LastUpdateDate;
        }
Beispiel #6
0
        private void sbSave_Click(object sender, EventArgs e)
        {
            SimpleButton[] buttons = { sbRefresh, sbSave };
            ButtonEnable(false, buttons);
            if (tePassword.Text.Trim() == null || teUserName.Text.Trim() == null)
            {
                XtraMessageBox.Show("用户名和密码不能为空");
            }
            //获取旧的参数,保存失败则回溯
            DTDeviceInfo dt = DeviceCommViewModel.VM.LicenseRecogEntities;

            CameraUserAndPwd cup = new CameraUserAndPwd();

            cup.userName = teUserName.Text;
            cup.Password = tePassword.Text;
            string param = JsonNewtonsoft.ToJSON(cup);
            bool   rs    = SaveDeviceComChanges(
                DeviceCommViewModel.DeviceName.LicenseRecog,
                cbeCommunication.Text,
                null,
                param
                );

            if (!rs)
            {
                BackDeviceComChanges(dt);
            }
            ButtonEnable(true, buttons);
            RefreshUI();
            if (!rs)
            {
                return;
            }
            DeviceNotifyEventArgs args = new DeviceNotifyEventArgs();

            args.Key   = "LicenseRecognitionDevice";
            args.Param = param;
            onDeviceNotify(args);
            //if (rs) XtraMessageBox.Show("保存成功");
            //else XtraMessageBox.Show("保存失败");
        }
        /// <summary>
        /// 发送设备信息给SOA
        /// </summary>
        /// <param name="args"></param>
        public void SendDeviceInfoToSOA(List <object> args)
        {
            SendDeviceToSOAEntities.Result = false;
            if (args.Count < 3)
            {
                return;
            }
            try
            {
                DeviceInfo info = new DeviceInfo();
                info.Name          = args[0] == null ? "" : args[0].ToString();
                info.Communication = args[1] == null ? "" : args[1].ToString();
                info.Used          = args[2] == null ? -1 : Convert.ToInt32(args[2]);
                info.Param         = args[3] == null ? "" : args[3].ToString();

                SendDeviceToSOAEntities = DeviceCommBusinessServerHelper.Instanse.ExecuteBusiness(DeviceConfigUpdate, JsonNewtonsoft.ToJSON(info), BusinessType.Set);
            }
            catch (Exception ex)
            {
            }
        }
        private void sbSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtNO.Text.Trim() == "" || txtOpSmoke.Text.Trim() == "" || txtBlackness.Text.Trim() == "" || mmTips.Text.Trim() == "" || (ceOpSmoke.Checked == true && txtOpSmokeSetting.Text.Trim() == ""))
                {
                    XtraMessageBox.Show(Program.infoResource.GetLocalizedString(language.InfoId.InputNotNull));
                }
                else
                {
                    string          log    = Program.infoResource.GetLocalizedString(language.InfoId.LimitingInfoChange);
                    CarLimitingInfo info   = new CarLimitingInfo();
                    DieselCarInfo   diesel = new DieselCarInfo();
                    diesel.NOLimiting        = Convert.ToDouble(txtNO.Text);
                    diesel.OpSmokeLimiting   = Convert.ToDouble(txtOpSmoke.Text);
                    diesel.BlacknessLimiting = Convert.ToInt32(ConvertRomaToInt(txtBlackness.Text));
                    info.DieselCarLimitInfo  = diesel;
                    info.JudgeOpSmoke        = ceOpSmoke.Checked ? 1 : 0;
                    info.JudgeOpSmokeValue   = Convert.ToDouble(txtOpSmokeSetting.Text == ""?"0": txtOpSmokeSetting.Text);
                    info.JudgeYellowCar      = ceYellowCar.Checked ? 1 : 0;
                    string          str = JsonNewtonsoft.ToJSON(info);
                    BusinessMessage msg = new BusinessMessage();
                    msg.BusinessCommand = ExternalBusinessCmd.SetCarLimitInfo;
                    msg.BusinessParam   = str;
                    msg.BusiType        = BusinessType.Set;
                    msg.BusiPriority    = BusinessPriority.Highest;
                    if (str != "")
                    {
                        BusinessResult br = BusinessServiceHelper.Instanse.ExecuteBusiness(msg);
                        if (br == null || !br.Result)
                        {
                            XtraMessageBox.Show(Program.infoResource.GetLocalizedString(language.InfoId.SaveFail));
                            log += Program.infoResource.GetLocalizedString(language.InfoId.OperateFail);
                            ErrorLog.SystemLog(DateTime.Now, log, this.OwnerForm.GetUserName());
                            return;
                        }
                    }

                    ResultDataViewModel.VM.Execute(new List <object> {
                        ResultDataViewModel.ExecuteCommand.ec_InsertDieselCarLimiting,
                        System.DateTime.Now,
                        txtNO.Text,
                        txtOpSmoke.Text,
                        ConvertRomaToInt(txtBlackness.Text),
                        ceOpSmoke.EditValue,
                        ceYellowCar.EditValue,
                        txtOpSmokeSetting.Text,
                        mmTips.Text
                    });

                    log += lcNOLimiting.Text + ":" + txtNO.Text + ",";
                    log += lcOpSmokeLimiting.Text + ":" + txtOpSmoke.Text + ",";
                    log += lcBlacknessLimiting.Text + ":" + txtBlackness.Text + ",";
                    log += lcSelect.Text + ":" + (ceOpSmoke.Checked ? ceOpSmoke.Text + txtOpSmokeSetting.Text : "") + (ceYellowCar.Checked ? ceYellowCar.Text : "");
                    log += lcTips.Text + " " + mmTips.Text + ",";
                    if (ResultDataViewModel.VM.InsertDieselCarLimitingResult)
                    {
                        log += Program.infoResource.GetLocalizedString(language.InfoId.OpearteSuccess);
                        XtraMessageBox.Show(Program.infoResource.GetLocalizedString(language.InfoId.SaveCompleted));
                    }
                    else
                    {
                        log += Program.infoResource.GetLocalizedString(language.InfoId.OperateFail);
                        XtraMessageBox.Show(Program.infoResource.GetLocalizedString(language.InfoId.SaveFail));
                    }
                    ErrorLog.SystemLog(DateTime.Now, log, this.OwnerForm.GetUserName());
                }
            }
            catch (Exception ex)
            {
                ErrorLog.Error(ex.ToString());
            }
        }