public Login AuthenticateIP(Login inLoginDto) { if (null == inLoginDto) { throw new ArgumentNullException("inLoginDto"); } if (null == inLoginDto.IPAddress) { throw new ArgumentNullException("IPAddress"); } Login outLoginDto = null; try { string[] octets = inLoginDto.IPAddress.Split(new char[] { '.' }); UserIPAddress inUserIPAddressDto = new UserIPAddress(); inUserIPAddressDto.BeginAddress.Octet1 = Convert.ToInt32(octets[0]); inUserIPAddressDto.BeginAddress.Octet2 = Convert.ToInt32(octets[1]); inUserIPAddressDto.BeginAddress.Octet3 = Convert.ToInt32(octets[2]); inUserIPAddressDto.BeginAddress.Octet4 = Convert.ToInt32(octets[3]); UserIPAddressDalc dalc = new UserIPAddressDalc(); UserIPAddress outUserIPAddressDto = dalc.GetUserByIP(inUserIPAddressDto); if (outUserIPAddressDto != null) { UserFacade userFacade = new UserFacade(); User inUserDto = new User(); inUserDto.UserId = outUserIPAddressDto.UserId; User outUserDto = userFacade.GetUser(inUserDto); if (outUserDto != null) { outLoginDto = new Login(); outLoginDto.EmailAddress = outUserDto.EmailAddress; } } } catch (MNException mnEx) { //TODO: Log error throw mnEx; } catch (Exception ex) { //TODO: Log error throw ex; } return(outLoginDto); }