Exemple #1
0
 private void OnFrmLoad(object sender, EventArgs e)
 {
     try
     {
         this.soDal       = new SODal();
         this.vehicleDal  = new VehicleDal();
         dtBegin.DateTime = DateTime.Now.AddDays(-1);
         dtEnd.DateTime   = DateTime.Now;
         LoadDataAndBindGrid();
     }
     catch (Exception ex)
     {
         MsgBox.Err(ex.Message);
     }
 }
Exemple #2
0
        private void OnFrmLoad(object sender, EventArgs e)
        {
            try
            {
                this.soDal       = new SODal();
                this.soWeightDal = new SOWeightDal();
                this.vehicleDal  = new VehicleDal();
                txtBoxForContainerCode.Focus();

                if (!string.IsNullOrEmpty(Properties.Settings.Default.COMWeightNo))
                {
                    comboBoxEditCom.Text = Properties.Settings.Default.COMWeightNo;
                    TryOpenCom();    //尝试打开串口
                }

                #region 测试 报警灯

                /*
                 * try
                 * {
                 *  if (!serialPort2.IsOpen)
                 *  {
                 *      serialPort2.PortName = "COM3";
                 *      serialPort2.BaudRate = 9600;
                 *      serialPort2.Open();
                 *
                 *      lblComState.Text += "报警灯串口打开成功;";
                 *      timer1.Enabled = true;
                 *      this.txtBox.Focus();
                 *  }
                 * }
                 * catch (Exception ex)
                 * {
                 *  lblMsg.Show("报警灯:" + ex.Message, false);
                 * }
                 */
                #endregion

                LoadDataAndBindGrid();    //绑定车辆信息
            }
            catch (Exception ex)
            {
                MsgBox.Err(ex.Message);
            }
        }