コード例 #1
0
        public ICollection <FanPageStatus> GetAllFanPageStatus(FanPageStatus acc)
        {
            ICollection <FanPageStatus> iCol = null;

            try
            {
                using (NHibernate.ISession session = SessionFactory.GetNewSession())
                {
                    iCol = session.CreateCriteria(typeof(FanPageStatus)).List <FanPageStatus>();
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }
            return(iCol);
        }
コード例 #2
0
 public void Update(FanPageStatus acc)
 {
     try
     {
         using (NHibernate.ISession session = SessionFactory.GetNewSession())
         {
             using (NHibernate.ITransaction transaction = session.BeginTransaction())
             {
                 //session.Update(acc.Password, acc);
                 transaction.Commit();
             }
         }
     }
     catch (Exception ex)
     {
         GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
     }
 }
コード例 #3
0
        public void Insert(FanPageStatus acc)
        {
            try
            {
                lock (lockerInsert)
                {
                    using (NHibernate.ISession session = SessionFactory.GetNewSession())
                    {
                        using (NHibernate.ITransaction transaction = session.BeginTransaction())
                        {
                            session.Save(acc);

                            transaction.Commit();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }
        }
コード例 #4
0
        public void DeleteUsingMainPageUrl(FanPageStatus fpStatus)
        {
            try
            {
                lock (lockerDeleteUsingMainPageUrl)
                {
                    using (NHibernate.ISession session = SessionFactory.GetNewSession())
                    {
                        using (NHibernate.ITransaction transaction = session.BeginTransaction())
                        {
                            var query = session.CreateQuery("Delete from FanPageStatus where MainPageUrl= :mainPageUrl");
                            query.SetParameter("mainPageUrl", fpStatus.MainPageUrl);
                            int res = query.ExecuteUpdate();

                            transaction.Commit();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }
        }