Exemplo n.º 1
0
        public static VaaaN.MLFF.Libraries.CommonLibrary.CBE.UserCBE ValidateUser(string loginName, string password)
        {
            try
            {
                byte[] saltBytes;

                // Allocate a byte array, which will hold the salt.
                saltBytes = new byte[8];

                string    tempPw  = VaaaN.MLFF.Libraries.CommonLibrary.Cryptography.Encryption.ComputeHash(password);
                string    spName  = Constants.oraclePackagePrefix + "USER_VALIDATEUSER";
                DbCommand command = VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.GetStoredProcCommand(spName);
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "p_login_name", DbType.String, loginName, ParameterDirection.Input, 100));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_PASSWORD", DbType.String, tempPw, ParameterDirection.Input, 500));

                VaaaN.MLFF.Libraries.CommonLibrary.CBE.UserCollection users = ConvertDataTableToCollection(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.LoadDataSet(command, tableName).Tables[tableName]);

                if (users.Count > 0)
                {
                    return(users[0]);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                VaaaN.MLFF.Libraries.CommonLibrary.Logger.Log.WriteGeneralLog(ex.Message.ToString());
                return(null);
            }
        }
Exemplo n.º 2
0
        public static VaaaN.MLFF.Libraries.CommonLibrary.CBE.UserCBE GetUserByEmailId(string email_id)
        {
            try
            {
                string    spName  = Constants.oraclePackagePrefix + "GetUserByEmailId";
                DbCommand command = VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.GetStoredProcCommand(spName);
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "p_email_id", DbType.String, email_id, ParameterDirection.Input, 100));

                VaaaN.MLFF.Libraries.CommonLibrary.CBE.UserCollection users = ConvertDataTableToCollection(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.LoadDataSet(command, tableName).Tables[tableName]);

                if (users.Count > 0)
                {
                    return(users[0]);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 3
0
        private bool VerifyFingerPrint()
        {
            bool result = false;

            try
            {
                VaaaN.MLFF.Libraries.CommonLibrary.CBE.UserCollection users = VaaaN.MLFF.Libraries.CommonLibrary.DAL.LoginDAL.GetUserByLoginName(textBoxUserName.Text.Trim());

                if (users.Count == 0)
                {
                }
                else
                {
                    foreach (CBE.UserCBE user in users)
                    {
                        //uint ret;
                        //NBioAPI.Type.FIR_PAYLOAD myPayload = new NBioAPI.Type.FIR_PAYLOAD();
                        //NBioAPI.Type.FIR_TEXTENCODE t = new NBioAPI.Type.FIR_TEXTENCODE();
                        //if (user.FingerPrint1 == "")
                        //{
                        //    VaaaN.TollMax.Library.CustomMessageBox.Show("Finger Print is not enrolled for this user. ", hrm.GetString("CMN_LBL_Error"), MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK);
                        //}
                        //else
                        //{
                        //    t.TextFIR = user.FingerPrint1;
                        //}

                        //t.IsWideChar = true;
                        //m_BioAPI = new BioAPI();
                        //uint nNumDevice;
                        //short[] nDeviceID;
                        //NBioAPI.Type.DEVICE_INFO_EX[] deviceInfoEx;
                        //ret = m_BioAPI.EnumerateDevice(out nNumDevice, out nDeviceID, out deviceInfoEx);
                        ////Get Device Id
                        //if (ret == BioAPI.Error.NONE)
                        //{
                        //    DeviceID = NBioAPI.Type.DEVICE_ID.AUTO;
                        //}
                        ////Initialize the device
                        //ret = m_BioAPI.OpenDevice(DeviceID);
                        //if (ret != BioAPI.Error.NONE)
                        //{
                        //    VaaaN.TollMax.Library.CustomMessageBox.Show("Biometric device is not connected.", hrm.GetString("CMN_LBL_Error"), MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK);
                        //    return result;
                        //}

                        //ret = m_BioAPI.Verify(t, out result, myPayload);	// Verify with text encoded FIR

                        ////Close the device
                        //ret = m_BioAPI.CloseDevice(DeviceID);

                        //if (ret != NBioAPI.Error.NONE)
                        //{
                        //    return result = false;
                        //}
                        //else
                        //{
                        //    currentUser = user;
                        //    break;

                        //}
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            return(result);
        }