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; }
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); } }
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; }
/// <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); } }