本文整理汇总了C#中BLL.article.GetModel方法的典型用法代码示例。如果您正苦于以下问题:C# BLL.article.GetModel方法的具体用法?C# BLL.article.GetModel怎么用?C# BLL.article.GetModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BLL.article
的用法示例。
在下文中一共展示了BLL.article.GetModel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShowPage
/// <summary>
/// 重写虚方法,此方法将在Init事件前执行
/// </summary>
protected override void ShowPage()
{
id = DTRequest.GetQueryInt("id", 0);
BLL.article abll = new BLL.article();
if (id > 0)
{
model = abll.GetModel(id);
if (model == null)
{
HttpContext.Current.Response.Redirect(linkurl("error", "?msg=" + Utils.UrlEncode("出错啦,您要浏览的页面不存在或已删除啦!")));
return;
}
else
{
abll.UpdateField(model.id, "click=click+1");
}
}
DataTable pre_dt = get_article_list("bangongfuwu", model.category_id, 1, "id<" + model.id, "sort_id asc");
if (pre_dt.Rows.Count > 0)
{
preid = int.Parse(pre_dt.Rows[0]["id"].ToString());
}
DataTable next_dt = get_article_list("bangongfuwu", model.category_id, 1, "id>" + model.id, "sort_id asc");
if (next_dt.Rows.Count > 0)
{
nextid = int.Parse(next_dt.Rows[0]["id"].ToString());
}
}
示例2: ShowPage
/// <summary>
/// 重写虚方法,此方法将在Init事件前执行
/// </summary>
protected override void ShowPage()
{
BLL.article bll = new BLL.article();
model = bll.GetModel("about");
if (model == null)
{
HttpContext.Current.Response.Redirect(linkurl("error", "?msg=" + Utils.UrlEncode("出错啦,您要浏览的页面不存在或已删除啦!")));
return;
}
}
示例3: get_article_content
/// <summary>
/// 根据调用标识取得内容
/// </summary>
/// <param name="call_index">调用别名</param>
/// <returns>String</returns>
protected string get_article_content(string call_index)
{
if (string.IsNullOrEmpty(call_index))
return string.Empty;
BLL.article bll = new BLL.article();
if (bll.Exists(call_index))
{
return bll.GetModel(call_index).content;
}
return string.Empty;
}
示例4: ShowPage
/// <summary>
/// 重写虚方法,此方法将在Init事件前执行
/// </summary>
protected override void ShowPage()
{
help_id = DTRequest.GetQueryInt("help_id");
BLL.article bll = new BLL.article();
model = bll.GetModel("about");
if (model == null)
{
HttpContext.Current.Response.Redirect(linkurl("error", "?msg=" + Utils.UrlEncode("出错啦,您要浏览的页面不存在或已删除啦!")));
return;
}
if (help_id > 0)
{
model_bk = bll.GetModel(help_id);
if (model_bk == null)
{
HttpContext.Current.Response.Redirect(linkurl("error", "?msg=" + Utils.UrlEncode("出错啦,您要浏览的页面不存在或已删除啦!")));
return;
}
}
}
示例5: ShowPage
/// <summary>
/// 重写虚方法,此方法将在Init事件前执行
/// </summary>
protected override void ShowPage()
{
id = DTRequest.GetQueryInt("id");
page = DTRequest.GetQueryString("page");
BLL.article bll = new BLL.article();
if (id > 0) //如果ID获取到,将使用ID
{
if (!bll.Exists(id))
{
HttpContext.Current.Response.Redirect(linkurl("error", "?msg=" + Utils.UrlEncode("出错啦,您要浏览的页面不存在或已删除!")));
return;
}
model = bll.GetModel(id);
}
else if (!string.IsNullOrEmpty(page)) //否则检查设置的别名
{
if (!bll.Exists(page))
{
HttpContext.Current.Response.Redirect(linkurl("error", "?msg=" + Utils.UrlEncode("出错啦,您要浏览的页面不存在或已删除!")));
return;
}
model = bll.GetModel(page);
}
else
{
return;
}
//跳转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);
}
}
示例6: get_article_field
/// <summary>
/// 获取扩展字段的值
/// </summary>
/// <param name="call_index">调用别名</param>
/// <param name="field_name">扩展字段名</param>
/// <returns>String</returns>
protected string get_article_field(string call_index, string field_name)
{
if (string.IsNullOrEmpty(call_index))
return string.Empty;
BLL.article bll = new BLL.article();
if (!bll.Exists(call_index))
{
return string.Empty;
}
Model.article model = bll.GetModel(call_index);
if (model != null && model.fields.ContainsKey(field_name))
{
return model.fields[field_name];
}
return string.Empty;
}
示例7: GetList
/// <summary>
/// 获得购物车列表
/// </summary>
public static IList<Model.cart_items> GetList(int group_id)
{
IDictionary<string, int> dic = GetCart();
if (dic != null)
{
IList<Model.cart_items> iList = new List<Model.cart_items>();
foreach (var item in dic)
{
BLL.article bll = new BLL.article();
Model.article model = bll.GetModel(Convert.ToInt32(item.Key));
if (model == null || !model.fields.ContainsKey("sell_price"))
{
continue;
}
Model.cart_items modelt = new Model.cart_items();
modelt.id = model.id;
modelt.title = model.title;
modelt.img_url = model.img_url;
if (model.fields.ContainsKey("point"))
{
modelt.point = Utils.StrToInt(model.fields["point"], 0);
}
modelt.price = Utils.StrToDecimal(model.fields["sell_price"], 0);
modelt.user_price = Utils.StrToDecimal(model.fields["sell_price"], 0);
if (model.fields.ContainsKey("stock_quantity"))
{
modelt.stock_quantity = Utils.StrToInt(model.fields["stock_quantity"], 0);
}
//会员价格
if (model.group_price != null)
{
Model.user_group_price gmodel = model.group_price.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;
}
示例8: ShowPage
/// <summary>
/// 重写虚方法,此方法将在Init事件前执行
/// </summary>
protected override void ShowPage()
{
id = DTRequest.GetQueryInt("id");
BLL.article bll = new BLL.article();
if (!bll.Exists(id))
{
HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + Utils.UrlEncode("出错啦,您要浏览的页面不存在或已删除啦!"));
return;
}
model = bll.GetModel(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);
}
}
示例9: DoEdit
private bool DoEdit(int _id)
{
bool result = false;
BLL.article bll = new BLL.article();
Model.article model = bll.GetModel(_id);
decimal sell_price = 0;
decimal standard_price = 0;
decimal standard_group_price = 0;
decimal action_price = 0;
model.channel_id = this.channel_id;
model.category_id = Utils.StrToInt(ddlCategoryId.SelectedValue, 0);
model.call_index = txtCallIndex.Text.Trim();
model.title = txtTitle.Text.Trim();
model.link_url = txtLinkUrl.Text.Trim();
model.img_url = txtImgUrl.Text;
model.seo_title = txtSeoTitle.Text.Trim();
model.seo_keywords = txtSeoKeywords.Text.Trim();
model.seo_description = txtSeoDescription.Text.Trim();
//内容摘要提取内容前255个字符
if (string.IsNullOrEmpty(txtZhaiyao.Text.Trim()))
{
model.zhaiyao = Utils.DropHTML(txtContent.Value, 255);
}
else
{
model.zhaiyao = Utils.DropHTML(txtZhaiyao.Text, 255);
}
model.content = txtContent.Value;
model.sort_id = Utils.StrToInt(txtSortId.Text.Trim(), 99);
model.click = int.Parse(txtClick.Text.Trim());
model.status = Utils.StrToInt(rblStatus.SelectedValue, 0);
model.is_msg = 0;
model.is_top = 0;
model.is_red = 0;
model.is_hot = 0;
model.is_slide = 0;
model.is_put = 1;
if (isPut.Items[0].Selected)
{
model.is_put = 0;
}
if (cblItem.Items[0].Selected == true)
{
model.is_msg = 1;
}
if (cblItem.Items[1].Selected == true)
{
model.is_top = 1;
}
if (cblItem.Items[2].Selected == true)
{
model.is_red = 1;
}
if (cblItem.Items[3].Selected == true)
{
model.is_hot = 1;
}
if (cblItem.Items[4].Selected == true)
{
model.is_slide = 1;
}
model.add_time = Utils.StrToDateTime(txtAddTime.Text.Trim());
model.update_time = DateTime.Now;
model.fields = SetFieldValues(this.channel_id); //扩展字段赋值
sell_price = Convert.ToDecimal(model.fields["sell_price"]);
#region 保存相册====================
//检查是否有自定义图片
if (txtImgUrl.Text.Trim() == "")
{
model.img_url = hidFocusPhoto.Value;
}
if (model.albums != null)
{
model.albums.Clear();
}
string[] albumArr = Request.Form.GetValues("hid_photo_name");
string[] remarkArr = Request.Form.GetValues("hid_photo_remark");
if (albumArr != null)
{
List<Model.article_albums> ls = new List<Model.article_albums>();
for (int i = 0; i < albumArr.Length; i++)
{
string[] imgArr = albumArr[i].Split('|');
int img_id = Utils.StrToInt(imgArr[0], 0);
if (imgArr.Length == 3)
{
if (!string.IsNullOrEmpty(remarkArr[i]))
{
ls.Add(new Model.article_albums { id = img_id, article_id = _id, original_path = imgArr[1], thumb_path = imgArr[2], remark = remarkArr[i] });
}
else
{
ls.Add(new Model.article_albums { id = img_id, article_id = _id, original_path = imgArr[1], thumb_path = imgArr[2] });
}
}
}
model.albums = ls;
//.........这里部分代码省略.........
示例10: ShowInfo
private void ShowInfo(int _id)
{
BLL.article bll = new BLL.article();
Model.article model = bll.GetModel(_id);
ddlCategoryId.SelectedValue = model.category_id.ToString();
txtCallIndex.Text = model.call_index;
txtTitle.Text = model.title;
txtLinkUrl.Text = model.link_url;
//不是相册图片就绑定
string filename = model.img_url.Substring(model.img_url.LastIndexOf("/") + 1);
if (!filename.StartsWith("thumb_"))
{
txtImgUrl.Text = model.img_url;
}
txtSeoTitle.Text = model.seo_title;
txtSeoKeywords.Text = model.seo_keywords;
txtSeoDescription.Text = model.seo_description;
txtZhaiyao.Text = model.zhaiyao;
txtContent.Value = model.content;
txtSortId.Text = model.sort_id.ToString();
txtClick.Text = model.click.ToString();
rblStatus.SelectedValue = model.status.ToString();
txtAddTime.Text = model.add_time.ToString("yyyy-MM-dd HH:mm:ss");
if (model.is_msg == 1)
{
cblItem.Items[0].Selected = true;
}
if (model.is_top == 1)
{
cblItem.Items[1].Selected = true;
}
if (model.is_red == 1)
{
cblItem.Items[2].Selected = true;
}
if (model.is_hot == 1)
{
cblItem.Items[3].Selected = true;
}
if (model.is_slide == 1)
{
cblItem.Items[4].Selected = true;
}
if (model.is_put == 1)
{
isPut.Items[0].Selected = false;
isPut.Items[1].Selected = true;
}
else
{
isPut.Items[1].Selected = false;
isPut.Items[0].Selected = true;
}
//扩展字段赋值
List<Model.article_attribute_field> ls1 = new BLL.article_attribute_field().GetModelList(this.channel_id, "");
foreach (Model.article_attribute_field modelt1 in ls1)
{
switch (modelt1.control_type)
{
case "single-text": //单行文本
TextBox txtControl = FindControl("field_control_" + modelt1.name) as TextBox;
if (txtControl != null && model.fields.ContainsKey(modelt1.name))
{
if (modelt1.is_password == 1)
{
txtControl.Attributes.Add("value", model.fields[modelt1.name]);
}
else
{
txtControl.Text = model.fields[modelt1.name];
}
}
break;
case "multi-text": //多行文本
goto case "single-text";
case "editor": //编辑器
HtmlTextArea txtAreaControl = FindControl("field_control_" + modelt1.name) as HtmlTextArea;
if (txtAreaControl != null && model.fields.ContainsKey(modelt1.name))
{
txtAreaControl.Value = model.fields[modelt1.name];
}
break;
case "images": //图片上传
goto case "single-text";
case "number": //数字
goto case "single-text";
case "checkbox": //复选框
CheckBox cbControl = FindControl("field_control_" + modelt1.name) as CheckBox;
if (cbControl != null && model.fields.ContainsKey(modelt1.name))
{
if (model.fields[modelt1.name] == "1")
{
cbControl.Checked = true;
}
else
{
cbControl.Checked = false;
}
//.........这里部分代码省略.........
示例11: DoEdit
private bool DoEdit(int _id)
{
bool result = true;
BLL.article bll = new BLL.article();
Model.article model = bll.GetModel(_id);
model.channel_id = this.channel_id;
model.title = txtTitle.Text.Trim();
model.category_id = int.Parse(ddlCategoryId.SelectedValue);
model.link_url = txtLinkUrl.Text.Trim();
model.img_url = txtImgUrl.Text.Trim();
model.author = txtAuthor.Text.Trim();
model.form = txtForm.Text.Trim();
model.zhaiyao = Utils.DropHTML(txtZhaiyao.Text, 250);
model.seo_title = txtSeoTitle.Text.Trim();
model.seo_keywords = txtSeoKeywords.Text.Trim();
model.seo_description = txtSeoDescription.Text.Trim();
model.sort_id = int.Parse(txtSortId.Text.Trim());
model.click = int.Parse(txtClick.Text.Trim());
model.content = txtContent.Value;
model.is_msg = 0;
model.is_top = 0;
model.is_red = 0;
model.is_hot = 0;
model.is_slide = 0;
model.is_lock = 0;
if (cblItem.Items[0].Selected == true)
{
model.is_msg = 1;
}
if (cblItem.Items[1].Selected == true)
{
model.is_top = 1;
}
if (cblItem.Items[2].Selected == true)
{
model.is_red = 1;
}
if (cblItem.Items[3].Selected == true)
{
model.is_hot = 1;
}
if (cblItem.Items[4].Selected == true)
{
model.is_slide = 1;
}
if (cblItem.Items[5].Selected == true)
{
model.is_lock = 1;
}
if (!bll.Update(model))
{
result = false;
}
return result;
}
示例12: into_meal
private void into_meal(HttpContext context)
{
int good_id = DTRequest.GetQueryInt("good_id");
decimal standard_value_price_id = DTRequest.GetQueryInt("standard_value_price_id");
int unit_id = DTRequest.GetQueryInt("unit_id");
int quantity = DTRequest.GetQueryInt("quantity");
BLL.article bll_good = new BLL.article();
Model.article model_good = bll_good.GetModel(good_id);
if (model_good == null)
{
context.Response.Write("Erorr");
return;
}
string str_quantity = ",数量:" + quantity;
string unit = "";
string standard = "";
BLL.unit bll_unit = new BLL.unit();
DataTable dt_unit = bll_unit.GetList("id=" + unit_id).Tables[0];
if (dt_unit != null && dt_unit.Rows.Count > 0)
{
unit = ",单位:" + dt_unit.Rows[0]["title"].ToString();
if (!string.IsNullOrEmpty(dt_unit.Rows[0]["content"].ToString()))
{
unit += "(" + dt_unit.Rows[0]["content"].ToString() + ")";
}
}
string str_ret = "";
BLL.standard_price bll_standard_price = new BLL.standard_price();
Model.standard_price model_standard_price = bll_standard_price.GetModel(standard_value_price_id);
if (model_standard_price != null)
{
if (!string.IsNullOrEmpty(model_standard_price.standards))
{
string[] arr_standard = model_standard_price.standards.Split(',');
string[] arr_standard_value = model_standard_price.standard_values.Split(',');
for (int i = 0; i < arr_standard.Length; i++)
{
standard += arr_standard[i] + ":";
if (i < arr_standard_value.Length)
{
standard += arr_standard_value[i];
}
standard += ",";
}
}
}
if (!string.IsNullOrEmpty(standard))
{
standard = standard.Substring(0, standard.Length - 1);
}
str_ret = "<span onclick='ck_goods(this)'>" + model_good.title + str_quantity + unit + " " + standard + "<input type='checkbox' name='ck_good' style='display:none;' value='" + good_id + "_" + standard_value_price_id + "_" + unit_id + "_" + quantity + "' checked='checked'/></span>";
context.Response.Write(str_ret);
return;
}
示例13: ShowInfo
private void ShowInfo(int _id)
{
BLL.article bll = new BLL.article();
Model.article model = bll.GetModel(_id);
ddlCategoryId.SelectedValue = model.category_id.ToString();
txtTitle.Text = model.title;
txtAuthor.Text = model.author;
txtForm.Text = model.form;
txtZhaiyao.Text = model.zhaiyao;
txtImgUrl.Text = model.img_url;
txtLinkUrl.Text = model.link_url;
if (model.is_msg == 1)
{
cblItem.Items[0].Selected = true;
}
if (model.is_top == 1)
{
cblItem.Items[1].Selected = true;
}
if (model.is_red == 1)
{
cblItem.Items[2].Selected = true;
}
if (model.is_hot == 1)
{
cblItem.Items[3].Selected = true;
}
if (model.is_slide == 1)
{
cblItem.Items[4].Selected = true;
}
if (model.is_lock == 1)
{
cblItem.Items[5].Selected = true;
}
txtSortId.Text = model.sort_id.ToString();
txtClick.Text = model.click.ToString();
txtDiggGood.Text = model.digg_good.ToString();
txtDiggAct.Text = model.digg_act.ToString();
txtContent.Value = model.content;
txtSeoTitle.Text = model.seo_title;
txtSeoKeywords.Text = model.seo_keywords;
txtSeoDescription.Text = model.seo_description;
}
示例14: get_goods
private void get_goods(HttpContext context)
{
Model.users model_user = new BasePage().GetUserInfo();
int goods_id = DTRequest.GetQueryInt("goods_id");
BLL.article bll = new BLL.article();
//商品表
DataTable dt_article = bll.GetList(0, "id=" + goods_id, "id desc").Tables[0];
if (dt_article.Rows.Count <= 0)
{
context.Response.Write("NotFind");
return;
}
dt_article.TableName = "dt_goods";
DataSet ds = new DataSet();
ds.Tables.Add(dt_article.Copy());
//销量
DataTable dt_order_good_count = new BLL.orders().get_order_good_count(goods_id).Tables[0];
if (dt_order_good_count != null && dt_order_good_count.Rows.Count > 0)
{
dt_order_good_count.TableName = "dt_order_good_count";
ds.Tables.Add(dt_order_good_count.Copy());
}
//图片表
DataTable dt_albums = bll.GetAlbumsList(5, "article_id=" + goods_id, "add_time desc").Tables[0];
dt_albums.TableName = "dt_albums";
if (dt_albums != null && dt_albums.Rows.Count > 0)
{
ds.Tables.Add(dt_albums.Copy());
}
//扩展字段表
DataTable dt_attribute = bll.GetAttributeList(0, "article_id=" + goods_id, "").Tables[0];
if (dt_attribute == null && dt_attribute.Rows.Count <= 0)
{
context.Response.Write("NotFind");
return;
}
dt_attribute.TableName = "dt_attribute";
ds.Tables.Add(dt_attribute.Copy());
//规格表
BLL.standard_price bll_standard_price = new BLL.standard_price();
DataTable dt_standard_price = bll_standard_price.GetList("good_id=" + goods_id).Tables[0];
if (dt_standard_price != null && dt_standard_price.Rows.Count > 0)
{
BLL.standard bll_standard = new BLL.standard();
Model.article_category model_category = new BLL.article_category().GetModel(Convert.ToInt32(dt_article.Rows[0]["category_id"]));
if (model_category == null)
{
context.Response.Write("NotFind");
return;
}
DataTable dt_old_standard = bll_standard.GetList("'" + model_category.class_list + "' like '%,'+convert(nvarchar(10),category_id)+',%'").Tables[0];
DataTable dt_standard = new DataTable();
dt_standard.Columns.Add("id", typeof(int));
dt_standard.Columns.Add("title", typeof(string));
dt_standard.Columns.Add("value", typeof(string));
dt_standard.PrimaryKey = new DataColumn[] { dt_standard.Columns["id"] };
foreach (DataRow dr in dt_old_standard.Rows)
{
//if(Convert.ToInt32(dr[""]))
DataRow new_dr = dt_standard.NewRow();
new_dr["id"] = dr["id"];
new_dr["title"] = dr["title"];
DataTable dt_standard_value = new BLL.standard_value().GetList("standard_id=" + dr["id"].ToString()).Tables[0];
if (dt_standard_value == null || dt_standard_value.Rows.Count <= 0)
{
context.Response.Write("NotFind");
return;
}
string str_value = "";
foreach (DataRow dr_value in dt_standard_value.Rows)
{
str_value += dr_value["id"].ToString() + "|" + dr_value["value"].ToString() + ",";
}
new_dr["value"] = str_value.TrimEnd(',');
dt_standard.Rows.Add(new_dr);
}
dt_standard.TableName = "dt_standard";
if (dt_standard != null && dt_standard.Rows.Count > 0)
{
ds.Tables.Add(dt_standard.Copy());
}
}
//单位表
BLL.unit bll_unit = new BLL.unit();
DataTable dt_unit = bll_unit.GetList("good_id=" + goods_id).Tables[0];
dt_unit.TableName = "dt_unit";
if (dt_unit != null && dt_unit.Rows.Count > 0)
{
ds.Tables.Add(dt_unit.Copy());
}
//.........这里部分代码省略.........
示例15: get_collect
private void get_collect(HttpContext context)
{
int id = DTRequest.GetQueryInt("id");
BLL.collect bll_collect = new BLL.collect();
Model.collect model_collect = new Model.collect();
BLL.article bll = new BLL.article();
Model.article model = bll.GetModel(id);
Model.users user_model = new BasePage().GetUserInfo();
if (user_model == null)
{
context.Response.Write("{\"status\":0, \"msg\":\"收藏商品失败,请您先登录!\"}");
return;
}
//赋值
model_collect.goods_name = model.title;
model_collect.img_url = model.img_url;
model_collect.goods_id = model.id;
model_collect.user_id = user_model.id;
model_collect.add_time = DateTime.Now;
if (bll_collect.Exists1(model.id))
{
context.Response.Write("{\"status\":0, \"msg\":\"已收藏该商品!\"}");
return;
}
if (bll_collect.Add(model_collect) > 0)
{
context.Response.Write("{\"status\":1, \"msg\":\"收藏商品成功!\"}");
return;
}
else
{
context.Response.Write("{\"status\":0, \"msg\":\"收藏失败!\"}");
return;
}
}