/// <summary> /// get chaxun info /// </summary> /// <returns></returns> Eyousoft_yhq.Model.MWeiDianChanPinChaXunInfo GetChaXunInfo() { var info = new Eyousoft_yhq.Model.MWeiDianChanPinChaXunInfo(); info.ChanPinLeiXing = Utils.GetIntNull(Utils.GetQueryStringValue("txtChanPinLeiXing")); info.ChanPinName = Utils.GetQueryStringValue("txtChanPinName"); return(info); }
/// <summary> /// 获取微店产品信息集合 /// </summary> /// <param name="weiDianId">微店编号</param> /// <param name="chaXun">查询</param> /// <returns></returns> public IList <Eyousoft_yhq.Model.MWeiDianChanPinInfo> GetWeiDianChanPins(string weiDianId, int pageSize, int pageIndex, ref int recordCount, Eyousoft_yhq.Model.MWeiDianChanPinChaXunInfo chaXun) { if (string.IsNullOrEmpty(weiDianId)) { return(null); } return(dal.GetWeiDianChanPins(weiDianId, pageSize, pageIndex, ref recordCount, chaXun)); }
/// <summary> /// 获取微店产品信息集合 /// </summary> /// <param name="weiDianId">微店编号</param> /// <param name="chaXun">查询</param> /// <returns></returns> IList <Eyousoft_yhq.Model.MWeiDianChanPinInfo> GetWeiDianChanPins(string weiDianId, Eyousoft_yhq.Model.MWeiDianChanPinChaXunInfo chaXun) { if (string.IsNullOrEmpty(weiDianId)) { return(null); } return(dal.GetWeiDianChanPins(weiDianId, chaXun)); }
/// <summary> /// 获取微店产品信息集合 /// </summary> /// <param name="weiDianId">微店编号</param> /// <param name="pageSize">页记录数</param> /// <param name="pageIndex">页序号</param> /// <param name="recordCount">总记录数</param> /// <param name="chaXun">查询</param> /// <returns></returns> public IList <Eyousoft_yhq.Model.MWeiDianChanPinInfo> GetWeiDianChanPins(string weiDianId, int pageSize, int pageIndex, ref int recordCount, Eyousoft_yhq.Model.MWeiDianChanPinChaXunInfo chaXun) { IList <Eyousoft_yhq.Model.MWeiDianChanPinInfo> items = new List <Eyousoft_yhq.Model.MWeiDianChanPinInfo>(); string fields = "*"; StringBuilder sql = new StringBuilder(); string tableName = "view_WeiDian_ChanPin"; string orderByString = " IssueTime DESC "; string sumString = ""; #region chaxun sql.Append(" 1=1 "); sql.AppendFormat(" AND WeiDianId='{0}' ", weiDianId); if (chaXun != null) { if (chaXun.ChanPinLeiXing.HasValue) { sql.AppendFormat(" AND ChanPinLeiXing={0} ", chaXun.ChanPinLeiXing.Value); } if (!string.IsNullOrEmpty(chaXun.ChanPinName)) { sql.AppendFormat(" AND ChanPinName LIKE '%{0}%' ", chaXun.ChanPinName); } } #endregion using (IDataReader rdr = DbHelper.ExecuteReader1(_db, pageSize, pageIndex, ref recordCount, tableName, fields.ToString(), sql.ToString(), orderByString, sumString)) { while (rdr.Read()) { var item = new Eyousoft_yhq.Model.MWeiDianChanPinInfo(); item.ChanPinId = rdr["ChanPinId"].ToString(); item.ChanPinName = rdr["ChanPinName"].ToString(); item.ChanPinTuPianFilepath = rdr["ChanPinTuPianFilepath"].ToString(); item.GuanXiId = rdr.GetInt32(rdr.GetOrdinal("IdentityId")); item.HuiYuanId = rdr["HuiYuanId"].ToString(); item.TianJiaTime = rdr.GetDateTime(rdr.GetOrdinal("IssueTime")); item.WeiDianId = rdr["WeiDianId"].ToString(); item.ShiChangJiaGe = rdr.GetDecimal(rdr.GetOrdinal("ShiChangJiaGe")); item.JieSuanJiaGe = rdr.GetDecimal(rdr.GetOrdinal("JieSuanJiaGe")); if (!rdr.IsDBNull(rdr.GetOrdinal("ChuTuanRiQi"))) { item.ChuTuanRiQi = rdr.GetDateTime(rdr.GetOrdinal("ChuTuanRiQi")); } item.IsTianTianFaTuan = rdr["IsTianTianFaTuan"].ToString() == "1"; item.PingLunJiShu = rdr.GetInt32(rdr.GetOrdinal("PingLunJiShu")); items.Add(item); } } return(items); }
/// <summary> /// 获取微店产品信息集合 /// </summary> /// <param name="weiDianId">微店编号</param> /// <param name="chaXun">查询</param> /// <returns></returns> public IList <Eyousoft_yhq.Model.MWeiDianChanPinInfo> GetWeiDianChanPins(string weiDianId, Eyousoft_yhq.Model.MWeiDianChanPinChaXunInfo chaXun) { IList <Eyousoft_yhq.Model.MWeiDianChanPinInfo> items = new List <Eyousoft_yhq.Model.MWeiDianChanPinInfo>(); var sql = new StringBuilder(); sql.AppendFormat("SELECT * FROM view_WeiDian_ChanPin WHERE [WeiDianId]='{0}' ", weiDianId); if (chaXun != null) { if (chaXun.ChanPinLeiXing.HasValue) { sql.AppendFormat(" AND ChanPinLeiXing={0} ", chaXun.ChanPinLeiXing.Value); } if (!string.IsNullOrEmpty(chaXun.ChanPinName)) { sql.AppendFormat(" AND ChanPinName LIKE '%{0}%' ", chaXun.ChanPinName); } } sql.AppendFormat(" ORDER BY IssueTime DESC "); var cmd = _db.GetSqlStringCommand(sql.ToString()); using (var rdr = DbHelper.ExecuteReader(cmd, _db)) { while (rdr.Read()) { var item = new Eyousoft_yhq.Model.MWeiDianChanPinInfo(); item.ChanPinId = rdr["ChanPinId"].ToString(); item.ChanPinName = rdr["ChanPinName"].ToString(); item.ChanPinTuPianFilepath = rdr["ChanPinTuPianFilepath"].ToString(); item.GuanXiId = rdr.GetInt32(rdr.GetOrdinal("IdentityId")); item.HuiYuanId = rdr["HuiYuanId"].ToString(); item.TianJiaTime = rdr.GetDateTime(rdr.GetOrdinal("IssueTime")); item.WeiDianId = rdr["WeiDianId"].ToString(); item.ShiChangJiaGe = rdr.GetDecimal(rdr.GetOrdinal("ShiChangJiaGe")); item.JieSuanJiaGe = rdr.GetDecimal(rdr.GetOrdinal("JieSuanJiaGe")); if (!rdr.IsDBNull(rdr.GetOrdinal("ChuTuanRiQi"))) { item.ChuTuanRiQi = rdr.GetDateTime(rdr.GetOrdinal("ChuTuanRiQi")); } item.IsTianTianFaTuan = rdr["IsTianTianFaTuan"].ToString() == "1"; item.PingLunJiShu = rdr.GetInt32(rdr.GetOrdinal("PingLunJiShu")); items.Add(item); } } return(items); }
/// <summary> /// get chaxun info /// </summary> /// <returns></returns> Eyousoft_yhq.Model.MWeiDianChanPinChaXunInfo GetChaXunInfo() { var info = new Eyousoft_yhq.Model.MWeiDianChanPinChaXunInfo(); info.ChanPinLeiXing = Utils.GetIntNull(Utils.GetQueryStringValue("txtChanPinLeiXing")); info.ChanPinName = Utils.GetQueryStringValue("txtChanPinName"); return info; }