public SnilsFundResponse ReadItemFields(DataReaderAdapter dataReader, SnilsFundResponse item = null) { if (item == null) { item = new SnilsFundResponse(); } item.Id = dataReader.GetInt64("ID"); item.ClientVisitId = dataReader.GetInt64("ClientVisitID"); item.ClientVisitGroupId = dataReader.GetInt64("VisitGroupID"); item.PolicyType = ReferencesMaterializer.Instance.ReadItemFields(dataReader, "PolicyTypeId", "PolicyTypeCode", "PolicyTypeName"); item.UnifiedPolicyNumber = dataReader.GetString("UnifiedPolicyNumber"); item.PolicySeries = dataReader.GetString("PolicySeries"); item.PolicyNumber = dataReader.GetString("PolicyNumber"); item.OKATO = dataReader.GetString("OKATO"); item.OGRN = dataReader.GetString("OGRN"); item.StartDate = dataReader.GetDateTimeNull("StartDate"); item.ExpirationDate = dataReader.GetDateTimeNull("ExpirationDate"); item.FundAnswer = dataReader.GetString("FundAnswer"); item.ErrorMessage = dataReader.GetString("ErrorMessage"); item.FundAnswer = dataReader.GetString("FundAnswer"); item.Order = dataReader.GetInt32("OrderNumber"); item.DataType = (EntityType)(dataReader.GetInt32Null("DataTypeId") ?? 0); item.CreateDate = dataReader.GetDateTime("CreateDate"); return(item); }
public SvdFundResponse ReadItemFields(DataReaderAdapter dataReader, SvdFundResponse item = null) { if (item == null) { item = new SvdFundResponse(); } item.Id = dataReader.GetInt64("ID"); item.ClientVisitId = dataReader.GetInt64("ClientVisitID"); item.ClientVisitGroupId = dataReader.GetInt64("VisitGroupID"); item.DocumentType = ReferencesMaterializer.Instance.ReadItemFields(dataReader, "DocumentTypeID", "DocumentTypeCode", "DocumentTypeName"); item.Citizenship = ReferencesMaterializer.Instance.ReadItemFields(dataReader, "CitizenshipID", "CitizenshipCode", "CitizenshipName"); item.UnifiedPolicyNumber = dataReader.GetString("UnifiedPolicyNumber"); item.PolicySeries = dataReader.GetString("PolicySeries"); item.PolicyNumber = dataReader.GetString("PolicyNumber"); item.Snils = dataReader.GetString("Snils"); item.OGRN = dataReader.GetString("OGRN"); item.StartDate = dataReader.GetDateTimeNull("StartDate"); item.ExpirationDate = dataReader.GetDateTimeNull("ExpirationDate"); item.OmsCode = dataReader.GetString("OmsCode"); item.Firstname = dataReader.GetString("Firstname"); item.Secondname = dataReader.GetString("Secondname"); item.Lastname = dataReader.GetString("Lastname"); item.Birthday = dataReader.GetDateTimeNull("Birthday"); item.CreateDate = dataReader.GetDateTime("CreateDate"); item.Sex = dataReader.GetString("Sex"); item.DataType = (EntityType)(dataReader.GetInt32Null("DataTypeId") ?? 0); item.DocumentNumber = dataReader.GetString("DocumentNumber"); item.DocumentSeries = dataReader.GetString("DocumentSeries"); item.DocumentIssueDate = dataReader.GetDateTimeNull("DocumentIssueDate"); item.ERZ = dataReader.GetString("ERZ"); return(item); }
public NOMP ReadItemFields2(DataReaderAdapter reader, NOMP item = null) { if (item == null) { item = new NOMP(); } item.Id = 0; //item.S_CARD = reader.GetString("S_CARD"); //item.N_CARD = reader.GetInt64Null("N_CARD"); item.ENP = reader.GetString("UnifiedPolicyNumber"); item.VSN = reader.GetString("TemporaryPolicyNumber"); item.LPU_ID = reader.GetInt64Null("LPU_ID"); item.DATE_IN = reader.GetDateTimeNull("DATE_IN"); item.SPOS = reader.GetInt32Null("SPOS"); item.ClientID = reader.GetInt64Null("ClientID"); return(item); }
public NomernikForClient ReadItemFields(DataReaderAdapter reader, NomernikForClient item = null) { if (item == null) { item = new NomernikForClient(); } item.Id = reader.GetInt64("ID"); item.S_CARD = reader.GetString("S_CARD"); item.N_CARD = reader.GetString("N_CARD"); item.ENP = reader.GetString("UnifiedPolicyNumber"); item.VSN = reader.GetString("TemporaryPolicyNumber"); item.LPU_ID = reader.GetInt64Null("LPU_ID"); item.DATE_IN = reader.GetDateTimeNull("DATE_IN"); item.SPOS = reader.GetInt32Null("SPOS"); item.ClientID = reader.GetInt64Null("ClientID"); item.LoadDate = reader.GetDateTime("LoadDate"); item.FileDate = reader.GetDateTime("FileDate"); item.Firstname = reader.GetString("Firstname"); item.Secondname = reader.GetString("Secondname"); item.Lastname = reader.GetString("Lastname"); return(item); }
public ClientVisit.SaveData ReadItemFields(DataReaderAdapter dataReader, ClientVisit.SaveData clientVisit = null) { if (clientVisit == null) { clientVisit = new ClientVisit.SaveData(); } clientVisit.DeliveryCenterId = dataReader.GetInt64("DeliveryCenterID"); clientVisit.MedicalCentreId = dataReader.GetInt64Null("MedicalCenterID"); clientVisit.PolicyPartyNumber = dataReader.GetString("PolicyParty"); clientVisit.Status = dataReader.GetInt64Null("Status") ?? 12; clientVisit.StatusDate = dataReader.GetDateTimeNull("DP"); clientVisit.TemporaryPolicyNumber = dataReader.GetString("TemporaryPolicyNumber"); clientVisit.TemporaryPolicyDate = dataReader.GetDateTimeNull("TemporaryPolicyDate"); string scnCode = dataReader.GetString("SCN"); string JT = dataReader.GetString("JT"); if (JT == "r" || scnCode == "POK") { clientVisit.Status = ClientVisitStatuses.PolicyIssued.Id; clientVisit.IssueDate = clientVisit.StatusDate; } FillPolicyData(dataReader, clientVisit); clientVisit.NewClientInfo.Lastname = dataReader.GetString("NewClientLastname"); long?NewClientLastnameTypeId = dataReader.GetInt64Null("NewClientLastnameTypeId"); if (!NewClientLastnameTypeId.HasValue) { NewClientLastnameTypeId = 1; } clientVisit.NewClientInfo.LastnameTypeId = NewClientLastnameTypeId.Value; clientVisit.NewClientInfo.Firstname = dataReader.GetString("NewClientFirstname"); long?NewClientFirstnameTypeId = dataReader.GetInt64Null("NewClientFirstnameTypeId"); if (!NewClientFirstnameTypeId.HasValue) { NewClientFirstnameTypeId = 1; } clientVisit.NewClientInfo.FirstnameTypeId = NewClientFirstnameTypeId.Value; clientVisit.NewClientInfo.Secondname = dataReader.GetString("NewClientSecondname"); long?NewClientSecondnameTypeId = dataReader.GetInt64Null("NewClientSecondnameTypeId"); if (!NewClientSecondnameTypeId.HasValue) { NewClientSecondnameTypeId = 1; } clientVisit.NewClientInfo.SecondnameTypeId = NewClientSecondnameTypeId.Value; clientVisit.NewClientInfo.Birthday = dataReader.GetDateTimeNull("NewBirthDate"); clientVisit.NewClientInfo.Sex = dataReader.GetInt64("Sex").ToString()[0]; clientVisit.NewClientInfo.Category = dataReader.GetInt64Null("ClientCategoryId") ?? 1; string unformattedPhone = dataReader.GetString("Phone") ?? string.Empty; string phone = string.Concat(unformattedPhone.Where(c => char.IsDigit(c))); clientVisit.Phone = dataReader.GetString("Phone"); if (phone.Length == 10) { clientVisit.Phone = string.Format("({0}){1}-{2}-{3}", phone.Substring(0, 3), phone.Substring(3, 3), phone.Substring(6, 2), phone.Substring(8, 2)); } else if (phone.Length == 11 && (phone[0] == '8' || phone[0] == '7')) { clientVisit.Phone = string.Format("({0}){1}-{2}-{3}", phone.Substring(1, 3), phone.Substring(4, 3), phone.Substring(7, 2), phone.Substring(9, 2)); } else if (phone.Length == 12 && phone[0] == '+' && phone[1] == '7') { clientVisit.Phone = string.Format("({0}){1}-{2}-{3}", phone.Substring(2, 3), phone.Substring(5, 3), phone.Substring(8, 2), phone.Substring(10, 2)); } else if (phone.Length == 7) { clientVisit.Phone = string.Format("(000){0}-{1}-{2}", phone.Substring(0, 3), phone.Substring(3, 2), phone.Substring(5, 2)); } if (!string.IsNullOrEmpty(unformattedPhone)) { clientVisit.Comment = clientVisit.Comment + string.Format(" Телефон из старой системы: {0}", unformattedPhone); } clientVisit.NewDocument.DocumentTypeId = dataReader.GetInt64Null("NewDocumentTypeID"); clientVisit.NewDocument.Series = dataReader.GetString("NewDocumentSeries"); clientVisit.NewDocument.Number = dataReader.GetString("NewDocumentNumber"); clientVisit.NewDocument.IssueDate = dataReader.GetDateTimeNull("NewDocumentIssueDate"); clientVisit.NewDocument.IssueDepartment = dataReader.GetString("DocumentIssueDepartment"); clientVisit.NewClientInfo.SNILS = dataReader.GetString("NewSNILS"); clientVisit.NewClientInfo.Citizenship = dataReader.GetInt64("Citizenship"); clientVisit.RegistrationAddressDate = dataReader.GetDateTimeNull("AddressRegistrationDate"); clientVisit.CarrierId = dataReader.GetInt64Null("CarrierID"); clientVisit.Representative.RepresentativeTypeId = 1; if (dataReader.GetInt32Null("RepresentativeTypeCode").HasValue) { clientVisit.Representative.RepresentativeTypeId = dataReader.GetInt32Null("RepresentativeTypeCode") + 1; } clientVisit.ApplicationMethodId = dataReader.GetInt64Null("ApplicationMethodID"); clientVisit.GOZNAKTypeId = dataReader.GetInt64Null("GoznakTypeID"); clientVisit.GOZNAKDate = dataReader.GetDateTimeNull("GOZNAKDate"); clientVisit.RegistratorId = 1; clientVisit.NewDocument.ExpirationDate = dataReader.GetDateTimeNull("NewDocumentExpirationDate"); clientVisit.ClientCategoryId = dataReader.GetInt64Null("UralsibClientCategory"); clientVisit.NewDocument.IsIssueCase = false; clientVisit.OldSystemId = dataReader.GetInt64Null("OldSystemId"); clientVisit.UniqueId = dataReader.GetInt64Null("UniqueId"); clientVisit.LivingAddress.TerritoryCode = "45"; clientVisit.LivingAddress.RegionCode = "000"; clientVisit.LivingAddress.Region = "г Москва"; clientVisit.LivingAddress.RegionId = "0c5b2444-70a0-4932-980c-b4dc0d3f02b5"; long?livingStreetCode = dataReader.GetInt64Null("LivingStreetCode"); clientVisit.LivingAddress.StreetCode = livingStreetCode.HasValue ? livingStreetCode.ToString() : null; clientVisit.LivingAddress.Street = dataReader.GetString("LivingStreetname"); clientVisit.LivingAddress.House = dataReader.GetString("LivingHouse"); clientVisit.LivingAddress.Housing = dataReader.GetString("LivingHousing"); clientVisit.LivingAddress.Building = dataReader.GetString("LivingBuilding"); clientVisit.LivingAddress.Appartment = dataReader.GetString("LivingAppartment"); clientVisit.LivingAddress.TerritoryCode = "45"; clientVisit.LivingAddress.RegionCode = "000"; clientVisit.RegistrationAddress.Region = dataReader.GetString("RegistrationRegionName"); clientVisit.RegistrationAddress.Area = dataReader.GetString("RegistrationAreaName"); clientVisit.RegistrationAddress.City = dataReader.GetString("RegistrationCityName"); clientVisit.RegistrationAddress.Street = dataReader.GetString("RegistrationStreetName"); clientVisit.RegistrationAddress.House = dataReader.GetString("RegistrationHouse"); clientVisit.RegistrationAddress.Housing = dataReader.GetString("RegistrationHousing"); clientVisit.RegistrationAddress.Building = dataReader.GetString("RegistrationBuilding"); clientVisit.RegistrationAddress.Appartment = dataReader.GetString("RegistrationAppartment"); string C_OKATO = dataReader.GetString("C_OKATO"); if (!string.IsNullOrEmpty(C_OKATO) && C_OKATO.Length == 5) { clientVisit.RegistrationAddress.TerritoryCode = C_OKATO.Substring(0, 2); clientVisit.RegistrationAddress.RegionCode = C_OKATO.Substring(2, 3); } clientVisit.NewForeignDocument.DocumentTypeId = dataReader.GetInt64Null("ForeignDocumentType"); clientVisit.NewForeignDocument.Series = dataReader.GetString("ForeignDocumentSeries"); clientVisit.NewForeignDocument.Number = dataReader.GetString("ForeignDocumentNumber"); clientVisit.NewForeignDocument.IssueDate = dataReader.GetDateTimeNull("ForeignDocumentIssueDate"); clientVisit.OldClientInfo.Lastname = dataReader.GetString("OldLastname"); clientVisit.OldClientInfo.Firstname = dataReader.GetString("OldFirstname"); clientVisit.OldClientInfo.Secondname = dataReader.GetString("OldSecondname"); clientVisit.OldClientInfo.Birthday = dataReader.GetDateTimeNull("OldBirthdate"); clientVisit.OldClientInfo.Sex = dataReader.GetInt64Null("OldSex").HasValue ? dataReader.GetInt64Null("OldSex").ToString()[0] : new char?(); clientVisit.OldClientInfo.LastnameTypeId = 1; clientVisit.OldClientInfo.FirstnameTypeId = 1; clientVisit.OldClientInfo.SecondnameTypeId = 1; clientVisit.OldDocument.DocumentTypeId = dataReader.GetInt64Null("OldDocumentId"); clientVisit.OldDocument.Series = dataReader.GetString("OldDocumentSeries"); clientVisit.OldDocument.Number = dataReader.GetString("OldDocumentNumber"); clientVisit.OldDocument.IssueDate = dataReader.GetDateTimeNull("OldDocumentDate"); clientVisit.ScenarioId = dataReader.GetInt64Null("ScenarioID"); clientVisit.Representative.Lastname = dataReader.GetString("RepresentativeLastname"); clientVisit.Representative.Firstname = dataReader.GetString("RepresentativeFirstname"); clientVisit.Representative.Secondname = dataReader.GetString("RepresentativeSecondname"); clientVisit.Representative.Series = dataReader.GetString("RepresentativeSeries"); clientVisit.Representative.Number = dataReader.GetString("RepresentativeNumber"); clientVisit.Representative.IssueDate = dataReader.GetDateTimeNull("RepresentativeIssueDate"); clientVisit.Representative.Birthday = dataReader.GetDateTimeNull("RepresentativeBirthDate"); clientVisit.NewClientInfo.Birthplace = dataReader.GetString("NewBirthplace"); clientVisit.Comment = clientVisit.Comment + " " + dataReader.GetString("comment"); return(clientVisit); }