public override void SetMasters(ChangeAppointmentPayment obj, IzmenenieNaznachVypl dobj, List <string> attrs,
                                        IDataService defDS, IDataService syncDS, Source source, ref List <DataObject> arrToUpd,
                                        ref Dictionary <string, List <DataObject> > arrConformity)
        {
            var status = dobj.GetStatus();

            if (obj.SocialProtectionAuthority != null &&
                (status == ObjectStatus.Created || attrs != null &&
                 attrs.Contains(ChangeAppointmentPayment.ConstSocialProtectionAuthority)))
            {
                var val = new OrganSZ();
                val.SetExistObjectPrimaryKey(obj.SocialProtectionAuthority.Guid);
                defDS.LoadObject(val);
                dobj.OrganSZ = val;
            }

            if (obj.BeneficiaryPreferentialCategory != null &&
                (status == ObjectStatus.Created || attrs != null &&
                 attrs.Contains(ChangeAppointmentPayment.ConstBeneficiaryPreferentialCategory)))
            {
                var lgKatLeechnosti = (LgKatLeechnosti)MapperHelper.GetMaster(typeof(LgKatLeechnosti),
                                                                              obj.BeneficiaryPreferentialCategory.Guid,
                                                                              defDS.Query <LgKatLeechnosti>(LgKatLeechnosti.Views.LgKatLeechnostiE), syncDS, source, ref arrToUpd,
                                                                              ref arrConformity);
                dobj.LgKatLeechnosti = lgKatLeechnosti;
            }

            if (obj.Recipient != null &&
                (status == ObjectStatus.Created ||
                 attrs != null && attrs.Contains(ChangeAppointmentPayment.ConstRecipient)))
            {
                var leechnost = (Leechnost)MapperHelper.GetMaster(typeof(Leechnost), obj.Recipient.Guid,
                                                                  defDS.Query <Leechnost>(Leechnost.Views.LeechnostE), syncDS, source, ref arrToUpd,
                                                                  ref arrConformity);
                dobj.Poluchatel = leechnost;
            }

            if (obj.PaymentAppointment != null &&
                (status == ObjectStatus.Created ||
                 attrs != null && attrs.Contains(ChangeAppointmentPayment.ConstPaymentAppointment)))
            {
                var naznachenie = (NaznachenieVyplaty)MapperHelper.GetMaster(typeof(NaznachenieVyplaty),
                                                                             obj.PaymentAppointment.Guid,
                                                                             defDS.Query <NaznachenieVyplaty>(NaznachenieVyplaty.Views.NaznachenieVyplatyE), syncDS, source,
                                                                             ref arrToUpd, ref arrConformity);
                dobj.Naznachenie = naznachenie;
            }
        }
        public override void SetMasters(RegistrationBeneficiary obj, UchetLeechnosti dobj, List <string> attrs,
                                        IDataService defDS, IDataService syncDS, Source source, ref List <DataObject> arrToUpd,
                                        ref Dictionary <string, List <DataObject> > arrConformity)
        {
            var status = dobj.GetStatus();

            if (obj.Beneficiary != null &&
                (status == ObjectStatus.Created ||
                 attrs != null && attrs.Contains(RegistrationBeneficiary.ConstBeneficiary)))
            {
                var leechnost = (Leechnost)MapperHelper.GetMaster(typeof(Leechnost), obj.Beneficiary.Guid,
                                                                  defDS.Query <Leechnost>(Leechnost.Views.LeechnostE), syncDS, source, ref arrToUpd,
                                                                  ref arrConformity);
                dobj.Leechnost = leechnost;
            }

            if (obj.SocialProtectionAuthority != null &&
                (status == ObjectStatus.Created || attrs != null &&
                 attrs.Contains(RegistrationBeneficiary.ConstSocialProtectionAuthority)))
            {
                var val = new OrganSZ();
                val.SetExistObjectPrimaryKey(obj.SocialProtectionAuthority.Guid);
                defDS.LoadObject(val);
                dobj.OrganSZ = val;
            }

            if (obj.DeregestrationReason != null &&
                (status == ObjectStatus.Created ||
                 attrs != null && attrs.Contains(RegistrationBeneficiary.ConstDeregestrationReason)))
            {
                var val = new PrichinaSnyatiya();
                val.SetExistObjectPrimaryKey(obj.DeregestrationReason.Guid);
                defDS.LoadObject(val);
                dobj.PrichinaSnyatiya = val;
            }
        }
        public override void SetMasters(FactBenefits obj, FaktLgot dobj, List <string> attrs, IDataService defDS,
                                        IDataService syncDS, Source source, ref List <DataObject> arrToUpd,
                                        ref Dictionary <string, List <DataObject> > arrConformity)
        {
            var status = dobj.GetStatus();

            if (obj.MediumBenefit != null &&
                (status == ObjectStatus.Created || attrs != null && attrs.Contains(FactBenefits.ConstMediumBenefit)))
            {
                var lgKatLeechnosti = (LgKatLeechnosti)MapperHelper.GetMaster(typeof(LgKatLeechnosti),
                                                                              obj.MediumBenefit.Guid, defDS.Query <LgKatLeechnosti>(LgKatLeechnosti.Views.LgKatLeechnostiE),
                                                                              syncDS, source, ref arrToUpd, ref arrConformity);
                dobj.NositelLgoty = lgKatLeechnosti;
            }

            if (obj.Dependent != null &&
                (status == ObjectStatus.Created || attrs != null && attrs.Contains(FactBenefits.ConstDependent)))
            {
                var leechnost = (Leechnost)MapperHelper.GetMaster(typeof(Leechnost), obj.Dependent.Guid,
                                                                  defDS.Query <Leechnost>(Leechnost.Views.LeechnostE), syncDS, source, ref arrToUpd,
                                                                  ref arrConformity);
                dobj.Izhdivenetc = leechnost;
            }

            if (obj.Recipient != null &&
                (status == ObjectStatus.Created || attrs != null && attrs.Contains(FactBenefits.ConstRecipient)))
            {
                var leechnost = (Leechnost)MapperHelper.GetMaster(typeof(Leechnost), obj.Recipient.Guid,
                                                                  defDS.Query <Leechnost>(Leechnost.Views.LeechnostE), syncDS, source, ref arrToUpd,
                                                                  ref arrConformity);
                dobj.Poluchatel = leechnost;
            }

            if (obj.Benefit != null &&
                (status == ObjectStatus.Created || attrs != null && attrs.Contains(FactBenefits.ConstBenefit)))
            {
                var val = new Lgota();
                val.SetExistObjectPrimaryKey(obj.Benefit.Guid);
                defDS.LoadObject(val);
                dobj.Lgota = val;
            }

            if (obj.SocialProtectionAuthority != null &&
                (status == ObjectStatus.Created ||
                 attrs != null && attrs.Contains(FactBenefits.ConstSocialProtectionAuthority)))
            {
                var val = new OrganSZ();
                val.SetExistObjectPrimaryKey(obj.SocialProtectionAuthority.Guid);
                defDS.LoadObject(val);
                dobj.OrganSZ = val;
            }

            if (obj.Period != null &&
                (status == ObjectStatus.Created || attrs != null && attrs.Contains(FactBenefits.ConstPeriod)))
            {
                var val = new Period();
                val.SetExistObjectPrimaryKey(obj.Period.Guid);
                defDS.LoadObject(val);
                dobj.Period = val;
            }
        }