Example #1
0
        /// <summary>
        /// 获取公司配置信息
        /// </summary>
        public Eyousoft_yhq.Model.MComLianMeng GetComLianMeng()
        {
            var strSql = new StringBuilder();

            strSql.Append("SELECT SUM(OrderPrice) AS SealMoney,(SELECT COUNT(1) FROM dbo.tbl_Member WHERE IsAgent='1')AS Agent,COUNT(1) AS OorderCount FROM dbo.tbl_Order");

            DbCommand dc = _db.GetSqlStringCommand(strSql.ToString());

            var model = new Eyousoft_yhq.Model.MComLianMeng();

            using (IDataReader dr = DbHelper.ExecuteReader(dc, _db))
            {
                while (dr.Read())
                {
                    model.Agent       = dr.IsDBNull(dr.GetOrdinal("Agent")) ? 0 : dr.GetInt32(dr.GetOrdinal("Agent"));
                    model.OorderCount = dr.IsDBNull(dr.GetOrdinal("OorderCount")) ? 0 : dr.GetInt32(dr.GetOrdinal("OorderCount"));
                    model.SealMoney   = dr.IsDBNull(dr.GetOrdinal("SealMoney")) ? 0 : dr.GetDecimal(dr.GetOrdinal("SealMoney"));
                }
            }

            return(model);
        }
Example #2
0
File: KV.cs Project: uwitec/O2O
        /// <summary>
        /// 获取公司配置信息
        /// </summary>
        public Eyousoft_yhq.Model.MComLianMeng GetComLianMeng()
        {
            var strSql = new StringBuilder();

            strSql.Append("SELECT SUM(OrderPrice) AS SealMoney,(SELECT COUNT(1) FROM dbo.tbl_Member WHERE IsAgent='1')AS Agent,COUNT(1) AS OorderCount FROM dbo.tbl_Order");

            DbCommand dc = _db.GetSqlStringCommand(strSql.ToString());

            var model = new Eyousoft_yhq.Model.MComLianMeng();
            using (IDataReader dr = DbHelper.ExecuteReader(dc, _db))
            {
                while (dr.Read())
                {
                    model.Agent = dr.IsDBNull(dr.GetOrdinal("Agent")) ? 0 : dr.GetInt32(dr.GetOrdinal("Agent"));
                    model.OorderCount = dr.IsDBNull(dr.GetOrdinal("OorderCount")) ? 0 : dr.GetInt32(dr.GetOrdinal("OorderCount"));
                    model.SealMoney = dr.IsDBNull(dr.GetOrdinal("SealMoney")) ? 0 : dr.GetDecimal(dr.GetOrdinal("SealMoney"));

                }
            }

            return model;
        }