protected void CopyTo(ORMGOUserGroup x, NHibernate.ISession session)
        {
            x.User = this.User != null?session.Load <ORMGOUser>(this.User.Id) : (this.GOUserId != null ? session.Load <ORMGOUser>(this.GOUserId) : null);

            x.GOUserId = this.User != null ? this.User.Id : GOUserId;

            x.Group = this.Group != null?session.Load <ORMGOGroup>(this.Group.Name) : (this.GOGroupName != null ? session.Load <ORMGOGroup>(this.GOGroupName) : null);

            x.GOGroupName = this.Group != null ? this.Group.Name : GOGroupName;
        }
        protected void CopyTo(ORMGOUserRole x, NHibernate.ISession session)
        {
            x.User = this.User != null?session.Load <ORMGOUser>(this.User.Id) : (this.GOUserId != null ? session.Load <ORMGOUser>(this.GOUserId) : null);

            x.GOUserId   = this.User != null ? this.User.Id : GOUserId;
            x.GORoleName = this.Role != null ? this.Role.Name : GORoleName;
        }
Exemplo n.º 3
0
        public static SegnalazionePreliminareDanno SegnalazionePreliminareDanno_Create(
            String Indirizzo,
            String Localita,
            String Provincia,
            Guid OggettoID
            )
        {
            try
            {
                NHibernate.ISession aNHibernateSession = NHibernateHelper.GetOrCreateCurrentSession();

                Recapito aRecapito = Recapito_Create(
                    Indirizzo,
                    Localita,
                    Provincia
                    );

                OggettoSegnalazionePreliminareDanno aOggettoSegnalazionePreliminareDanno =
                    aNHibernateSession.Load <OggettoSegnalazionePreliminareDanno>(OggettoID);


                SegnalazionePreliminareDanno aSegnalazionePreliminareDanno =
                    SegnalazionePreliminareDanno_Create(
                        aRecapito,
                        aOggettoSegnalazionePreliminareDanno
                        );

                return(aSegnalazionePreliminareDanno);
            }
            catch (Exception)
            {
                return(null);
            }
        }
Exemplo n.º 4
0
        protected void CopyTo(ORMGOGroupRole x, NHibernate.ISession session)
        {
            x.GORoleName = this.Role != null ? this.Role.Name : GORoleName;

            x.Group = this.Group != null?session.Load <ORMGOGroup>(this.Group.Name) : (this.GOGroupName != null ? session.Load <ORMGOGroup>(this.GOGroupName) : null);

            x.GOGroupName = this.Group != null ? this.Group.Name : GOGroupName;
        }
Exemplo n.º 5
0
 /// <summary>
 /// 待定(判断实体是否存在)
 /// </summary>
 /// <param name="obj">表</param>
 /// <param name="id">关键字</param>
 /// <returns></returns>
 public static bool IsPersisted(object obj, object id)
 {
     using (NHibernate.ISession session = Repository._sessionfactory.OpenSession())
     {
         try
         {
             object ot = typeof(Type);
             Type   t  = (obj.GetType() == ot.GetType()) ? (Type)obj : obj.GetType();
             object o  = session.Load(t, id);
             string s  = o.ToString();
             return(true);
         }
         catch { }
         return(false);
     }
 }