public static Employee GetInfo(OracleDataReader reader, DPFP.Sample Sample, string Finger) { OracleConnection conn = new OracleConnection(ConStr); Employee _info = null; DPFP.Template _template = null; bool IsFound = false; if (reader[Finger] != DBNull.Value) { _template = Util.ProcessDBTemplate((byte[])reader[Finger]); IsFound = Util.Verify(Sample, _template); } if (IsFound == true) { string sqlEmp = "select * from employees where Empl_Id_No=" + reader["Empl_Id_No"]; OracleCommand cmd = new OracleCommand(sqlEmp, conn); cmd.CommandType = CommandType.Text; conn.Open(); OracleDataReader odr = cmd.ExecuteReader(); if (odr.HasRows) { _info = new Employee(); _info.Empl_Id_No = Convert.ToInt32(reader["Empl_Id_No"]); _info.Empl_Name = (string)odr["Empl_Name"]; _info.Empl_Deptname = (string)odr["Empl_Deptname"]; _info.Shift_Id = Convert.ToInt32(odr["Shift_Id"]); } odr.Dispose(); cmd.Dispose(); conn.Close(); conn.Dispose(); } return _info; }
public static Employee VerifyBiometricsData(int FingNo, DPFP.Sample Sample) { OracleConnection conn = new OracleConnection(ConStr); Employee _info = new Employee(); try { string _result = string.Empty; string _Finger = Util.GetFingerDesc(FingNo); DPFP.Template _template = null; string sql = string.Format("select Empl_Id_No, {0} from EMPTSI", _Finger); ; OracleCommand command = new OracleCommand(sql, conn); command.CommandType = CommandType.Text; conn.Open(); OracleDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection); bool IsFound = false; if (reader.HasRows) { while (reader.Read()) { if (reader[0] != DBNull.Value) { _template = Util.ProcessDBTemplate((byte[])reader[_Finger]); IsFound = Util.Verify(Sample, _template); } if (IsFound == true) { string sqlEmp = "select * from employees where Empl_Id_No=" + reader["Empl_Id_No"]; OracleCommand cmd2 = new OracleCommand(sqlEmp, conn); cmd2.CommandType = CommandType.Text; OracleDataReader reader2 = cmd2.ExecuteReader(CommandBehavior.CloseConnection); if (reader2.HasRows) { _info.Empl_Id_No = Convert.ToInt32(reader["Empl_Id_No"]); _info.Empl_Name = (string)reader2["Empl_Name"]; _info.Empl_Deptname = (string)reader2["Empl_Deptname"]; _info.Shift_Id = Convert.ToInt32(reader2["Shift_Id"]); } reader2.Dispose(); reader.Dispose(); cmd2.Dispose(); command.Dispose(); break; } } } if (conn.State == ConnectionState.Open) conn.Close(); return _info; } catch (Exception ex) { throw ex; } }
private static void AddInfo(List<Employee> list, Employee info) { if (info != null) { bool isFound=false; foreach(Employee i in list){ if (i.Empl_Id_No == info.Empl_Id_No) { isFound = true; break; } } if (isFound == false) { list.Add(info); } } }
public bool Insert(Employee info) { OracleConnection conn = new OracleConnection(ConStr); OracleCommand command = new OracleCommand("Employees_Update", conn); try { command.CommandType = CommandType.StoredProcedure; //command.Parameters.AddWithValue("@param1", info.field1); //RowsAffected = command.ExecuteNonQuery(); conn.Close(); return true; } catch (Exception ex) { throw ex; } }
private void ProcessProfile(Employee info) { try { this.ClientAction = ""; string _ClientRequestCode = string.Empty; System.Diagnostics.Process p = new System.Diagnostics.Process(); //dcUser _dc = new dcUser(); //zsi.Framework.Security.Cryptography _crypt = new zsi.Framework.Security.Cryptography(); this.Invoke(new Function(delegate() { if(this.cbVerificationPurpose.SelectedItem!=null) this.ClientAction = this.cbVerificationPurpose.SelectedItem.ToString().ToLower(); })); switch (this.ClientAction) { case "user login": //ClientSettings.UserInfo = _dc.GetUserInfo(info.ProfileId); /*ClientSettings.UserInfo = new User(); ClientSettings.UserInfo.UserId = info.UserId; ClientSettings.UserInfo.WSMacAddress = "add"; if (ClientSettings.UserInfo.UserId != 0) { this.Invoke(new Function(delegate() { // this.ParentForm.EnableControls(true); this._ParentForm.CheckPermission(true); this.Close(); })); } else { MessageBox.Show("User not login."); } */ break; default: MessageBox.Show("Finger identified: (" + info.Empl_Id_No + ") - " + info.Empl_Name); break; } return; } catch (Exception ex) { throw ex; } }