void ValidateUser()
        {
            SqlCommand cmd = new SqlCommand("getFingerPrintCourse", con.ActiveCon());

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@session", session);
            cmd.Parameters.AddWithValue("@semester", semesterId);
            cmd.Parameters.AddWithValue("@course", courseid);

            using (SqlDataReader data = cmd.ExecuteReader())
            {
                var id = "";

                while (data.Read())
                {
                    id = data["MatricNo"].ToString();
                    byte[] fingerPrint = (byte[])data["fingerprint"];

                    byte[] Image = (byte[])data["Image"];
                    verifiedImages.Add(id, Image);

                    Samples.Add(id, new DPFP.Template(new MemoryStream(fingerPrint)));
                }
            }
        }
示例#2
0
        void SaveErrotImage()
        {
            SqlCommand cmd = new SqlCommand("InsertErrorImage", con.ActiveCon());

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@name", txtName.Text);
            cmd.Parameters.AddWithValue("@basestring", Image);

            cmd.ExecuteNonQuery();
        }
示例#3
0
 public String AddtoDatabase()
 {
     try
     {
         Connection     con = new Connection();
         SqlDataAdapter sda = new SqlDataAdapter("INSERT INTO AUTH VALUES('" + name + "','" + password + "','" + department + "','" + email + "','" + mobile + "','" + nic + "','" + index + "','" + address + "')", con.ActiveCon());
         DataTable      dt  = new DataTable();
         sda.Fill(dt);
         return("Success");
     }
     catch (Exception ex)
     {
         return(ex.Message.ToString());
     }
 }
示例#4
0
        private void loginButton_Click(object sender, EventArgs e)
        {
            Connection       con = new Connection();
            MySqlDataAdapter sda = new MySqlDataAdapter("Select * From Profile_Master Where Pro_User_Id='" + usernameTextbox.Text + "' and Pro_Password='******'", con.ActiveCon());
            DataTable        dt  = new DataTable();

            sda.Fill(dt);

            if (1 == dt.Rows.Count)
            {
                LMS objLMS = new LMS();
                objLMS.Show();
                Hide();
            }
            else
            {
                MessageBox.Show("Invalid username or password", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }