/// <summary> /// Busca si existe el DK /// </summary> /// private Boolean ExistLocationInformation() { string location = txtDK.Text; WsMyCTS wsServ = new WsMyCTS(); MyCTS.Services.ValidateDKsAndCreditCards.Cat1stStarInfoByLocation star1InfoByLocation = null; MyCTS.Services.ValidateDKsAndCreditCards.Cat1stStarInfoByLocation star1InfoByLocation1 = null; //OracleConnection GetProfile = new OracleConnection(); //MyCTS.Services.MyCTSOracleConnection.Cat1stStarInfoByLocation star1InfoByLocation = null; //MyCTS.Services.MyCTSOracleConnectionDev.Cat1stStarInfoByLocation star1InfoByLocation1 = null; try { star1InfoByLocation = wsServ.Get1stStarInfoByLocation(location); return(true); } catch { star1InfoByLocation = wsServ.Get1stStarInfoByLocation(location); return(true); } return(false); }
/// <summary> /// Carga informacion a la mascarilla por Location si falla el metodo principal /// </summary> private Boolean ExistLoadLocationInfoBackup() { string location = txtDK.Text; WsMyCTS wsServ = new WsMyCTS(); MyCTS.Services.ValidateDKsAndCreditCards.Cat1stStarInfoByLocation starFirstInfoByLocation; starFirstInfoByLocation = wsServ.Get1stStarInfoByLocation(location); //MyCTS.Entities.Cat1stStarInfoByLocation starFirstInfoByLocation = Cat1stStarInfoByLocationBL.Get1stStarInfoByLocation(location); if (starFirstInfoByLocation != null) { if (!string.IsNullOrEmpty(starFirstInfoByLocation.CustomerName)) { string customer = starFirstInfoByLocation.CustomerName.ToString(); customer = customer.Replace("(", ""); customer = customer.Replace(")", ""); txtEnterpriseName.Text = customer; txtSocialReason.Text = customer; } if (!string.IsNullOrEmpty(starFirstInfoByLocation.MainPhone) && !starFirstInfoByLocation.MainPhone.Equals("()")) { string phone = starFirstInfoByLocation.MainPhone.Trim(new char[] { '(', ')' }); phone = phone.TrimEnd(); phone = phone.TrimStart(); txtPhone.Text = phone; } if (!string.IsNullOrEmpty(starFirstInfoByLocation.Address1)) { txtStreet.Text = starFirstInfoByLocation.Address1; } if (!string.IsNullOrEmpty(starFirstInfoByLocation.Address2)) { starFirstInfoByLocation.Address2 = starFirstInfoByLocation.Address2.Replace("#", ""); starFirstInfoByLocation.Address2 = starFirstInfoByLocation.Address2.TrimStart(); txtNumberExt.Text = starFirstInfoByLocation.Address2; } if (!string.IsNullOrEmpty(starFirstInfoByLocation.Address3)) { starFirstInfoByLocation.Address3 = starFirstInfoByLocation.Address3.Replace("#", ""); starFirstInfoByLocation.Address3 = starFirstInfoByLocation.Address3.TrimStart(); txtNumberInt.Text = starFirstInfoByLocation.Address3; } if (!string.IsNullOrEmpty(starFirstInfoByLocation.Address4)) { txtColony.Text = starFirstInfoByLocation.Address4; } if (!string.IsNullOrEmpty(starFirstInfoByLocation.Municipality)) { txtDelorMunicipality.Text = starFirstInfoByLocation.Municipality; } if (!string.IsNullOrEmpty(starFirstInfoByLocation.PostalCode)) { txtPostalCode.Text = starFirstInfoByLocation.PostalCode; } if (!string.IsNullOrEmpty(starFirstInfoByLocation.City)) { txtCity.Text = starFirstInfoByLocation.City; } if (!string.IsNullOrEmpty(starFirstInfoByLocation.State)) { txtState.Text = starFirstInfoByLocation.State; } if (!string.IsNullOrEmpty(starFirstInfoByLocation.RFC)) { bool IsRFC = ValidateRegularExpression.ValidateRFCFormat(starFirstInfoByLocation.RFC); if (IsRFC) { if (starFirstInfoByLocation.RFC.Length.Equals(13)) { txtRFC1.Text = starFirstInfoByLocation.RFC.Substring(0, 4); txtRFC2.Text = starFirstInfoByLocation.RFC.Substring(4, 6); txtRFC3.Text = starFirstInfoByLocation.RFC.Substring(10, 3); } else if (starFirstInfoByLocation.RFC.Length.Equals(12)) { txtRFC1.Text = starFirstInfoByLocation.RFC.Substring(0, 3); txtRFC2.Text = starFirstInfoByLocation.RFC.Substring(3, 6); txtRFC3.Text = starFirstInfoByLocation.RFC.Substring(9, 3); } } } return(true); } else { MessageBox.Show("El DK ingresado no existe", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } }