/// <summary> /// 返回相应的商品图片 /// </summary> /// <param name="goods_id">商品ID</param> /// <returns>String</returns> protected string get_goods_img_url(int goods_id) { Hoto.Model.article_goods model = new Hoto.BLL.article().GetGoodsModel(goods_id); if (model != null) { return(model.img_url); } return(""); }
/// <summary> /// 返回相应的商品图片 /// </summary> /// <param name="goods_id">商品ID</param> /// <returns>String</returns> protected string get_goods_img_url(int goods_id) { Hoto.Model.article_goods model = new Hoto.BLL.article().GetGoodsModel(goods_id); if (model != null) { return model.img_url; } return ""; }
/// <summary> /// 根据调用标识取得内容页内容 /// </summary> /// <param name="call_index">调用标识</param> /// <returns></returns> protected string get_content(string call_index) { if (string.IsNullOrEmpty(call_index)) return ""; Hoto.BLL.article bll = new Hoto.BLL.article(); if (bll.ContentExists(call_index)) { return bll.GetContentModel(call_index).content; } return ""; }
/// <summary> /// 根据调用标识取得内容页内容 /// </summary> /// <param name="call_index">调用标识</param> /// <returns></returns> protected string get_content(string call_index) { if (string.IsNullOrEmpty(call_index)) { return(""); } Hoto.BLL.article bll = new Hoto.BLL.article(); if (bll.ContentExists(call_index)) { return(bll.GetContentModel(call_index).content); } return(""); }
/// <summary> /// 内容列表 /// </summary> /// <param name="channel_id">频道ID</param> /// <param name="top">显示条数</param> /// <param name="strwhere">查询条件</param> /// <returns>DataTable</returns> protected DataTable get_content_list(int channel_id, int category_id, int top, string strwhere) { DataTable dt = new DataTable(); if (channel_id > 0) { string _where = "channel_id=" + channel_id; if (category_id > 0) { _where += " and category_id in(select id from dt_category where channel_id=" + channel_id + " and class_list like '%," + category_id + ",%')"; } if (!string.IsNullOrEmpty(strwhere)) { _where += " and " + strwhere; } dt = new Hoto.BLL.article().GetContentList(top, _where, "sort_id asc,add_time desc").Tables[0]; } return dt; }
/// <summary> /// 下载列表 /// </summary> /// <param name="channel_id">频道ID</param> /// <param name="top">显示条数</param> /// <param name="strwhere">查询条件</param> /// <returns>DataTable</returns> protected DataTable get_download_list(int channel_id, int category_id, int top, string strwhere, string orderby) { DataTable dt = new DataTable(); if (channel_id > 0) { string _where = "channel_id=" + channel_id; if (category_id > 0) { _where += " and category_id in(select id from dt_category where channel_id=" + channel_id + " and class_list like '%," + category_id + ",%')"; } if (!string.IsNullOrEmpty(strwhere)) { _where += " and " + strwhere; } dt = new Hoto.BLL.article().GetDownloadList(top, _where, orderby).Tables[0]; } return dt; }
/// <summary> /// 文章列表 /// </summary> /// <param name="channel_id">频道ID</param> /// <param name="top">显示条数</param> /// <param name="strwhere">查询条件</param> /// <returns>DataTable</returns> protected DataTable get_news_list(int channel_id, int category_id, int top, string strwhere, string orderby) { DataTable dt = new DataTable(); if (channel_id > 0) { string _where = "channel_id=" + channel_id; if (category_id > 0) { _where += " and category_id in(select id from dt_category where channel_id=" + channel_id + " and class_list like '%," + category_id + ",%')"; } if (!string.IsNullOrEmpty(strwhere)) { _where += " and " + strwhere; } dt = new Hoto.BLL.article().GetNewsList(top, _where, orderby).Tables[0]; } return(dt); }
/// <summary> /// 内容列表 /// </summary> /// <param name="channel_id">频道ID</param> /// <param name="top">显示条数</param> /// <param name="strwhere">查询条件</param> /// <returns>DataTable</returns> protected DataTable get_content_list(int channel_id, int category_id, int top, string strwhere) { DataTable dt = new DataTable(); if (channel_id > 0) { string _where = "channel_id=" + channel_id; if (category_id > 0) { _where += " and category_id in(select id from dt_category where channel_id=" + channel_id + " and class_list like '%," + category_id + ",%')"; } if (!string.IsNullOrEmpty(strwhere)) { _where += " and " + strwhere; } dt = new Hoto.BLL.article().GetContentList(top, _where, "sort_id asc,add_time desc").Tables[0]; } return(dt); }
/// <summary> /// 重写虚方法,此方法将在Init事件前执行 /// </summary> protected override void ShowPage() { id = HotoRequest.GetQueryInt("id"); Hoto.BLL.article bll = new Hoto.BLL.article(); if (!bll.Exists(id)) { HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,您要浏览的页面不存在或已删除啦!")); return; } model = bll.GetGoodsModel(id); //浏览数+1 bll.UpdateField(id, "click=click+1"); //跳转URL if (model.link_url != null) model.link_url = model.link_url.Trim(); if (!string.IsNullOrEmpty(model.link_url)) { HttpContext.Current.Response.Redirect(model.link_url); } }
/// <summary> /// 返回订单商品列表 /// </summary> /// <param name="order_id">订单</param> /// <returns>List</returns> protected List<Hoto.Model.article_goods> get_order_goods_list(int order_id) { Hoto.Model.orders model = new Hoto.BLL.orders().GetModel(order_id); if (model == null) { return null; } List<Hoto.Model.article_goods> ls = new List<Hoto.Model.article_goods>(); if (model.order_goods != null) { foreach (Hoto.Model.order_goods modelt in model.order_goods) { Hoto.Model.article_goods goodsModel = new Hoto.BLL.article().GetGoodsModel(modelt.goods_id); if (goodsModel != null) { ls.Add(goodsModel); } } } return ls; }
/// <summary> /// 重写虚方法,此方法将在Init事件前执行 /// </summary> protected override void ShowPage() { id = HotoRequest.GetQueryInt("id"); page = HotoRequest.GetQueryString("page"); Hoto.BLL.article bll = new Hoto.BLL.article(); if (id > 0) { if (!bll.Exists(id)) { HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,您要浏览的页面不存在或已删除啦!")); return; } model = bll.GetContentModel(id); } else if (!string.IsNullOrEmpty(page)) { if (!bll.ContentExists(page)) { HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + HotoUtils.UrlEncode("出错啦,您要浏览的页面不存在或已删除啦!")); return; } model = bll.GetContentModel(page); } else { Server.Transfer("error.aspx"); return; } //浏览数+1 bll.UpdateField(model.id, "click=click+1"); //跳转URL if (model.link_url != null) { model.link_url = model.link_url.Trim(); } if (!string.IsNullOrEmpty(model.link_url)) { HttpContext.Current.Response.Redirect(model.link_url); } }
/// <summary> /// 获得购物车列表 /// </summary> public static IList <Hoto.Model.cart_items> GetList(int group_id) { IDictionary <string, int> dic = GetCart(); if (dic != null) { IList <Hoto.Model.cart_items> iList = new List <Hoto.Model.cart_items>(); foreach (var item in dic) { Hoto.BLL.article bll = new Hoto.BLL.article(); Hoto.Model.article_goods model = bll.GetGoodsModel(Convert.ToInt32(item.Key)); if (model == null) { continue; } Hoto.Model.cart_items modelt = new Hoto.Model.cart_items(); modelt.id = model.id; modelt.title = model.title; modelt.img_url = model.img_url; modelt.point = model.point; modelt.price = model.sell_price; modelt.user_price = model.sell_price; modelt.stock_quantity = model.stock_quantity; //会员价格 if (model.goods_group_prices != null) { Hoto.Model.goods_group_price gmodel = model.goods_group_prices.Find(p => p.group_id == group_id); if (gmodel != null) { modelt.user_price = gmodel.price; } } modelt.quantity = item.Value; iList.Add(modelt); } return(iList); } return(null); }
/// <summary> /// 返回对应商品的会员价格 /// </summary> /// <param name="goods_id">商品ID</param> /// <returns>Decimal</returns> protected decimal get_user_goods_price(int goods_id) { Hoto.Model.users userModel = GetUserInfo(); if (userModel == null) { return(-1); } Hoto.Model.article_goods model = new Hoto.BLL.article().GetGoodsModel(goods_id); if (model != null) { if (model.goods_group_prices != null) { Hoto.Model.goods_group_price priceModel = model.goods_group_prices.Find(p => p.group_id == userModel.group_id); if (priceModel != null) { return(priceModel.price); } } return(model.sell_price); } return(-1); }
/// <summary> /// 获得购物车列表 /// </summary> public static IList<Hoto.Model.cart_items> GetList(int group_id) { IDictionary<string, int> dic = GetCart(); if (dic != null) { IList<Hoto.Model.cart_items> iList = new List<Hoto.Model.cart_items>(); foreach (var item in dic) { Hoto.BLL.article bll = new Hoto.BLL.article(); Hoto.Model.article_goods model = bll.GetGoodsModel(Convert.ToInt32(item.Key)); if (model == null) { continue; } Hoto.Model.cart_items modelt = new Hoto.Model.cart_items(); modelt.id = model.id; modelt.title = model.title; modelt.img_url = model.img_url; modelt.point = model.point; modelt.price = model.sell_price; modelt.user_price = model.sell_price; modelt.stock_quantity = model.stock_quantity; //会员价格 if (model.goods_group_prices != null) { Hoto.Model.goods_group_price gmodel = model.goods_group_prices.Find(p => p.group_id == group_id); if (gmodel != null) { modelt.user_price = gmodel.price; } } modelt.quantity = item.Value; iList.Add(modelt); } return iList; } return null; }
/// <summary> /// 返回订单商品列表 /// </summary> /// <param name="order_id">订单</param> /// <returns>List</returns> protected List <Hoto.Model.article_goods> get_order_goods_list(int order_id) { Hoto.Model.orders model = new Hoto.BLL.orders().GetModel(order_id); if (model == null) { return(null); } List <Hoto.Model.article_goods> ls = new List <Hoto.Model.article_goods>(); if (model.order_goods != null) { foreach (Hoto.Model.order_goods modelt in model.order_goods) { Hoto.Model.article_goods goodsModel = new Hoto.BLL.article().GetGoodsModel(modelt.goods_id); if (goodsModel != null) { ls.Add(goodsModel); } } } return(ls); }
/// <summary> /// 文章分页列表 /// </summary> /// <param name="channel_id">频道ID</param> /// <param name="page_size">页面大小</param> /// <param name="page_index">当前页码</param> /// <param name="strwhere">查询条件</param> /// <param name="totalcount">总记录数</param> /// <returns>DateTable</returns> protected DataTable get_news_list(int channel_id, int category_id, int page_size, int page_index, string strwhere, out int totalcount) { DataTable dt = new DataTable(); if (channel_id > 0) { string _where = "channel_id=" + channel_id; if (category_id > 0) { _where += " and category_id in(select id from dt_category where channel_id=" + channel_id + " and class_list like '%," + category_id + ",%')"; } if (!string.IsNullOrEmpty(strwhere)) { _where += " and " + strwhere; } dt = new Hoto.BLL.article().GetNewsList(page_size, page_index, _where, "sort_id asc,add_time desc", out totalcount).Tables[0]; } else { totalcount = 0; } return(dt); }
/// <summary> /// 下载分页列表 /// </summary> /// <param name="channel_id">频道ID</param> /// <param name="page_size">页面大小</param> /// <param name="page_index">当前页码</param> /// <param name="strwhere">查询条件</param> /// <param name="totalcount">总记录数</param> /// <returns>DateTable</returns> protected DataTable get_download_list(int channel_id, int category_id, int page_size, int page_index, string strwhere, out int totalcount) { DataTable dt = new DataTable(); if (channel_id > 0) { string _where = "channel_id=" + channel_id; if (category_id > 0) { _where += " and category_id in(select id from dt_category where channel_id=" + channel_id + " and class_list like '%," + category_id + ",%')"; } if (!string.IsNullOrEmpty(strwhere)) { _where += " and " + strwhere; } dt = new Hoto.BLL.article().GetDownloadList(page_size, page_index, _where, "sort_id asc,add_time desc", out totalcount).Tables[0]; } else { totalcount = 0; } return dt; }
/// <summary> /// 返回对应商品的会员价格 /// </summary> /// <param name="goods_id">商品ID</param> /// <returns>Decimal</returns> protected decimal get_user_goods_price(int goods_id) { Hoto.Model.users userModel = GetUserInfo(); if (userModel == null) { return -1; } Hoto.Model.article_goods model = new Hoto.BLL.article().GetGoodsModel(goods_id); if (model != null) { if (model.goods_group_prices != null) { Hoto.Model.goods_group_price priceModel = model.goods_group_prices.Find(p => p.group_id == userModel.group_id); if (priceModel != null) { return priceModel.price; } } return model.sell_price; } return -1; }