/// <summary> /// 初始化PDA本地信息 /// </summary> private void InitPDALocalInfo() { try { Cursor.Current = Cursors.WaitCursor; Common.Init(); //Common._PDANumber = DictionaryServer.GetPDAInfo(Enum_DicKey.pdaNumber); if (string.IsNullOrEmpty(Common._PDANumber)) { FrmParent.ParentForm.OpenForm(PageState.SetNumber); MessageBox.Show("在使用前,请先设置本机对应服务器的设备编号!", "欢迎使用思博源冷链物流系统", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1); } else if (Common._IsMainFormFirstShow) { UCSyncAll uc = FrmParent.ParentForm.OpenForm(PageState.Sync) as UCSyncAll; //MessageBox.Show("在使用前,最好先同步一次最新资料,不过您也可以停止同步!", "欢迎使用思博源冷链物流系统", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1); uc.StartSync(this.Name); } //Common._IsMainFormFirstShow = false; } catch (Exception ex) { MessageBox.Show(ex.Message, "加载参数失败", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1); } finally { Cursor.Current = Cursors.Default; } }
private void btnOK_Click(object sender, EventArgs e) { FrmParent.ParentForm.ResetReturnDelay(); if (!CheckPDAPassword("010203")) { return; } if (!CheckInput()) { return; } try { Cursor.Current = Cursors.WaitCursor; ResultModelOfboolean numerEixst = Common._PdaServer.SetPDANumber(txtPDANumber.Text.Trim()); if (numerEixst.Code != 0) { throw new Exception(numerEixst.Message); } if (!numerEixst.Data) { throw new Exception("服务器未配置此编号的设备信息!"); } Common._PDANumber = txtPDANumber.Text.Trim(); _newNumber = Common._PDANumber; UCSyncAll uc = FrmParent.ParentForm.OpenForm(PageState.Sync) as UCSyncAll; uc.StartSync(this.Name); } catch (Exception ex) { MessageBox.Show(ex.Message, "操作失败!", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1); txtPDANumber.Focus(); } finally { Cursor.Current = Cursors.Default; } }