private void btnSave_Click(object sender, RoutedEventArgs e) { btnSave.IsEnabled = btnCancel.IsEnabled = false; DispatcherHelper.DoEvents(); string strShipPort = cmbShippPort.Text.Replace("COM", ""); string strUpDownSellModel = "0"; if (rdbUpDownSellModel_Pra.IsChecked == true) { strUpDownSellModel = "1"; } string strUpDownIsQueryElectStatus = "0"; if (rdbUpDownIsQueryElectStatus_Yes.IsChecked == true) { strUpDownIsQueryElectStatus = "1"; } string strFailMsgInfo = PubHelper.p_LangOper.GetStringBundle("Pub_OperFail"); // 保存小车左、中、右移动位置格数 bool result = true; if (!PubHelper.p_BusinOper.CheckDataOper.CheckIsNum(tbLeftSpace_Value.Text)) { result = false; } else if (!PubHelper.p_BusinOper.CheckDataOper.CheckIsNum(tbMiddleSpace_Value.Text)) { result = false; } else if (!PubHelper.p_BusinOper.CheckDataOper.CheckIsNum(tbRightSpace_Value.Text)) { result = false; } else { result = true; } if (!result) { PubHelper.ShowMsgInfo(strFailMsgInfo, PubHelper.MsgType.Ok); btnSave.IsEnabled = btnCancel.IsEnabled = true; return; } PubHelper.p_BusinOper.UpdateSysCfgValue("UpDownLeftRightNum_Left", tbLeftSpace_Value.Text); PubHelper.p_BusinOper.UpdateSysCfgValue("UpDownLeftRightNum_Center", tbMiddleSpace_Value.Text); PubHelper.p_BusinOper.UpdateSysCfgValue("UpDownLeftRightNum_Right", tbRightSpace_Value.Text); result = PubHelper.p_BusinOper.AsileOper.UpDown_Update_Port(PubHelper.p_VendBoxCode, strShipPort, strUpDownSellModel, strUpDownIsQueryElectStatus); if (result) { PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Pub_OperSuc"), PubHelper.MsgType.Ok); this.Close(); } else { PubHelper.ShowMsgInfo(strFailMsgInfo, PubHelper.MsgType.Ok); btnSave.IsEnabled = btnCancel.IsEnabled = true; } }