//void FPReg_FPRegistrationStatus(RegistrationStatus Status) //{ // if (Status == FlexCodeSDK.RegistrationStatus.r_OK) // { // btn_verify.IsEnabled = true; // } //} //private void FpVer_FPVerificationStatus(VerificationStatus Status) //{ // if (Status == FlexCodeSDK.VerificationStatus.v_OK) // { // MessageBox.Show("This finger already registered as ID: " + EmpID + " and Finger Index:" + (FpIndex) + "\nPlease register other finger"); // btn_save.IsEnabled = false; // btn_start.IsEnabled = true; // } // else if (Status == FlexCodeSDK.VerificationStatus.v_NotMatch || Status == FlexCodeSDK.VerificationStatus.v_FPListEmpty) // { // MessageBox.Show ("Your finger is unique! Now you can save the template to database."); // ItIsUniqueTemplate = true; // } // else if (Status == FlexCodeSDK.VerificationStatus.v_VerifyCaptureFingerTouch) // { // MessageBox.Show("\nFinger touch !"); // } // else // { // MessageBox.Show(Status.ToString()); // } //} //private void FpVer_FPVerificationID(String ID,FingerNumber FingerNr) //{ // EmpID = ID; // FpIndex = (byte)FingerNr; //} //private void FPReg_FPRegistrationImage() //{ // System.IO.FileStream imgFile = new System.IO.FileStream(System.IO.Directory.GetCurrentDirectory() + "\\FPTemp.BMP",System.IO.FileMode.Open,System.IO.FileAccess.Read,System.IO.FileShare.ReadWrite); // Byte[] fileBytes = new Byte[imgFile.Length]; // imgFile.Read(fileBytes, 0, fileBytes.Length); // imgFile.Close(); // System.IO.MemoryStream[] ms = new System.IO.MemoryStream[fileBytes.Length]; // // image1.Source = System.Drawing.Image.FromStream(ms); //} private void btn_start_Click(object sender, RoutedEventArgs e) { id_gen id = new id_gen(); c = id._trial().ToString(); //FPReg = new FlexCodeSDK.FinFPReg(); //FPReg.AddDeviceInfo("C700F001339", "1SX-J98-067-81L-40X", "EAA0675F-3AC1-F649-8F07-A46D58C5ED6D"); //FPReg.FPRegistrationStart("YourSecretKey" + c); //FPReg.PictureSamplePath = System.IO.Directory.GetCurrentDirectory() + "\\FPTemp.BMP"; //FPReg.PictureSampleHeight = (short)image1.Height; //FPReg.PictureSampleWidth = (short)image1.Width; //ItIsUniqueTemplate = false; }
/// <summary> /// Handles our convict registration via the _reg_convict function in _my_sql_db.cs /// </summary> /// <param name="sender"></param> /// <param name="args"></param> void enroller(object sender, RoutedEventArgs args) { if (txt_prison_name.Text != null && txt_con_name.Text != null) { _my_sql_db db = new _my_sql_db(); id_gen io = new id_gen(); _app_brain ap = new _app_brain(); System.Drawing.Image _i = System.Drawing.Image.FromFile(System.Windows.Forms.Application.StartupPath + "\\temp_data\\in_use.jpg"); db._verify_db_exists(); db.id = io._trial().ToString(); db.convict_name = txt_con_name.Text; db.dob = txt_dob.Text; db.home_address = txt_home_add.Text; db.city = txt_city.Text; db.mobile = txt_mobile.Text; db.gender = cbo_gender.Text; db.marital = cbo_marital.Text; db.state = cbostate.Text; db.lga = cbolga.Text; db.home_town = txt_hometown.Text; db.template = "0000SJIDDIAADHFSJKK99793FUU"; db.findex = "4"; db.picture = ap._to_string(_i); db.crime_type = txt_crime_type.Text; db.date_of_crime = txt_date_of_crime.Text; db.crime_location = txt_crime_loca.Text; db.prison_name = txt_prison_name.Text; db.prison_number = txt_prison_number.Text; db.jail_term = txt_jail_term.Text; db.crime_details = txt_details.Text; db.next_of_kin_name = txt_next_kin_name.Text; db.kin_phone = txt_kin_phone.Text; db.relationship = txt_relationship.Text; db.kin_address = txt_kin_address.Text; bool v = db._reg_convict(); if (v == true) { //System.Windows.MessageBox.Show("Convict successfully added !!!", "Enroll Convict"); pop_up pop = new pop_up(); pop.lbl_title.Content = "Enroll Convict"; pop.lbl_msg.Text = "\nCoonvict successfully added !!!"; pop.ShowDialog(); txt_con_name.Text = ""; txt_dob.Text = ""; txt_home_add.Text = ""; txt_city.Text = ""; txt_mobile.Text = ""; cbo_gender.SelectedIndex = -1; cbo_marital.SelectedIndex = -1; txt_relationship.SelectedIndex = -1; cbolga.SelectedIndex = -1; cbostate.SelectedIndex = -1; cbolga.SelectedIndex = -1; txt_hometown.Text = ""; inmate_image.Source = null; inmate_bio.Source = null; txt_crime_type.Text = ""; txt_date_of_crime.Text = ""; txt_crime_loca.Text = ""; txt_prison_name.Text = ""; txt_prison_number.Text = ""; txt_jail_term.Text = ""; txt_details.Text = ""; txt_next_kin_name.Text = ""; txt_kin_phone.Text = ""; txt_relationship.Text = ""; txt_kin_address.Text = ""; //clear fields } else { //do nothing for now, coz there was an error } db._load_db(); } else { System.Windows.Forms.MessageBox.Show("Please fill in the blanks ...", "Error"); } }