public override bool Collect(AbstractDataCollector <TEntity> collector)
        {
            if (collector == null)
            {
                return(false);
            }

            ActiveCollector = collector;

            ID = ((IPatientViewer)ActiveCollector.ActiveViewer).ID;

            if (ActiveDBItem == null)
            {
                return(false);
            }

            ((Person_cu)ActiveDBItem).DBCommonTransactionType =
                ((IPatientViewer)ActiveCollector.ActiveViewer).CommonTransactionType;

            if (FirstNameP != null)
            {
                ((Person_cu)ActiveDBItem).FirstName_P = FirstNameP.ToString();
            }

            if (SecondNameP != null)
            {
                ((Person_cu)ActiveDBItem).SecondName_P = SecondNameP.ToString();
            }

            if (ThirdNameP != null)
            {
                ((Person_cu)ActiveDBItem).ThirdName_P = ThirdNameP.ToString();
            }

            if (FourthNameP != null)
            {
                ((Person_cu)ActiveDBItem).FourthName_P = FourthNameP.ToString();
            }

            if (FirstNameS != null)
            {
                ((Person_cu)ActiveDBItem).FirstName_S = FirstNameS.ToString();
            }

            if (SecondNameS != null)
            {
                ((Person_cu)ActiveDBItem).SecondName_S = SecondNameS.ToString();
            }

            if (ThirdNameS != null)
            {
                ((Person_cu)ActiveDBItem).ThirdName_S = ThirdNameS.ToString();
            }

            if (FourthNameS != null)
            {
                ((Person_cu)ActiveDBItem).FourthName_S = FourthNameS.ToString();
            }

            if (PersonGender != null)
            {
                ((Person_cu)ActiveDBItem).Gender = Convert.ToBoolean(PersonGender);
            }

            if (PersonTitle != null)
            {
                ((Person_cu)ActiveDBItem).PersonTitle_P_ID =
                    Convert.ToInt32(PersonTitle);
            }

            if (Nationality != null)
            {
                ((Person_cu)ActiveDBItem).Nationality_CU_ID = Convert.ToInt32(Nationality);
            }

            if (MaritalStatus != null)
            {
                ((Person_cu)ActiveDBItem).MaritalStatus_P_ID = Convert.ToInt32(MaritalStatus);
            }

            if (DateOfBirth != null)
            {
                ((Person_cu)ActiveDBItem).BirthDate = Convert.ToDateTime(DateOfBirth);
            }

            if (((Person_cu)ActiveDBItem).Patient_cu == null)
            {
                ((Person_cu)ActiveDBItem).Patient_cu = new Patient_cu();
            }

            if (UserID != null)
            {
                ((Person_cu)ActiveDBItem).Patient_cu.InsertedBy = Convert.ToInt32(UserID);
            }

            if (InsuranceCarrier != null && InsuranceLevel != null)
            {
                InsuranceCarrier_InsuranceLevel_cu insuaCarrierInsuranceLevelCu =
                    InsuranceCarrier_InsuranceLevel_cu.ItemsList.Find(
                        item =>
                        Convert.ToInt32(item.InsuranceCarrier_CU_ID).Equals(Convert.ToInt32(InsuranceCarrier)) &&
                        Convert.ToInt32(item.InsuranceLevel_CU_ID).Equals(Convert.ToInt32(InsuranceLevel)));
                if (insuaCarrierInsuranceLevelCu != null)
                {
                    ((Person_cu)ActiveDBItem).Patient_cu.InsuranceCarrier_InsuranceLevel_CU_ID =
                        Convert.ToInt32(insuaCarrierInsuranceLevelCu.ID);
                }

                if (RelativeName != null)
                {
                    ((Person_cu)ActiveDBItem).Patient_cu.RelativeName = RelativeName.ToString();
                }

                if (RelativeAddress != null)
                {
                    ((Person_cu)ActiveDBItem).Patient_cu.RelativeAddress = RelativeAddress.ToString();
                }

                if (RelativePhone != null)
                {
                    ((Person_cu)ActiveDBItem).Patient_cu.RelativePhone = RelativePhone.ToString();
                }

                if (RelativeType != null)
                {
                    ((Person_cu)ActiveDBItem).Patient_cu.PersonRelativeType_P_ID = Convert.ToInt32(RelativeType);
                }
            }

            if (CountryOfResidence != null)
            {
                ((Person_cu)ActiveDBItem).CountryOfResidence_CU_ID = Convert.ToInt32(CountryOfResidence);
            }

            if (City != null)
            {
                ((Person_cu)ActiveDBItem).CityOfResidence_CU_ID = Convert.ToInt32(City);
            }

            if (Region != null)
            {
                ((Person_cu)ActiveDBItem).Region_CU_ID = Convert.ToInt32(Region);
            }

            if (Address != null)
            {
                ((Person_cu)ActiveDBItem).Address = Address.ToString();
            }

            if (Phone1 != null)
            {
                ((Person_cu)ActiveDBItem).Phone1 = Phone1.ToString();
            }

            if (Phone2 != null)
            {
                ((Person_cu)ActiveDBItem).Phone2 = Phone2.ToString();
            }

            if (Mobile1 != null)
            {
                ((Person_cu)ActiveDBItem).Mobile1 = Mobile1.ToString();
            }

            if (Mobile2 != null)
            {
                ((Person_cu)ActiveDBItem).Mobile2 = Mobile2.ToString();
            }

            if (Email != null)
            {
                ((Person_cu)ActiveDBItem).Mobile2 = Email.ToString();
            }

            if (Email != null)
            {
                ((Person_cu)ActiveDBItem).Mobile2 = Email.ToString();
            }

            if (IdentificationCardType != null)
            {
                ((Person_cu)ActiveDBItem).IdentificationCardType_P_ID = Convert.ToInt32(IdentificationCardType);
            }

            if (IdentificationCardNumber != null)
            {
                ((Person_cu)ActiveDBItem).IdentificationCardNumber = IdentificationCardNumber.ToString();
            }

            if (IdentificationCardIssuingDate != null)
            {
                ((Person_cu)ActiveDBItem).IdentificationCardIssuingDate = Convert.ToDateTime(IdentificationCardIssuingDate);
            }

            if (IdentificationCardEpirationDate != null)
            {
                ((Person_cu)ActiveDBItem).IdentificationCardExpirationDate = Convert.ToDateTime(IdentificationCardEpirationDate);
            }

            ((Person_cu)ActiveDBItem).IsOnDuty = true;
            switch (CommonTransactionType)
            {
            case DB_CommonTransactionType.DeleteExisting:
                ((Person_cu)ActiveDBItem).IsOnDuty = false;
                break;
            }

            RelatedViewers = ((IPatientViewer)ActiveCollector.ActiveViewer).RelatedViewers;

            return(true);
        }
示例#2
0
 public ulong ResolveRelativeAddress(RelativeAddress address)
 {
     return(_functionToAddress[address.ModuleName] + address.AddressOffset);
 }