public SidResponse GetSidResponse()
 {
     System.Collections.Generic.List<SidPerson> list = new System.Collections.Generic.List<SidPerson>();
     foreach (AIS.SN.Model.DomainObjects.Views.ExchangeRequestResident resident in this.Residents)
     {
         SidPerson person = new SidPerson {
             LastName = resident.LastName,
             FirstName = resident.FirstName,
             MiddleName = resident.MiddleName,
             BirthDate = resident.BirthDate,
             IsAllowedPersonDataUsage = resident.IsAgreedOnPersonDataUsage,
             Documents = new SidPersonDocument[] { new SidPersonDocument() }
         };
         person.Documents[0].Series = resident.DocumentSeries;
         person.Documents[0].Number = resident.DocumentNumber;
         person.Documents[0].Org = resident.DocumentOrganization;
         person.Documents[0].Type = resident.DocumentType;
         person.Documents[0].Date = resident.DocumentFromDate;
         person.Registrations = new SidPersonRegistration[] { new SidPersonRegistration() };
         person.Registrations[0].FromDate = resident.FromDate;
         person.Registrations[0].ToDate = resident.ToDate;
         person.Registrations[0].FamilyRelation = resident.RelationType;
         person.Registrations[0].Type = resident.RegistrationType;
         person.Source = "ПС";
         list.Add(person);
     }
     return new SidResponse { Items = list.ToArray() };
 }
Example #2
0
 public static System.Collections.Generic.List<EqualityPerson> FindBySidPerson(System.Collections.Generic.List<EqualityPerson> list, SidPerson sidPerson)
 {
     System.Collections.Generic.List<EqualityPerson> list2 = new System.Collections.Generic.List<EqualityPerson>();
     foreach (EqualityPerson person in list)
     {
         if (person.sidPerson == sidPerson)
         {
             list2.Add(person);
         }
     }
     return list2;
 }
Example #3
0
 public static EqualityPerson FindBySidPersonAndResidentPack(System.Collections.Generic.List<EqualityPerson> list, SidPerson sidPerson, ResidentPack residentPack)
 {
     foreach (EqualityPerson person in list)
     {
         if ((person.sidPerson == sidPerson) && (person.residentPack == residentPack))
         {
             return person;
         }
     }
     return null;
 }
 private void NewEqualityPersonFromSpun(SidPerson sidPerson)
 {
     if (sidPerson.equalityed <= 0)
     {
         ResidentPack pack;
         sidPerson.matchColor = this.greenMatch;
         sidPerson.equalityed = (int) (sidPerson.equalityed + 1);
         pack = new ResidentPack {
             matchColor = this.greenMatch,
             equalityed = (int) (pack.equalityed + 1),
             Person = new Person()
         };
         pack.Person.LName = sidPerson.LastName;
         pack.Person.FName = sidPerson.FirstName;
         pack.Person.MName = sidPerson.MiddleName;
         pack.Person.BirthDate = sidPerson.BirthDate;
         pack.Person.AllowPersonalDataUsage = sidPerson.IsAllowedPersonDataUsage;
         if (sidPerson.Documents.Length > 0)
         {
             pack.Person.NumDoc = sidPerson.Documents[0].Number;
             pack.Person.OrgDoc = sidPerson.Documents[0].Org;
             pack.Person.SerDoc = sidPerson.Documents[0].Series;
             pack.Person.TypeDoc = sidPerson.Documents[0].TypeDocFasetId;
             pack.Person.TypeDocName = sidPerson.Documents[0].Type;
             pack.Person.DateDoc = sidPerson.Documents[0].Date;
         }
         pack.apartmentResidents = new ObjectList<ApartmentResident>();
         SidPersonRegistration[] registrations = sidPerson.Registrations;
         for (int i = 0; i < registrations.Length; i = (int) (i + 1))
         {
             SidPersonRegistration registration = registrations[i];
             ApartmentResident resident = new ApartmentResident {
                 ApartmentId = this.apartment.Id,
                 FromDate = registration.FromDate,
                 ToDate = registration.ToDate,
                 Relative = registration.Relative,
                 TypeResidents = registration.TypeResidents
             };
             pack.apartmentResidents.Add(resident);
         }
         pack.personBenefits = new ObjectList<PersonBenefit>();
         pack.personBenefitDocuments = new ObjectList<PersonBenefitDocument>();
         pack.personBenefitDocumentLink = new System.Collections.Generic.Dictionary<PersonBenefitDocument, PersonBenefit>();
         if (this.BenefitsAll == null)
         {
             this.BenefitsAll = Benefit.GetBenefits();
         }
         if (this.BenefitsAll.get_Count() > 0)
         {
             SidPersonBenefit[] benefits = sidPerson.Benefits;
             for (int j = 0; j < benefits.Length; j = (int) (j + 1))
             {
                 SidPersonBenefit benefit = benefits[j];
                 Benefit benefit2 = null;
                 foreach (Benefit benefit3 in this.BenefitsAll)
                 {
                     if (benefit3.Code.ToString() == benefit.BenefitCode)
                     {
                         benefit2 = benefit3;
                         break;
                     }
                 }
                 if (benefit2 != null)
                 {
                     PersonBenefit benefit4 = null;
                     foreach (PersonBenefit benefit5 in pack.personBenefits)
                     {
                         if (benefit5.BenefitId == benefit2.Id)
                         {
                             benefit4 = benefit5;
                             break;
                         }
                     }
                     if (benefit4 == null)
                     {
                         benefit4 = new PersonBenefit {
                             BenefitId = benefit2.Id
                         };
                         pack.personBenefits.Add(benefit4);
                     }
                     if (!string.IsNullOrEmpty(benefit.DocNumber))
                     {
                         PersonBenefitDocument document = new PersonBenefitDocument {
                             BenefitId = benefit4.BenefitId,
                             DateDoc = benefit.DocDate,
                             NumDoc = benefit.DocNumber,
                             SerDoc = benefit.DocSeries,
                             WhereDoc = benefit.DocOrg,
                             TypeDocFasetId = benefit.TypeDocFasetId,
                             TypeDocName = benefit.DocType,
                             NumNotif = benefit.NoticeNumber,
                             DateNotif = benefit.NoticeDate,
                             FromDate = benefit.FromDate,
                             ToDate = benefit.ToDate
                         };
                         pack.personBenefitDocuments.Add(document);
                         pack.personBenefitDocumentLink.Add(document, benefit4);
                     }
                 }
             }
         }
         this.residents.Add(pack);
         EqualityPerson person = new EqualityPerson {
             matchColor = this.greenMatch,
             MatchType = "вручную",
             sidPerson = sidPerson
         };
         sidPerson.matchColor = person.matchColor;
         sidPerson.equalityed = (int) (sidPerson.equalityed + 1);
         pack.matchColor = person.matchColor;
         pack.equalityed = (int) (pack.equalityed + 1);
         person.residentPack = pack;
         person.LName = sidPerson.LastName.Trim().ToUpper();
         person.MName = sidPerson.MiddleName.Trim().ToUpper();
         person.FName = sidPerson.FirstName.Trim().ToUpper();
         person.BirthDate = sidPerson.BirthDate;
         person.IsAllowedPersonDataUsage = sidPerson.IsAllowedPersonDataUsage;
         this.equalityPersons.Add(person);
     }
 }