예제 #1
0
파일: EA.cs 프로젝트: jiaqi-xu/HitachiStore
        /// <summary>
        /// 评价的直接和分页查询
        /// </summary>
        /// <param name="CurrentPage"></param>
        /// <param name="Flag"></param>
        /// <param name="mEvaluate"></param>
        /// <returns></returns>
        public List <GoodEvaluate> DivideShow(int CurrentPage, int Flag, GoodEvaluate mEvaluate)
        {
            List <GoodEvaluate> listEvaluate = new List <GoodEvaluate>();
            string sqlstring1 = "select top (8) EvaluateID,GoodID,EvaluateContent,EvaluateTime,UserID,EvaluateGrade from GoodEvaluate where EvaluateID not in(select top(" + CurrentPage * 8 + ")EvaluateID from GoodEvaluate order by EvaluateID asc)order by EvaluateID";
            string sqlstring2 = "select EvaluateID,GoodID,EvaluateContent,EvaluateTime,UserID,EvaluateGrade from GoodEvaluate where EvaluateID='" + mEvaluate.EvaluateID + "'";

            switch (Flag)
            {
            case 1:
                SqlHelper.ReadDateReadBegin(sqlstring1);
                break;

            case 2:
                SqlHelper.ReadDateReadBegin(sqlstring2);
                break;
            }
            while (SqlHelper.SqlReader.Read())
            {
                mEvaluate.EvaluateID      = Convert.ToInt32(SqlHelper.SqlReader["EvaluateID"]);
                mEvaluate.EvaluateTime    = SqlHelper.SqlReader["EvaluateTime"].ToString();
                mEvaluate.EvaluateContent = SqlHelper.SqlReader["EvaluateContent"].ToString();
                mEvaluate.EvaluateGrade   = Convert.ToChar(SqlHelper.SqlReader["EvaluateGrade"]);
                mEvaluate.GoodID          = Convert.ToInt32(SqlHelper.SqlReader["GoodID"]);
                mEvaluate.UserID          = Convert.ToInt32(SqlHelper.SqlReader["UserID"]);
                listEvaluate.Add(mEvaluate);
            }
            SqlHelper.ReadDateReadEnd();
            return(listEvaluate);
        }
예제 #2
0
        /// <summary>
        /// 高级管理员查看评价信息列表
        /// </summary>
        /// <param name="surrentPage"></param>
        /// <returns></returns>
        public List <GoodEvaluate> EvaluateShow(int surrentPage)
        {
            List <GoodEvaluate> listEvaluate = new List <GoodEvaluate>();
            string Sqlstring1 = "select top 8  EvaluateID,StoreUser.UserName,OrderID,EvaluateGrade,EvaluateTime from GoodEvaluate left join StoreUser on StoreUser.UserID=GoodEvaluate.UserID where EvaluateID not in (select top " + surrentPage * 8 + " EvaluateID from GoodEvaluate order by EvaluateID asc) order by EvaluateID";

            SqlHelper.ReadDateReadBegin(Sqlstring1);
            while (SqlHelper.SqlReader.Read())
            {
                GoodEvaluate mEvaluate = new GoodEvaluate();
                mEvaluate.EvaluateID      = Convert.ToInt32(SqlHelper.SqlReader["EvaluateID"]);
                mEvaluate.EvaluateContent = SqlHelper.SqlReader["UserName"].ToString();
                mEvaluate.OrderID         = SqlHelper.SqlReader["OrderID"].ToString();
                switch (Convert.ToChar(SqlHelper.SqlReader["EvaluateGrade"]))
                {
                case '1':
                    mEvaluate.aEvaluateGrade = "好评";
                    break;

                case '2':
                    mEvaluate.aEvaluateGrade = "中评";
                    break;

                case '3':
                    mEvaluate.aEvaluateGrade = "差评";
                    break;
                }
                mEvaluate.EvaluateTime = SqlHelper.SqlReader["EvaluateTime"].ToString();
                listEvaluate.Add(mEvaluate);
            }
            SqlHelper.ReadDateReadEnd();
            return(listEvaluate);
        }