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

            ActiveCollector = collector;

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

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

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

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

            #region General Person Details

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            ((Person_cu)ActiveDBItem).IsOnDuty = true;

            #endregion

            #region User Details

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

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

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

            ((Person_cu)ActiveDBItem).User_cu.OragnizationID = (int)ApplicationStaticConfiguration.Organization;

            ((Person_cu)ActiveDBItem).User_cu.IsOnDuty = true;

            #endregion

            #region Doctor Details

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

            if (DoctorRankID != null)
            {
                ((Person_cu)ActiveDBItem).Doctor_cu.DoctorRank_P_ID = Convert.ToInt32(DoctorRankID);
            }

            if (DoctorSpecializationID != null)
            {
                ((Person_cu)ActiveDBItem).Doctor_cu.DoctorSpecialization_P_ID = Convert.ToInt32(DoctorSpecializationID);
            }

            if (DoctorCategoryID != null)
            {
                ((Person_cu)ActiveDBItem).Doctor_cu.DoctorCategory_CU_ID = Convert.ToInt32(DoctorCategoryID);
            }

            if (DoctorProfessionalFees != null)
            {
                ((Person_cu)ActiveDBItem).Doctor_cu.DoctorProfessionalFeesIssuingType_P_ID = Convert.ToInt32(DoctorProfessionalFees);
            }

            if (DoctorTaxTypeID != null)
            {
                ((Person_cu)ActiveDBItem).Doctor_cu.DoctorTaxType_CU_ID = Convert.ToInt32(DoctorTaxTypeID);
            }

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

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

            ((Person_cu)ActiveDBItem).Doctor_cu.IsOnDuty = true;

            #endregion

            switch (((IDoctorViewer)ActiveCollector.ActiveViewer).CommonTransactionType)
            {
            case DB_CommonTransactionType.DeleteExisting:
                ((Person_cu)ActiveDBItem).IsOnDuty           = false;
                ((Person_cu)ActiveDBItem).User_cu.IsOnDuty   = false;
                ((Person_cu)ActiveDBItem).Doctor_cu.IsOnDuty = false;
                break;
            }

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

            return(true);
        }
Example #2
0
        public override bool Collect(AbstractDataCollector <TEntity> collector)
        {
            if (collector == null)
            {
                return(false);
            }

            ActiveCollector = collector;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if (((Person_cu)ActiveDBItem).Supplier_cu != null)
            {
                ((Person_cu)ActiveDBItem).Supplier_cu.IsOnDuty = true;
            }

            ((Person_cu)ActiveDBItem).IsOnDuty = true;
            switch (((ISupplierViewer)ActiveCollector.ActiveViewer).CommonTransactionType)
            {
            case DB_CommonTransactionType.DeleteExisting:
                ((Person_cu)ActiveDBItem).IsOnDuty = false;
                if (((Person_cu)ActiveDBItem).Supplier_cu != null)
                {
                    ((Person_cu)ActiveDBItem).Supplier_cu.IsOnDuty = false;
                }
                break;
            }

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

            return(true);
        }
        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);
        }