public override IQueryable <DataObject> GetAltKey(RegistrationBeneficiary dobj, IDataService defDS, IDataService syncDS, Source source, ref List <DataObject> arrToUpd, ref Dictionary <string, List <DataObject> > arrConformity) { var leechnost = MapperHelper.GetMaster(typeof(Leechnost), dobj.Beneficiary.Guid, defDS.Query <Leechnost>(Leechnost.Views.LeechnostE), syncDS, source, ref arrToUpd, ref arrConformity); var organSZ = new OrganSZ { __PrimaryKey = dobj.SocialProtectionAuthority.Guid }; return(defDS.Query <UchetLeechnosti>(UchetLeechnosti.Views.UchetLeechnostiE).Where(x => x.DataPostNaUchet == dobj.RegistrationDate && x.OrganSZ.__PrimaryKey.Equals(organSZ.__PrimaryKey) && x.Leechnost.__PrimaryKey.Equals(leechnost.__PrimaryKey))); }
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; } }
public override IQueryable <DataObject> GetAltKey(FactBenefits dobj, IDataService defDS, IDataService syncDS, Source source, ref List <DataObject> arrToUpd, ref Dictionary <string, List <DataObject> > arrConformity) { var accrualDate = (NullableDateTime)dobj.AccrualDate; var receiveDate = (NullableDateTime)dobj.ReceiveDate; var lgKatLeechnosti = MapperHelper.GetMaster(typeof(LgKatLeechnosti), dobj.MediumBenefit.Guid, defDS.Query <LgKatLeechnosti>(LgKatLeechnosti.Views.LgKatLeechnostiE), syncDS, source, ref arrToUpd, ref arrConformity); var benefit = new Lgota { __PrimaryKey = dobj.Benefit.Guid }; var organSZ = new OrganSZ { __PrimaryKey = dobj.SocialProtectionAuthority.Guid }; var query = defDS.Query <FaktLgot>(FaktLgot.Views.FaktLgotE).Where(x => x.DataNachisleniia == accrualDate && x.DataPolucheniia == receiveDate && x.NositelLgoty.__PrimaryKey.Equals(lgKatLeechnosti.__PrimaryKey) && x.Lgota.__PrimaryKey.Equals(benefit.__PrimaryKey) && x.OrganSZ.__PrimaryKey.Equals(organSZ.__PrimaryKey)); if (dobj.Dependent != null) { var dependent = MapperHelper.GetMaster(typeof(Leechnost), dobj.Dependent.Guid, defDS.Query <Leechnost>(Leechnost.Views.LeechnostE), syncDS, source, ref arrToUpd, ref arrConformity); query = query.Where(x => x.Izhdivenetc.__PrimaryKey.Equals(dependent.__PrimaryKey)); } else { query = query.Where(x => x.Izhdivenetc == null); } if (dobj.Recipient != null) { var poluchatel = MapperHelper.GetMaster(typeof(Leechnost), dobj.Recipient.Guid, defDS.Query <Leechnost>(Leechnost.Views.LeechnostE), syncDS, source, ref arrToUpd, ref arrConformity); query = query.Where(x => x.Poluchatel.__PrimaryKey.Equals(poluchatel.__PrimaryKey)); } else { query = query.Where(x => x.Poluchatel == null); } if (dobj.Period != null) { var period = new Period { __PrimaryKey = dobj.Period.Guid }; query = query.Where(x => x.Period.__PrimaryKey.Equals(period.__PrimaryKey)); } else { query = query.Where(x => x.Period == null); } return(query); }