Exemplo n.º 1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                int    iReadSerialBaud          = LBConverter.ToInt32(this.txtReadSerialBaud.Text);
                string strReadSerialName        = this.txtReadSerialName.SelectedValue == null?"": this.txtReadSerialName.SelectedValue.ToString();
                string strWriteSerialName       = this.txtWriteSerialName.SelectedValue == null ? "" : this.txtWriteSerialName.SelectedValue.ToString();
                LBDbParameterCollection parmCol = new LBDbParameterCollection();
                parmCol.Add(new LBParameter("ReadCardSerialCOM", enLBDbType.String, strReadSerialName));
                parmCol.Add(new LBParameter("WriteCardSerialCOM", enLBDbType.String, strWriteSerialName));
                parmCol.Add(new LBParameter("ReadCardBaud", enLBDbType.Int32, iReadSerialBaud));
                parmCol.Add(new LBParameter("MachineName", enLBDbType.String, LoginInfo.MachineName));
                parmCol.Add(new LBParameter("UseReadCard", enLBDbType.Int32, (this.cbUseReadCard.Checked?1:0)));
                parmCol.Add(new LBParameter("UseWriteCard", enLBDbType.Int32, (this.cbUseWriteCard.Checked ? 1 : 0)));
                parmCol.Add(new LBParameter("ConnectType", enLBDbType.Int32, (this.rbNet.Checked ? 1 : 0)));
                parmCol.Add(new LBParameter("IPAddress", enLBDbType.String, this.txtIPAddress.Text));
                parmCol.Add(new LBParameter("IPPort", enLBDbType.Int32, LBConverter.ToInt32(this.txtPort.Text)));
                DataSet dsReturn;
                Dictionary <string, object> dictValue;
                ExecuteSQL.CallSP(20503, parmCol, out dsReturn, out dictValue);

                LBCardHelper.StartSerial(enCardType.ReadCard);
                LB.WinFunction.LBCommonHelper.ShowCommonMessage("保存成功!");
            }
            catch (Exception ex)
            {
                LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
            }
        }
Exemplo n.º 2
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            LBCardHelper.StartSerial(enCardType.WriteCard);//开启打开器端口
            ReadFieldValue();

            SetButtonStatus();
        }