Ejemplo n.º 1
0
        private void checkDB(int EnrolNo)
        {
            using (MySqlConnection conn = new MySqlConnection("Persist Security Info=False;server=localhost;database=test;uid=root;password="******"CALL checkLog(@NO)";
                        cmd.Parameters.AddWithValue("@NO", EnrolNo);
                        //cmd.ExecuteNonQuery();
                        MySqlDataReader reader = cmd.ExecuteReader();

                        while (reader.Read())
                        {
                            if (reader.GetInt32(0) != 1)
                            {
                                if (reader.GetString(3) == "Y")
                                {
                                    btnStatus.Visible   = true;
                                    btnStatus.Text      = "CHARGABLE";
                                    btnStatus.BackColor = Color.Red;
                                }
                                else
                                {
                                    btnStatus.Visible   = true;
                                    btnStatus.Text      = "NOT CHARGABLE";
                                    btnStatus.BackColor = Color.Green;
                                }

                                lblName.Text = reader.GetString(2);
                                lblNIC.Text  = reader.GetString(1);
                                lblPrev.Text = reader.GetString(4);
                                List2.Invoke(t => t.Items.Insert(0, "Checking : " + reader.GetString(2)));
                            }
                            else
                            {
                                MessageBox.Show("Invalid Card!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            }
                        }
                    }
                    catch (Exception err)
                    {
                        MessageBox.Show(err.Message);
                    }
                    finally
                    {
                        conn.Close();
                        ClearLog();
                    }
                }
            }
        }
Ejemplo n.º 2
0
 private void ClearLog()
 {
     if (axBioBridgeSDKv3lib1.DeleteGeneralLog() == 0)
     {
         List2.Invoke(t => t.Items.Insert(0, "All Logs Cleared"));
     }
     else
     {
         List2.Invoke(t => t.Items.Insert(0, "Unable to Clear"));
     }
 }
Ejemplo n.º 3
0
        private void start()
        {
            // get log
            int yr          = 0;
            int mth         = 0;
            int day_Renamed = 0;
            int hr          = 0;
            int min         = 0;
            int sec         = 0;

            int enrollNo = 0;
            int ver      = 0;
            int io       = 0;
            int work     = 0;
            int log      = 0;


            axBioBridgeSDKv3lib1.SetLastCount(0);


            if (axBioBridgeSDKv3lib1.ReadGeneralLog(ref log) == 0)
            {
                do
                {
                    // list.Add(Convert.ToInt32(enrollNo));
                    if (Convert.ToInt32(enrollNo) != 0)
                    {
                        lblName.Text      = "---------";
                        lblNIC.Text       = "---------";
                        lblPrev.Text      = "---------";
                        btnStatus.Visible = false;
                        checkDB(Convert.ToInt32(enrollNo));
                    }

                    //  Console.WriteLine("FOUND -- " + Convert.ToInt32(enrollNo));
                    //List2.Invoke(t => t.Items.Add(("No: " + Convert.ToString(enrollNo) + " Date:" + Convert.ToString(day_Renamed))));
                    //  List1.Items.Add(("No: " + Convert.ToString(enrollNo) + " Date:" + Convert.ToString(day_Renamed) + "/" + Convert.ToString(mth) + "/" + Convert.ToString(yr) + " Time: " + Convert.ToString(hr) + ":" + Convert.ToString(min) + ":" + Convert.ToString(sec) + " Verify: " + Convert.ToString(ver) + " I/O: " + Convert.ToString(io) + " Work Code: " + Convert.ToString(work)));
                } while (axBioBridgeSDKv3lib1.GetGeneralLog(ref enrollNo, ref yr, ref mth, ref day_Renamed, ref hr, ref min, ref sec, ref ver, ref io, ref work) == 0);
            }
            else
            {
                List2.Invoke(t => t.Items.Insert(0, "No New Records.."));
            }
        }