예제 #1
0
        public void AddMeasure(int p_Target_OID, int p_measure_OID)
        {
            MoSIoTGenNHibernate.EN.MosIoT.TargetEN targetEN = null;
            try
            {
                SessionInitializeTransaction();
                targetEN         = (TargetEN)session.Load(typeof(TargetEN), p_Target_OID);
                targetEN.Measure = (MoSIoTGenNHibernate.EN.MosIoT.MeasureEN)session.Load(typeof(MoSIoTGenNHibernate.EN.MosIoT.MeasureEN), p_measure_OID);

                targetEN.Measure.Target.Add(targetEN);



                session.Update(targetEN);
                SessionCommit();
            }

            catch (Exception ex) {
                SessionRollBack();
                if (ex is MoSIoTGenNHibernate.Exceptions.ModelException)
                {
                    throw ex;
                }
                throw new MoSIoTGenNHibernate.Exceptions.DataLayerException("Error in TargetCAD.", ex);
            }


            finally
            {
                SessionClose();
            }
        }
예제 #2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            TargetEN t = obj as TargetEN;

            if (t == null)
            {
                return(false);
            }
            if (Id.Equals(t.Id))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #3
0
 public TargetEN(TargetEN target)
 {
     this.init(Id, target.Goal, target.DesiredValue, target.Measure, target.Description, target.DueDate);
 }