예제 #1
0
        private void btnFinish_Click(object sender, EventArgs e)
        {
            try
            {
                if (AppUtil.ShowQuestion("是否要保存当前设置?") != DialogResult.Yes)
                {
                    return;
                }
                Cursor.Current = Cursors.WaitCursor;

                AppUtil.SetXmlNodeValue(QSConstValue.SERVERIP_NODE, AppUtil.EncryptString(txtserverip.Text, ""));
                AppUtil.SetXmlNodeValue(QSConstValue.SERVERNAME_NODE, AppUtil.EncryptString(txtdbname.Text, ""));
                AppUtil.SetXmlNodeValue(QSConstValue.COM_NODE, AppUtil.EncryptString(txtCOM.Text, ""));

                AppUtil.ShowInformation("设置成功!");
                CloseView();
            }
            catch (Exception ex)
            {
                AppUtil.ShowWarning("设置失败!原因:" + ex.ToString());
                logger.ErrorException("FrmConnSetting窗体btnFinish_Click事件:" + ex.Message, ex);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
예제 #2
0
        /// <summary>
        /// 登录事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string errorInfo = string.Empty;

            try
            {
                Cursor.Current = Cursors.WaitCursor;

                StatusLable lblstatus = new StatusLable(lblLoadingInfo);

                if (!Login(lblstatus, out errorInfo))
                {
                    AppUtil.ShowInformation(errorInfo);
                    txtUserPwd.Text = string.Empty;
                    txtUserId.Focus();
                    txtUserId.SelectAll();
                    return;
                }
                lblstatus.UpdateMessage("正在读取用户信息...");
                //读取用户信息
                InitUserInfo();

                lblstatus.UpdateMessage("正在读取用户界面...");
                this.ParentForm.LoadView(typeof(FrmMenu), false, true);
                this.Dispose();
            }
            catch (Exception ex)
            {
                logger.ErrorException("FrmLogin:btnLogin_Click:" + ex.Message, ex);
                AppUtil.ShowError("QuickScanner登录失败,原因:" + ex.Message + "!");
            }
            finally
            {
                if (lblLoadingInfo != null)
                {
                    new StatusLable(lblLoadingInfo).UpdateMessage("准备就绪...");
                }
                Cursor.Current = Cursors.Default;
            }
        }
예제 #3
0
        private void btnFinish_Click(object sender, EventArgs e)
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                DataTable dt = dgScan.DataSource as DataTable;
                if (dt == null || dt.Rows.Count == 0)
                {
                    AppUtil.ShowError("请至少扫描一条记录!");
                    return;
                }

                dt = WebAPIUtil.GetAPIByJsonToGeneric <DataTable>(string.Format("/api/scan/GetTempScanCy/{0}/{1}", QSCommonValue.ListHead.Rows[0]["F_EnCode"].ToString(), QSCommonValue.operModule));

                DataView dv = new DataView(dt);
                dv.RowFilter = "CYQTY <> 0";
                if (dv.Count > 0 && AppUtil.ShowQuestion("仍有货品未扫描完毕,是否确认完成?") != DialogResult.Yes)
                {
                    return;
                }
                WebAPIUtil.GetToAPIByJsonToAPIResult(string.Format("/api/scan/TempScanFinish/{0}/{1}", QSCommonValue.ListHead.Rows[0]["F_EnCode"].ToString(), QSCommonValue.operModule));
                AppUtil.ShowInformation("操作完成!");
                this.ParentForm.LoadView(typeof(FrmHead), false, true);
            }
            catch (Exception ex)
            {
                logger.ErrorException("FrmScan窗体txtorderNo_KeyDown事件:" + ex.Message, ex);
                AppUtil.ShowError("操作失败!原因:" + ex.Message);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
                txtbarcode.Focus();
                txtbarcode.Text = string.Empty;
            }
        }