示例#1
0
        /// <summary>
        /// 获取会员游记条数
        /// </summary>
        /// <param name="huiYuanId">会员Id</param>
        /// <param name="times">最后查看时间</param>
        /// <returns></returns>
        public int GetYouJiNum(string huiYuanId)
        {
            IList <Eyousoft_yhq.Model.MHuiYuanDianZanInfo> items = new List <Eyousoft_yhq.Model.MHuiYuanDianZanInfo>();
            var cmd = _db.GetSqlStringCommand("SELECT count(YouJiId) FROM tbl_HuiYouYouJi WHERE HuiYuanId=@HuiYuanId ");

            _db.AddInParameter(cmd, "HuiYuanId", DbType.AnsiStringFixedLength, huiYuanId);

            var rdr = DbHelper.GetSingle(cmd, _db);

            return(Convert.ToInt32(rdr.ToString()));
        }
示例#2
0
        /// <summary>
        /// 获取会员最新留言条数
        /// </summary>
        /// <param name="huiYuanId">会员Id</param>
        /// <param name="times">最后查看时间</param>
        /// <returns></returns>
        public int GetLiuYanNum(string huiYuanId, DateTime times)
        {
            IList <Eyousoft_yhq.Model.MHuiYuanDianZanInfo> items = new List <Eyousoft_yhq.Model.MHuiYuanDianZanInfo>();
            var cmd = _db.GetSqlStringCommand("SELECT count(IdentityId) FROM view_HuiYuan_LiuYan WHERE HuiYuanId2=@HuiYuanId And LiuYanTime>@Times");

            _db.AddInParameter(cmd, "HuiYuanId", DbType.AnsiStringFixedLength, huiYuanId);
            _db.AddInParameter(cmd, "Times", DbType.DateTime, times);

            var rdr = DbHelper.GetSingle(cmd, _db);

            return(Convert.ToInt32(rdr.ToString()));
        }
示例#3
0
        /// <summary>
        /// 获取产品的留言数量
        /// </summary>
        /// <param name="productID">产品编号</param>
        /// <returns></returns>
        public int GetCountNum(string productID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select count(1) from tbl_Comment");
            strSql.Append(" where ProductID=@ProductID ");

            DbCommand cmd = this._db.GetSqlStringCommand(strSql.ToString());

            this._db.AddInParameter(cmd, "ProductID", System.Data.DbType.String, productID);

            return(Convert.ToInt32(DbHelper.GetSingle(cmd, this._db)));
        }
示例#4
0
        /// <summary>
        /// 判断微信码是否可用
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool Exists(Eyousoft_yhq.Model.Product model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select count(1) from tbl_Product");
            strSql.Append(" where FavourCode=@FavourCode and  DATEDIFF(day,@ValidiDate,GETDATE())<0");

            DbCommand cmd = this._db.GetSqlStringCommand(strSql.ToString());

            this._db.AddInParameter(cmd, "FavourCode", System.Data.DbType.String, model.FavourCode);
            this._db.AddInParameter(cmd, "ValidiDate", System.Data.DbType.DateTime, model.ValidiDate);

            return(Convert.ToInt32(DbHelper.GetSingle(cmd, this._db)) > 1 ? true : false);
        }
示例#5
0
        /// <summary>
        /// 统计当前分类产品优惠码领取次数
        /// </summary>
        /// <param name="model">产品类别编号</param>
        /// <returns></returns>
        public int countTypeNum(string id)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("  SELECT COUNT(1) FROM tbl_SendMsg WHERE ProductID IN(SELECT tbl_Product.ProductID FROM tbl_Product WHERE ProductType=@ProductType)  ");


            DbCommand cmd = this._db.GetSqlStringCommand(strSql.ToString());

            this._db.AddInParameter(cmd, "ProductType", DbType.Int32, id);


            return((int)DbHelper.GetSingle(cmd, this._db));
        }
示例#6
0
        /// <summary>
        /// 统计当前产品优惠码领取次数
        /// </summary>
        /// <param name="model">产品编号</param>
        /// <returns></returns>
        public int countNum(string id)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("  SELECT COUNT(1)  FROM tbl_SendMSG  WHERE ProductID=@ProductID  ");


            DbCommand cmd = this._db.GetSqlStringCommand(strSql.ToString());

            this._db.AddInParameter(cmd, "ProductID", System.Data.DbType.AnsiStringFixedLength, id);


            return((int)DbHelper.GetSingle(cmd, this._db));
        }
示例#7
0
        /// <summary>
        /// 获取所有帐户的充值和消费金额
        /// </summary>

        /// <returns></returns>
        public int GetTotalMoney(TotalMoney Tmoney)
        {
            StringBuilder strSql = new StringBuilder();

            if (Tmoney == TotalMoney.账户充值金额)
            {
                strSql.Append("select sum(YuE) from tbl_Member");
            }
            else
            {
                strSql.Append("select sum(JinE) from tbl_ConDetailed where XiaoFeiFangShi <> 0");
            }

            DbCommand cmd = this._db.GetSqlStringCommand(strSql.ToString());


            return(Convert.ToInt32(DbHelper.GetSingle(cmd, this._db)));
        }
示例#8
0
        /// <summary>
        /// 获取列表数据
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <param name="RecordCount"></param>
        /// <param name="serModel"></param>
        /// <returns></returns>
        public decimal getSumMoney(ChouJiangSer serModel)
        {
            IList <ChouJiang> list = new List <ChouJiang>();

            StringBuilder strSql = new StringBuilder();

            strSql.Append("SELECT  sum(DianShu)  FROM   view_ChouJiang WHERE  1=1 ");

            if (serModel == null)
            {
                if (!string.IsNullOrEmpty(serModel.CaoZuoRenID))
                {
                    strSql.AppendFormat(" and  CaoZuoRenID  = '{0}' ", serModel.CaoZuoRenID);
                }
            }
            DbCommand cmd = this._db.GetSqlStringCommand(strSql.ToString());


            decimal sum = Convert.ToDecimal(DbHelper.GetSingle(cmd, this._db));

            return(sum);
        }