Exemplo n.º 1
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            PositionEN t = obj as PositionEN;

            if (t == null)
            {
                return(false);
            }
            if (Identifier.Equals(t.Identifier))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 2
0
        public void UnassignPosition(int p_Location_OID, int p_position_OID)
        {
            try
            {
                SessionInitializeTransaction();
                ChroniGenNHibernate.EN.Chroni.LocationEN locationEN = null;
                locationEN = (LocationEN)session.Load(typeof(LocationEN), p_Location_OID);

                if (locationEN.Position.Identifier == p_position_OID)
                {
                    locationEN.Position = null;
                    ChroniGenNHibernate.EN.Chroni.PositionEN positionEN = (ChroniGenNHibernate.EN.Chroni.PositionEN)session.Load(typeof(ChroniGenNHibernate.EN.Chroni.PositionEN), p_position_OID);
                    positionEN.Location = null;
                }
                else
                {
                    throw new ModelException("The identifier " + p_position_OID + " in p_position_OID you are trying to unrelationer, doesn't exist in LocationEN");
                }

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

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


            finally
            {
                SessionClose();
            }
        }
Exemplo n.º 3
0
 public PositionEN(PositionEN position)
 {
     this.init(Identifier, position.Latitude, position.Longitude, position.Altitude, position.Location);
 }