public IList GetByCondition(PropertyAppropriation propertyAppropriation)
        {
            ArrayList param    = new ArrayList();
            string    queryStr = "from PropertyAppropriation t where 1=1";

            if (!string.IsNullOrEmpty(propertyAppropriation.ast_id))
            {
                queryStr += " and t.ast_id=?";
                param.Add(propertyAppropriation.ast_id);
            }
            if (propertyAppropriation.Department != null)
            {
                queryStr += " and t.Department = ?";
                param.Add(propertyAppropriation.Department.DepartmentID);
            }
            if (!string.IsNullOrEmpty(propertyAppropriation.ast_from_user))
            {
                queryStr += " and t.ast_from_user like ?";
                param.Add("%" + propertyAppropriation.ast_from_user + "%");
            }
            if (propertyAppropriation.ast_fit_date != propertyAppropriation.ast_fit_default_date)
            {
                DateTime dtTemp = propertyAppropriation.ast_fit_date.AddDays(1);
                queryStr += " and t.ast_fit_date >= ? and t.ast_fit_date < ?";
                param.Add(propertyAppropriation.ast_fit_date);
                param.Add(dtTemp);
            }
            return(HibernateTemplate.Find(queryStr, param.ToArray()));
        }
Example #2
0
        public IList GetByCondition(User user)
        {
            ArrayList param    = new ArrayList();
            string    queryStr = "from User t where 1=1";

            if (user.UserID != "")
            {
                queryStr += " and t.UserID=?";
                param.Add(user.UserID);
            }
            if (user.UserName != "")
            {
                queryStr += " and t.UserName like ?";
                param.Add("%" + user.UserName + "%");
            }
            if (user.Role != null)
            {
                queryStr += " and t.Role=?";
                param.Add(user.Role.RoleId);
            }
            if (user.Department != null)
            {
                queryStr += " and t.Department=?";
                param.Add(user.Department.DepartmentID);
            }
            return(HibernateTemplate.Find(queryStr, param.ToArray()));
        }
Example #3
0
        public object DoInTransaction(ITransactionStatus status)
        {
            Assert.IsTrue(TransactionSynchronizationManager.HasResource(sfProxy), "Has thread session");
            Assert.IsTrue(TransactionSynchronizationManager.HasResource(provider), "Hasn't thread db provider");
            Assert.IsFalse(TransactionSynchronizationManager.CurrentTransactionReadOnly);
            Assert.IsTrue(TransactionSynchronizationManager.ActualTransactionActive);
            HibernateTemplate ht = new HibernateTemplate(sfProxy);

            return(ht.Find("some query string"));
        }
Example #4
0
        /// <summary>
        /// 根据选品库id获取该选品库在数据库中的产品集合
        /// </summary>
        /// <param name="fId">参数:选品库id</param>
        /// <returns></returns>
        public IList <FavoriteItem> GetByFId(long fId)
        {
            return(HibernateTemplate.Find <FavoriteItem>
                   (
                       "from FavoriteItem p  where p.FavoritesId=?",
                       fId
                   ));

            throw new NotImplementedException();
        }
Example #5
0
        public IList <Favorites> GetIListById(long id)
        {
            return(HibernateTemplate.Find <Favorites>
                   (
                       "from WeixinBaseConfigure p  where p.WxcId=?",
                       id
                   ));

            throw new NotImplementedException();
        }
Example #6
0
        public IList getZipList(string obj)
        {
            IList lists = HibernateTemplate.Find("from Zip where pid=? ", obj);

            if (lists == null || lists.Count < 1)
            {
                return(null);
            }
            else
            {
                return(lists);
            }
        }
Example #7
0
        public Marquee getMarquee(string obj)
        {
            IList lists = HibernateTemplate.Find("from Marquee where Id=? ", obj);

            if (lists == null || lists.Count < 1)
            {
                return(null);
            }
            else
            {
                return((Marquee)lists[0]);
            }
        }
Example #8
0
        public IList getExamplesListByYear(string year)
        {
            IList lists = HibernateTemplate.Find("from Examples where Year = ? order by Year desc ", year);

            if (lists == null || lists.Count < 1)
            {
                return(null);
            }
            else
            {
                return(lists);
            }
        }
Example #9
0
        public Zip getZip(string obj)
        {
            IList lists = HibernateTemplate.Find("from Zip where Id=? ", obj);

            if (lists == null || lists.Count < 1)
            {
                return(null);
            }
            else
            {
                return((Zip)lists[0]);
            }
        }
Example #10
0
        public IList getTechInfoList(int obj)
        {
            IList lists = HibernateTemplate.Find("from TechInfo where id=? ", obj);

            if (lists == null || lists.Count < 1)
            {
                return(null);
            }
            else
            {
                return(lists);
            }
        }
Example #11
0
        public Case getCase(int obj)
        {
            IList lists = HibernateTemplate.Find("from Case where id=? ", obj);

            if (lists == null || lists.Count < 1)
            {
                return(null);
            }
            else
            {
                return((Case)lists[0]);
            }
        }
Example #12
0
        public IList getCaseList()
        {
            IList lists = HibernateTemplate.Find("from Case where Isdeleted=false");

            if (lists == null || lists.Count < 1)
            {
                return(null);
            }
            else
            {
                return(lists);
            }
        }
Example #13
0
        public IList getReuseTechListAll(string obj)
        {
            IList lists = HibernateTemplate.Find("from ReuseTech where   Username=?", obj);

            if (lists == null || lists.Count < 1)
            {
                return(null);
            }
            else
            {
                return(lists);
            }
        }
Example #14
0
        public Match getMatch(int obj)
        {
            IList lists = HibernateTemplate.Find("from Match where Id=? ", obj);

            if (lists == null || lists.Count < 1)
            {
                return(null);
            }
            else
            {
                return((Match)lists[0]);
            }
        }
Example #15
0
        public IList getNotApprovedMatch(string obj)
        {
            IList lists = HibernateTemplate.Find("from Match where (Username1='" + obj + "' or  Username2='" + obj + "') and (Isapproved1=false  or Isapproved2=false)");

            if (lists == null || lists.Count < 1)
            {
                return(null);
            }
            else
            {
                return(lists);
            }
        }
Example #16
0
        public IList getCityList()
        {
            IList lists = HibernateTemplate.Find("from City ");

            if (lists == null || lists.Count < 1)
            {
                return(null);
            }
            else
            {
                return(lists);
            }
        }
Example #17
0
        public City getCity(string obj)
        {
            IList lists = HibernateTemplate.Find("from City where Id=? ", obj);

            if (lists == null || lists.Count < 1)
            {
                return(null);
            }
            else
            {
                return((City)lists[0]);
            }
        }
Example #18
0
        public Param getParam(object[] obj)
        {
            IList lists = HibernateTemplate.Find("from Param p where p.Id.Paramid=? and p.Id.Paramcode=? ", obj);

            if (lists == null || lists.Count < 1)
            {
                return(null);
            }
            else
            {
                return((Param)lists[0]);
            }
        }
Example #19
0
        public IList getMarqueeList(ArrayList obj)
        {
            IList lists = HibernateTemplate.Find("from Marquee where id=? ", obj);

            if (lists == null || lists.Count < 1)
            {
                return(null);
            }
            else
            {
                return(lists);
            }
        }
Example #20
0
        public ReuseTech getReuseTechByName(string obj)
        {
            IList lists = HibernateTemplate.Find("from ReuseTech where Username=? ", obj);

            if (lists == null || lists.Count < 1)
            {
                return(null);
            }
            else
            {
                return((ReuseTech)lists[0]);
            }
        }
Example #21
0
        public IList getUserProfilesList(ArrayList obj)
        {
            IList lists = HibernateTemplate.Find("from UserProfiles where id=? ", obj);

            if (lists == null || lists.Count < 1)
            {
                return(null);
            }
            else
            {
                return(lists);
            }
        }
Example #22
0
        public IList getReuseTechList(object[] obj)
        {
            IList lists = HibernateTemplate.Find("from ReuseTech where Id=? and Username=?", obj);

            if (lists == null || lists.Count < 1)
            {
                return(null);
            }
            else
            {
                return(lists);
            }
        }
Example #23
0
        public IList getMatchListForManager()
        {
            IList lists = HibernateTemplate.Find("from Match where Ischecked<>'N' and Isapproved1=true and Isapproved2=true order by Matchdate ");

            if (lists == null || lists.Count < 1)
            {
                return(null);
            }
            else
            {
                return(lists);
            }
        }
Example #24
0
        public ReuseTech getReuseTech(int id)
        {
            IList lists = HibernateTemplate.Find("from ReuseTech where id=? ", id);

            if (lists == null || lists.Count < 1)
            {
                return(null);
            }
            else
            {
                return((ReuseTech)lists[0]);
            }
        }
Example #25
0
        public UserProfiles getUserProfiles(string obj)
        {
            IList lists = HibernateTemplate.Find("from UserProfiles where Username=? ", obj);

            if (lists == null || lists.Count < 1)
            {
                return(null);
            }
            else
            {
                return((UserProfiles)lists[0]);
            }
        }
Example #26
0
        public IList getMatchListForUser2(string obj)
        {
            IList lists = HibernateTemplate.Find("from Match where  Username2=? and Ischecked='Y' and Isconfirm2<>'N' order by Matchdate ", obj);

            if (lists == null || lists.Count < 1)
            {
                return(null);
            }
            else
            {
                return(lists);
            }
        }
Example #27
0
        public AspnetUsers FindByProperty(string userName)
        {
            IList lists = HibernateTemplate.Find("from AspnetUsers where UserName=? ", userName);

            if (lists == null || lists.Count < 1)
            {
                return(null);
            }
            else
            {
                return((AspnetUsers)lists[0]);
            }
        }
Example #28
0
        public Examples getExamples(ArrayList obj)
        {
            IList lists = HibernateTemplate.Find("from Examples where id=? ", obj);

            if (lists == null || lists.Count < 1)
            {
                return(null);
            }
            else
            {
                return((Examples)lists[0]);
            }
        }
Example #29
0
        public IList getExamplesList()
        {
            IList lists = HibernateTemplate.Find("from Examples order by Year desc ");

            if (lists == null || lists.Count < 1)
            {
                return(null);
            }
            else
            {
                return(lists);
            }
        }
Example #30
0
        public IList getNewsListById(int obj)
        {
            IList lists = HibernateTemplate.Find("from News where id=? ", obj);

            if (lists == null || lists.Count < 1)
            {
                return(null);
            }
            else
            {
                return(lists);
            }
        }