public RequestHelper(HttpListenerRequest request, Label label, Taurus.FingerReadData.ProcessReadData prog, KQTextFormatInfo textFormat) { this.request = request; this.label = label; this.prog = prog; this.textFormat = textFormat; }
public void Setup(int port, Taurus.FingerReadData.ProcessReadData prog, Label label, KQTextFormatInfo textFormat) { try { this.label = label; this.prog = prog; this.textFormat = textFormat; if (port == 0) { stop = true; httpListener.Close(); return; } stop = false; httpListener.AuthenticationSchemes = AuthenticationSchemes.Anonymous; httpListener.Prefixes.Add(string.Format("http://*:{0}/", port)); httpListener.Start(); Receive(); } catch { } }
private void LoadTextFormat() { DataTableReader dr = null; try { dr = SystemInfo.db.GetDataReader(Pub.GetSQL(DBCode.DB_000001, new string[] { "15", KQTextFormatInfo.KQ_ConfigID, KQTextFormatInfo.KQ_TextFormat })); if (dr.Read()) { textFormat = new KQTextFormatInfo(dr["Value"].ToString()); } } catch (Exception E) { Pub.ShowErrorMsg(E); } finally { if (dr != null) { dr.Close(); } dr = null; } chkAllow.Checked = textFormat.Allow; rbSepNo.Checked = textFormat.SepFlag == 0; rbSepTAB.Checked = textFormat.SepFlag == 1; rbSepCustom.Checked = textFormat.SepFlag == 2; if (!rbSepNo.Checked && rbSepTAB.Checked && rbSepCustom.Checked) { rbSepNo.Checked = true; } txtSep.Text = textFormat.SepStr; chkMacSN.Checked = textFormat.MacSNAllow; txtMacSN.Text = textFormat.MacSNLen.ToString(); txtMacSN.Tag = textFormat.MacSNOrder; chkEmpNo.Checked = textFormat.EmpNoAllow; txtEmpNo.Text = textFormat.EmpNoLen.ToString(); txtEmpNo.Tag = textFormat.EmpNoOrder; chkEmpName.Checked = textFormat.EmpNameAllow; txtEmpName.Text = textFormat.EmpNameLen.ToString(); txtEmpName.Tag = textFormat.EmpNameOrder; chkCardNo.Checked = textFormat.CardNoAllow; txtCardNo.Text = textFormat.CardNoLen.ToString(); txtCardNo.Tag = textFormat.CardNoOrder; chkDataTime.Checked = textFormat.DataTimeAllow; txtDataTime.Text = textFormat.DataTimeFormat; txtDataTime.Tag = textFormat.DataTimeOrder; chkOrder.Items.Clear(); if (textFormat.EmpNoOrder == 0) { chkOrder.Items.Add(chkEmpNo.Text); } else if (textFormat.EmpNameOrder == 0) { chkOrder.Items.Add(chkEmpName.Text); } else if (textFormat.CardNoOrder == 0) { chkOrder.Items.Add(chkCardNo.Text); } else if (textFormat.DataTimeOrder == 0) { chkOrder.Items.Add(chkDataTime.Text); } else { chkOrder.Items.Add(chkMacSN.Text); } if (textFormat.MacSNOrder == 1) { chkOrder.Items.Add(chkMacSN.Text); } else if (textFormat.EmpNoOrder == 1) { chkOrder.Items.Add(chkEmpNo.Text); } else if (textFormat.EmpNameOrder == 1) { chkOrder.Items.Add(chkEmpName.Text); } else if (textFormat.CardNoOrder == 1) { chkOrder.Items.Add(chkCardNo.Text); } else if (textFormat.DataTimeOrder == 1) { chkOrder.Items.Add(chkDataTime.Text); } if (textFormat.MacSNOrder == 2) { chkOrder.Items.Add(chkMacSN.Text); } else if (textFormat.EmpNoOrder == 2) { chkOrder.Items.Add(chkEmpNo.Text); } else if (textFormat.EmpNameOrder == 2) { chkOrder.Items.Add(chkEmpName.Text); } else if (textFormat.CardNoOrder == 2) { chkOrder.Items.Add(chkCardNo.Text); } else if (textFormat.DataTimeOrder == 2) { chkOrder.Items.Add(chkDataTime.Text); } if (textFormat.MacSNOrder == 3) { chkOrder.Items.Add(chkMacSN.Text); } else if (textFormat.EmpNoOrder == 3) { chkOrder.Items.Add(chkEmpNo.Text); } else if (textFormat.EmpNameOrder == 3) { chkOrder.Items.Add(chkEmpName.Text); } else if (textFormat.CardNoOrder == 3) { chkOrder.Items.Add(chkCardNo.Text); } else if (textFormat.DataTimeOrder == 3) { chkOrder.Items.Add(chkDataTime.Text); } if (textFormat.MacSNOrder == 4) { chkOrder.Items.Add(chkMacSN.Text); } else if (textFormat.EmpNoOrder == 4) { chkOrder.Items.Add(chkEmpNo.Text); } else if (textFormat.EmpNameOrder == 4) { chkOrder.Items.Add(chkEmpName.Text); } else if (textFormat.CardNoOrder == 4) { chkOrder.Items.Add(chkCardNo.Text); } else if (textFormat.DataTimeOrder == 4) { chkOrder.Items.Add(chkDataTime.Text); } }
private void btnShowFormat_Click(object sender, EventArgs e) { textFormat = new KQTextFormatInfo(GetFieldsString()); txtFormat.Text = textFormat.GetKQFormatText("1", "E0001", "ZhangSan", "1", DateTime.Now); }