コード例 #1
0
 public ActiveMarkedCard()
 {
     InitializeComponent();
     strBaudRate = ini.IniReadValue("IcCard", "BoudRate");
     strDataBits = ini.IniReadValue("IcCard", "DataBits");
     strStopBits = ini.IniReadValue("IcCard", "StopBits");
     strParity = ini.IniReadValue("IcCard", "Parity");
     strPortName = ini.IniReadValue("IcCard", "PortName");
     commclass = new CoalTraffic.DBUtility.CommClassActiveMC(strBaudRate, strDataBits, strStopBits, strParity, strPortName);
     commclass.OpenCommPort();
     commclass.RecCardCodeTxt = txtMarkedCode;
     commclass.ReciCardCount = txtAdded;
     commclass.alarmSound = alarmSound;
     SetActiveCount();
     CommonMethod.ComboxBind(this.cbxColl, "Sys_Colliery", "CollName", "CollCode", "IsForbid=0", "CollName");
     CommonMethod.ComboxBind(this.cbxCoalKind, "TT_CoalKind", "CoalKindName", "CoalKindCode", "IsForbid=0", "CoalKindName");
     InitICCard();
     SetActiveCount();
 }
コード例 #2
0
 public ActiveMarkedCard()
 {
     InitializeComponent();
     strBaudRate = ini.IniReadValue("IcCard", "BoudRate");
     strDataBits = ini.IniReadValue("IcCard", "DataBits");
     strStopBits = ini.IniReadValue("IcCard", "StopBits");
     strParity = ini.IniReadValue("IcCard", "Parity");
     strPortName = ini.IniReadValue("IcCard", "PortName");
     try
     {
         commclass = new CoalTraffic.DBUtility.CommClassActiveMC(strBaudRate, strDataBits, strStopBits, strParity, strPortName);//初始化读卡器
         commclass.OpenCommPort();//打开读卡器的端口
     }
     catch (Exception ex)
     {
         MessageBox.Show("请检查您的读卡器是否插好,请从新登陆!", "天大天科");
     }
     commclass.RecCardCodeTxt = txtMarkedCode;//将读卡器的值赋值到文本框(标识卡输入框)
     commclass.ReciCardCount = txtAdded;//刷卡器计数
     commclass.alarmSound = alarmSound;//刷卡报警
     commclass.iLimitCardCount = Convert.ToInt16(txtActiveCount.Text);//初始购买数量---将这个值传入到刷卡事件中
 }
コード例 #3
0
 public ActiveMarkedCard()
 {
     InitializeComponent();
     InitICCard();
     //iLen = Convert.ToInt32(ini.IniReadValue("IcCard", "CardNoLength"));
     CommonMethod.ComboxBind(this.cbxColl, "Sys_Colliery", "CollName", "CollCode", "IsForbid=0", "CollName");
     if (this.cbxColl.Items.Count > 0)
         CommonMethod.ComboxBind(this.cbxCoalKind, "VT_CollRunCoalKind", "CoalKindName", "CoalKindCode", "IsForbid=0 and CollCode='" + this.cbxColl.SelectedValue.ToString() + "'", "CoalKindName");
     //InitICCard();
     //SetActiveCount();
     strBaudRate = ini.IniReadValue("IcCard", "BoudRate");
     strDataBits = ini.IniReadValue("IcCard", "DataBits");
     strStopBits = ini.IniReadValue("IcCard", "StopBits");
     strParity = ini.IniReadValue("IcCard", "Parity");
     strPortName = ini.IniReadValue("IcCard", "PortName");
     commclass = new CoalTraffic.DBUtility.CommClassActiveMC(strBaudRate, strDataBits, strStopBits, strParity, strPortName);
     commclass.OpenCommPort();
     commclass.RecCardCodeTxt = txtMarkedCode;
     commclass.ReciCardCount = txtAdded;
     commclass.alarmSound = alarmSound;
     txtActiveCount.Text = "10";
     //SetActiveCount();
 }