public bool ValidarCasillero(PoBox casillero) { using (CasillerosCRUD crud = new CasillerosCRUD()) { return(crud.ValidarExistenciaCasillero(casillero)); } }
public List <int> VerifyPoBox() { var errors = new List <int>(); if (PoBox == null) { return(errors); } PoBox = PoBox.Trim().Replace(HidroConstants.DOUBLE_SPACE, HidroConstants.WHITE_SPACE); if (string.IsNullOrEmpty(PoBox) || string.IsNullOrWhiteSpace(PoBox)) { PoBox = null; return(errors); } PoBox = PoBox.ToUpper(); var lenTest = new Regex(@".{1,40}"); if (!lenTest.IsMatch(PoBox)) { errors.Add(7); } var rx = new Regex(@"^[\w\d\s-]*$"); if (!rx.IsMatch(PoBox)) { errors.Add(8); } return(errors); }
public bool EditarCasillero(PoBox casillero) { bool result; using (CasillerosCRUD crud = new CasillerosCRUD()) { result = crud.EditarCasillero(casillero); } if (result) { CrearEmailHiloCrear(casillero.Id, casillero.Language); } return(result); }
public int CrearCasillero(PoBox casillero) { int idCasillero = 0; using (CasillerosCRUD crud = new CasillerosCRUD()) { idCasillero = crud.CrearCasillero(casillero); } if (idCasillero > 0) { CrearEmailHiloCrear(idCasillero, casillero.Language); } return(idCasillero); }
public List <string> GetList() { var list = new List <string>(); if (!string.IsNullOrWhiteSpace(AddressLine1)) { list.Add(AddressLine1.TrimI()); } if (!string.IsNullOrWhiteSpace(AddressLine2)) { list.Add(AddressLine2.TrimI()); } if (!string.IsNullOrWhiteSpace(AddressLine3)) { list.Add(AddressLine3.TrimI()); } if (!string.IsNullOrWhiteSpace(City)) { list.Add(City.TrimI()); } if (!string.IsNullOrWhiteSpace(County)) { list.Add(County.TrimI()); } if (!string.IsNullOrWhiteSpace(Country)) { list.Add(Country.TrimI()); } if (!string.IsNullOrWhiteSpace(PostalCode)) { list.Add(PostalCode.TrimI()); } if (!string.IsNullOrWhiteSpace(PoBox)) { list.Add(PoBox.TrimI()); } return(list); }
public List <string> GetList() { var list = new List <string>(); if (!string.IsNullOrWhiteSpace(Address1)) { list.Add(Address1.TrimI()); } if (!string.IsNullOrWhiteSpace(Address2)) { list.Add(Address2.TrimI()); } if (!string.IsNullOrWhiteSpace(Address3)) { list.Add(Address3.TrimI()); } if (!string.IsNullOrWhiteSpace(TownCity)) { list.Add(TownCity.TrimI()); } if (!string.IsNullOrWhiteSpace(County)) { list.Add(County.TrimI()); } if (!string.IsNullOrWhiteSpace(Country)) { list.Add(Country.TrimI()); } if (!string.IsNullOrWhiteSpace(PostCode)) { list.Add(PostCode.TrimI()); } if (!string.IsNullOrWhiteSpace(PoBox)) { list.Add(PoBox.TrimI()); } return(list); }
public void GenerarCorreoCreacionCasillero() { //Consultar casillero PoBox casillero = ConsultarCasillero(this.IdPobox); //Consultar compañia Company compania = ConsultarCompania(); //Consultar plantilla Template plantilla; switch (this.Language) { case "es": plantilla = ConsultasRULE.ObtenerPlantillaCorreo("Crear Casillero Español"); break; case "en": default: plantilla = ConsultasRULE.ObtenerPlantillaCorreo("Crear Casillero Ingles"); break; } //Remplazar if (plantilla != null && casillero != null && compania != null) { try { plantilla.Body = plantilla.Body.Replace("@pais_compania", compania.CountryName); plantilla.Body = plantilla.Body.Replace("@estado_compania", compania.State); plantilla.Body = plantilla.Body.Replace("@ciudad_compania", compania.CityName); plantilla.Body = plantilla.Body.Replace("@zip_compania", compania.Zip); plantilla.Body = plantilla.Body.Replace("@direccion_compania", compania.Address); plantilla.Body = plantilla.Body.Replace("@nombre_compania", compania.Name); plantilla.Body = plantilla.Body.Replace("@nombre_casillero", casillero.Name); plantilla.Body = plantilla.Body.Replace("@numero_casillero", casillero.PoBoxNumber); plantilla.Body = plantilla.Body.Replace("@alias_casillero", casillero.Alias); plantilla.Body = plantilla.Body.Replace("@clave_casillero", casillero.Password); plantilla.Body = plantilla.Body.Replace("@email_casillero", casillero.Email); plantilla.Body = plantilla.Body.Replace("@direccion_casillero", casillero.Address); plantilla.Body = plantilla.Body.Replace("@telefono_casillero", casillero.Phone); plantilla.Body = plantilla.Body.Replace("@empresa_casillero", casillero.Company); plantilla.Body = plantilla.Body.Replace("@ciudad_casillero", casillero.City.Name); plantilla.Body = plantilla.Body.Replace("@zip_casillero", casillero.Zip); plantilla.Body = plantilla.Body.Replace("@pais_casillero", casillero.City.CountryName); plantilla.Subject = plantilla.Subject.Replace("@nombre_casillero", casillero.Name); plantilla.Subject = plantilla.Subject.Replace("@numero_casillero", casillero.PoBoxNumber); plantilla.Subject = plantilla.Subject.Replace("@Alias", casillero.Alias); //Armar objeto coreeo Email mail = Conexion.GetConfigurationEmail(); mail.EmailSubject = plantilla.Subject; mail.EmalBody = plantilla.Body; mail.EmailTo = casillero.Email; Data.Conexion.SendEmail(mail); } catch (Exception ex) { RuleBase.EscribirArchivoError(ex); } } }
public void GenerarCorreoRecordar() { //Consultar casillero PoBox casillero = ConsultarCasillero(this.IdPobox); //Consultar plantilla Template plantilla = new Template(); switch (this.Language) { case "en": plantilla.Body = @" <br>Mr. / Mrs.:<br> @Nombre<br> You have requested your information in our system<br><br> <b>Name: </b>@Nombre<br> <b>Address: </b>@Address<br> <b>City: </b>@City<b> - Zip: </b>@Zip<br> <b>Telephone: </b>@Telephone<br> <b>Email: </b>@Email<br><br> <b>V-POBOX NUMBER: </b>@PoboxNumber<br> <b>Password: </b>@Password<br><br> Please check your information and change it if necessary<br><br> Thanks for choosing us!!! <br><br>"; plantilla.Subject = "Pobox data"; break; case "es": default: plantilla.Body = @" <br>Sr. / Sra.:<br> @Nombre<br> Usted ha solicitado la siguiente información en nuestro sistema<br><br> <b>Nombre: </b>@Nombre<br> <b>Direccion: </b>@Address<br> <b>Cuidad: </b>@City<b> - Zip: </b>@Zip<br> <b>Telefono: </b>@Telephone<br> <b>Email: </b>@Email<br><br> <b>V-POBOX: </b>@PoboxNumber<br> <b>Contraseña: </b>@Password<br><br> Por favor verifique su información y cámbiela de ser necesario.<br><br> Gracias por elegirnos!!! <br><br>"; plantilla.Subject = "Recordatorio Pobox"; break; } //Remplazar if (plantilla != null && casillero != null) { plantilla.Body = plantilla.Body.Replace("@Nombre", casillero.Name); plantilla.Body = plantilla.Body.Replace("@Address", casillero.Address); plantilla.Body = plantilla.Body.Replace("@City", casillero.City.Name.Trim()); plantilla.Body = plantilla.Body.Replace("@Zip", casillero.Zip.Trim()); plantilla.Body = plantilla.Body.Replace("@Telephone", casillero.Phone); plantilla.Body = plantilla.Body.Replace("@Email", casillero.Email); plantilla.Body = plantilla.Body.Replace("@PoboxNumber", casillero.PoBoxNumber); plantilla.Body = plantilla.Body.Replace("@Password", casillero.Password); //Armar objeto coreeo Email mail = Conexion.GetConfigurationEmail(); mail.EmailSubject = plantilla.Subject; mail.EmalBody = plantilla.Body; mail.EmailTo = casillero.Email; try { Data.Conexion.SendEmail(mail); } catch (Exception ex) { RuleBase.EscribirArchivoError(ex); } } }
public override bool Equals(object obj) { if (obj is OrganisationAddress) { obj = Create((OrganisationAddress)obj); } var address = obj as AddressModel; if (address == null) { return(false); } if (obj is OrganisationAddress) { } if ((!string.IsNullOrWhiteSpace(Address1) || !string.IsNullOrWhiteSpace(address.Address1)) && Address1?.Trim() != address.Address1?.Trim()) { return(false); } if ((!string.IsNullOrWhiteSpace(Address2) || !string.IsNullOrWhiteSpace(address.Address2)) && Address2?.Trim() != address.Address2?.Trim()) { return(false); } if ((!string.IsNullOrWhiteSpace(Address3) || !string.IsNullOrWhiteSpace(address.Address3)) && Address3?.Trim() != address.Address3?.Trim()) { return(false); } if ((!string.IsNullOrWhiteSpace(City) || !string.IsNullOrWhiteSpace(address.City)) && City?.Trim() != address.City?.Trim()) { return(false); } if ((!string.IsNullOrWhiteSpace(County) || !string.IsNullOrWhiteSpace(address.County)) && County?.Trim() != address.County?.Trim()) { return(false); } if ((!string.IsNullOrWhiteSpace(Country) || !string.IsNullOrWhiteSpace(address.Country)) && Country?.Trim() != address.Country?.Trim()) { return(false); } if ((!string.IsNullOrWhiteSpace(PostCode) || !string.IsNullOrWhiteSpace(address.PostCode)) && PostCode?.Trim() != address.PostCode?.Trim()) { return(false); } if ((!string.IsNullOrWhiteSpace(PoBox) || !string.IsNullOrWhiteSpace(address.PoBox)) && PoBox?.Trim() != address.PoBox?.Trim()) { return(false); } return(true); }