public void AddCondition(int p_CarePlanTemplate_OID, System.Collections.Generic.IList <int> p_addressConditions_OIDs) { MoSIoTGenNHibernate.EN.MosIoT.CarePlanTemplateEN carePlanTemplateEN = null; try { SessionInitializeTransaction(); carePlanTemplateEN = (CarePlanTemplateEN)session.Load(typeof(CarePlanTemplateEN), p_CarePlanTemplate_OID); MoSIoTGenNHibernate.EN.MosIoT.ConditionEN addressConditionsENAux = null; if (carePlanTemplateEN.AddressConditions == null) { carePlanTemplateEN.AddressConditions = new System.Collections.Generic.List <MoSIoTGenNHibernate.EN.MosIoT.ConditionEN>(); } foreach (int item in p_addressConditions_OIDs) { addressConditionsENAux = new MoSIoTGenNHibernate.EN.MosIoT.ConditionEN(); addressConditionsENAux = (MoSIoTGenNHibernate.EN.MosIoT.ConditionEN)session.Load(typeof(MoSIoTGenNHibernate.EN.MosIoT.ConditionEN), item); addressConditionsENAux.CarePlanTemplate.Add(carePlanTemplateEN); carePlanTemplateEN.AddressConditions.Add(addressConditionsENAux); } session.Update(carePlanTemplateEN); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is MoSIoTGenNHibernate.Exceptions.ModelException) { throw ex; } throw new MoSIoTGenNHibernate.Exceptions.DataLayerException("Error in CarePlanTemplateCAD.", ex); } finally { SessionClose(); } }
public override bool Equals(object obj) { if (obj == null) { return(false); } ConditionEN t = obj as ConditionEN; if (t == null) { return(false); } if (Id.Equals(t.Id)) { return(true); } else { return(false); } }
public ConditionEN(ConditionEN condition) { this.init(Id, condition.PatientProfile, condition.Description, condition.Disabilities, condition.ClinicalStatus, condition.Disease, condition.CarePlanTemplate, condition.Goal, condition.Name); }