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; } }
private ValidationAddress GetValidationAddressEntity(T_ValidationAddress tAddress) { ValidationAddress vAddress = new ValidationAddress(); vAddress.AddressID = tAddress.AddressID; vAddress.City = tAddress.vadCity; vAddress.Country = tAddress.vadCountry; vAddress.State = tAddress.vadState; vAddress.Address = tAddress.vadAddress; vAddress.ZipCode = tAddress.vadZipCode; return vAddress; }
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; } }
private void detach_T_ValidationAddresses(T_ValidationAddress entity) { this.SendPropertyChanging(); entity.T_ValidationAddressError = null; }
partial void DeleteT_ValidationAddress(T_ValidationAddress instance);
partial void UpdateT_ValidationAddress(T_ValidationAddress instance);
partial void InsertT_ValidationAddress(T_ValidationAddress instance);