public DynamicParameters MapDyParasValidateAuthentication(PartnerKeyDetailsDAO partnerKeyDetailsDAO) { DynamicParameters dynamicParameters = new DynamicParameters(); dynamicParameters.Add("@partnerusername", partnerKeyDetailsDAO.username, DbType.String); dynamicParameters.Add("@partnerpassword", partnerKeyDetailsDAO.password, DbType.String); dynamicParameters.Add("@partneridkey", partnerKeyDetailsDAO.partnerkey, DbType.String); return(dynamicParameters); }
public List <PartnerKeyDetailsDAO> GetPartnerDetail(PartnerKeyDetailsDAO partnerKeyDetailsDAO) { List <PartnerKeyDetailsDAO> partnerKeyDetails; using (IDbConnection dbConnection = new NpgsqlConnection(configuration.GetConnectionString(ColdFishServiceOpenApiConstants.ConnectionStringDefaultConnection))) { dbConnection.Open(); DynamicParameters dynamicParameters = authenticationServiceRepositoryMapper.MapDyParasValidateAuthentication(partnerKeyDetailsDAO); partnerKeyDetails = dbConnection.Query <PartnerKeyDetailsDAO>(AuthenticationServiceConstants.GetPartnerDetailFunName, dynamicParameters, commandType: CommandType.StoredProcedure).ToList(); } return(partnerKeyDetails); }
public ResultMessageEntity IsPartnerValid(AuthenticationReqMsgEntity authenticationReqMsgEntity) { PartnerKeyDetailsDAO partnerKeyDetailsDAO = authenticationServiceMapper.MapPartnerKeyDetailsDAO(authenticationReqMsgEntity); List <PartnerKeyDetailsDAO> validPartnerKeyDetailsDAO = authenticationServiceRepository.GetPartnerDetail(partnerKeyDetailsDAO); if (!validPartnerKeyDetailsDAO.AnyWithNullCheck()) { return(ColdFishServiceOpenApiUtility.GetResultMessageEntity(ResultStatus.Fail, "Partner is Invalid", authenticationServiceErrorCodes.PartnerNotFound)); } if (validPartnerKeyDetailsDAO.Count > 1) { return(ColdFishServiceOpenApiUtility.GetResultMessageEntity(ResultStatus.Fail, "To Many partners", authenticationServiceErrorCodes.PartnerNotFound)); } return(new ResultMessageEntity { ResultStatus = ResultStatus.Success }); }