Ejemplo n.º 1
0
		public int SaveValidationAddress(ValidationAddress address)
		{
			using (var dc = new EngageCCTDataClassesDataContext())
			{
				T_ValidationAddressError tError = new T_ValidationAddressError();
				if (address.Error != null)
				{
					tError.erDesc = address.Error.Description;
					tError.erLocation = address.Error.Location;
					tError.erNumber = address.Error.Number;
					dc.T_ValidationAddressErrors.InsertOnSubmit(tError);
					dc.SubmitChanges();
				}
				T_ValidationAddress tAddress = new T_ValidationAddress();
				if (!string.IsNullOrEmpty(address.Address))
				{
					tAddress.vadAddress = address.Address;
				}
				if (!string.IsNullOrEmpty(address.City))
				{
					tAddress.vadCity = address.City;
				}
				if (!string.IsNullOrEmpty(address.Country))
				{
					tAddress.vadCountry = address.Country;
				}
				if (!string.IsNullOrEmpty(address.State))
				{
					tAddress.vadState = address.State;
				}
				if (!string.IsNullOrEmpty(address.ZipCode))
				{
					tAddress.vadZipCode = address.ZipCode;
				}
				if (address.Error != null)
				{
					tAddress.ErrorID = tError.ErrorID;
				}
				dc.T_ValidationAddresses.InsertOnSubmit(tAddress);
				dc.SubmitChanges();
				return tAddress.AddressID;
			}
		}
Ejemplo n.º 2
0
		public int SaveValidationAddressError(ValidationAddressError error)
		{
			using (var dc = new EngageCCTDataClassesDataContext())
			{
				T_ValidationAddressError tError = new T_ValidationAddressError();
				tError.erDesc = error.Description;
				tError.erLocation = error.Location;
				tError.erNumber = error.Number;
				dc.T_ValidationAddressErrors.InsertOnSubmit(tError);
				dc.SubmitChanges();
				return tError.ErrorID;
			}
		}
Ejemplo n.º 3
0
		public int SaveAddrValidation(int validationID, Lead lead, string status)
		{
			using (var dc = new EngageCCTDataClassesDataContext())
			{

				int addrValStatus = 0;
				int addressID;
				T_ValidationResult tResult = new T_ValidationResult();
				T_ValidationAddress tAddress = new T_ValidationAddress();
				T_ValidationAddressError tError = new T_ValidationAddressError();

				tResult.ValidationID = validationID;
				tResult.TypeID = (int)TypeValidation.AddressValidation;
				if (status != ValidationConstants.StatusNoInformation)
				{
					var validAddress = LeadValidationManager.GetValidAddress(lead.SubjectPropertyAddress);
					if (validAddress.Error != null)
					{
						int errorID;
						ValidationAddressError error = new ValidationAddressError();
						error.Description = validAddress.Error.Description;
						error.Location = validAddress.Error.Location;
						error.Number = validAddress.Error.Number;
						errorID = SaveValidationAddressError(error);
						addrValStatus = (int)StatusValidation.Failed;
						tAddress.ErrorID = errorID;
					}
					else
					{
						//			SaveValidationAddress(validAddress);
						bool isCorrect = LeadValidationManager.CompareAddresses(lead.SubjectPropertyAddress, validAddress);
						if (isCorrect)
						{
							addrValStatus = (int)StatusValidation.Passed;
						}
						else
						{
							addrValStatus = (int)StatusValidation.Error;
						}
					}
					addressID = SaveValidationAddress(validAddress);
					tResult.AddressID = addressID;
					tResult.StatusID = addrValStatus;
				}
				else
				{
					addrValStatus = (int)StatusValidation.NoInformation;
					tResult.StatusID = addrValStatus;
				}
				dc.T_ValidationResults.InsertOnSubmit(tResult);
				dc.SubmitChanges();
				return addrValStatus;
			}
		}
Ejemplo n.º 4
0
		private ValidationAddressError GetValidationAddressErrorEntity(T_ValidationAddressError tError)
		{
			using (var dc = new EngageCCTDataClassesDataContext())
			{
				ValidationAddressError vaError = new ValidationAddressError();
				vaError.ErrorID = tError.ErrorID;
				vaError.Description = tError.erDesc;
				vaError.Location = tError.erLocation;
				vaError.Number = (int)tError.erNumber;
				return vaError;
			}
		}
 partial void DeleteT_ValidationAddressError(T_ValidationAddressError instance);
 partial void InsertT_ValidationAddressError(T_ValidationAddressError instance);