Пример #1
0
        /// <summary>
        /// 退出
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnExit_Click(object sender, EventArgs e)
        {
            try
            {
                TipDataUpload();
                if (MessageBox.Show("确定退出吗?", "系统提示", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
                {
                    CLog.WriteStationLog("login", "退出登录");
                    //XmlHelper xml = new XmlHelper();
                    //xml.UpdateInnerText("/Root/User/ProductType", BaseVariable.DeviceEntity.ProductType);
                    //xml.UpdateInnerText("/Root/User/ProductCode", BaseVariable.ProductInfo.ProductCode);
                    if (ThreadUploadData != null || ThreadUploadFlag)
                    {
                        ThreadUploadFlag = false;
                        FrmLoginWait frmLoginWait = new FrmLoginWait(this, 1, "正在处理数据,请稍候……");
                        frmLoginWait.ShowDialog();
                        ThreadUploadData = null;
                    }

                    Form ower = this.Owner;
                    ower.Close();
                    ower.Dispose();
                }
            }
            catch (Exception ex)
            {
                Form ower = this.Owner;
                ower.Close();
                ower.Dispose();
                CLog.WriteErrLog("[FrmMain.btnExit]" + ex.Message);
            }
        }
Пример #2
0
 /// <summary>
 /// 初始化触发器
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void timerInit_Tick(object sender, EventArgs e)
 {
     try
     {
         this.timerInit.Enabled = false;
         frmLoginWait           = new FrmLoginWait(this, 0, "正在初始化数据,请稍候……");
         frmLoginWait.ShowDialog();
     }
     catch (Exception ex)
     {
         CLog.WriteErrLog(ex.Message);
     }
     finally
     {
     }
 }