Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            MODEL.Result r = new MODEL.Result()
            {
                Success = false,
                Message = ""
            };

            r            = BAL.CheckBarcode.CheckBarcodeForEntry("TEOMAN3", api);
            rtbLog.Text += DateTime.Now.ToLongTimeString() + " : " + r.Success.ToString() + ">" + r.Message + Environment.NewLine;
            if (r.Success)
            {
                GirisRoleAc(null);
            }
            else
            {
                rtbLog.Text      += r.Message;
                lblLastError.Text = DateTime.Now.ToShortTimeString() + ":" + r.Message;
            }
        }
Exemplo n.º 2
0
        private MODEL.Result CheckBarcodeForEntrance(SerialPort sp, Turnstile t)
        {
            MODEL.Result r = new MODEL.Result()
            {
                Success = false,
                Message = ""
            };

            if (sp.BytesToRead > 0)
            {
                var okunan = sp.ReadExisting();
                rtbLog.Text += okunan;

                var okunan2    = okunan.Replace("\r", ",");
                var okunanlist = okunan2.Split(',');

                r            = BAL.CheckBarcode.CheckBarcodeForEntry(okunanlist[0], api);
                rtbLog.Text += DateTime.Now.ToLongTimeString() + " : " + r.Success.ToString() + ">" + r.Message + Environment.NewLine;
                if (r.Success)
                {
                    GirisRoleAc(t);
                }
                else
                {
                    rtbLog.Text      += r.Message;
                    lblLastError.Text = DateTime.Now.ToShortTimeString() + ":" + r.Message;
                }
                //giriş turnike aç
                //if (okunan.Contains("1234567890123"))
                //    GirisRoleAc(t);
                //else
                //    CikisRoleAc(t);

                return(r);
            }
            else
            {
                return(r);
            }
        }
Exemplo n.º 3
0
 private void timer2_Tick(object sender, EventArgs e)
 {
     MODEL.Result r = CheckBarcodeForEntrance(serialPort2, turnstiles[1]);
 }