本文整理汇总了C#中BLL.article.UpdateField方法的典型用法代码示例。如果您正苦于以下问题:C# BLL.article.UpdateField方法的具体用法?C# BLL.article.UpdateField怎么用?C# BLL.article.UpdateField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BLL.article
的用法示例。
在下文中一共展示了BLL.article.UpdateField方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnSave_Click
//保存排序
protected void btnSave_Click(object sender, EventArgs e)
{
BLL.article bll = new BLL.article();
Repeater rptList = new Repeater();
switch (this.prolistview)
{
case "Txt":
rptList = this.rptList1;
break;
default:
rptList = this.rptList2;
break;
}
for (int i = 0; i < rptList.Items.Count; i++)
{
int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
int sortId;
if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId))
{
sortId = 99;
}
bll.UpdateField(id, "sort_id=" + sortId.ToString());
}
JscriptMsg("保存排序成功啦!", Utils.CombUrlTxt("list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}",
this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property), "Success");
}
示例2: btnAudit_Click
//批量审核
protected void btnAudit_Click(object sender, EventArgs e)
{
ChkAdminLevel("channel_" + this.channel_name + "_list", DTEnums.ActionEnum.Audit.ToString()); //检查权限
BLL.article bll = new BLL.article();
Repeater rptList = new Repeater();
switch (this.prolistview)
{
case "Txt":
rptList = this.rptList1;
break;
default:
rptList = this.rptList2;
break;
}
for (int i = 0; i < rptList.Items.Count; i++)
{
int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
if (cb.Checked)
{
bll.UpdateField(id, "status=0");
}
}
AddAdminLog(DTEnums.ActionEnum.Audit.ToString(), "审核" + this.channel_name + "频道内容信息"); //记录日志
JscriptMsg("批量审核成功!", Utils.CombUrlTxt("article_list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}",
this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property));
}
示例3: 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());
}
}
示例4: 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.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);
}
}
示例5: btnSave_Click
//保存排序
protected void btnSave_Click(object sender, EventArgs e)
{
ChkAdminLevel("channel_" + this.channel_name + "_list", MXEnums.ActionEnum.Edit.ToString()); //检查权限
BLL.article bll = new BLL.article();
Repeater rptList = new Repeater();
rptList = this.rptList1;
for (int i = 0; i < rptList.Items.Count; i++)
{
int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
int sortId;
if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId))
{
sortId = 99;
}
bll.UpdateField(id, "sort_id=" + sortId.ToString());
}
AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "保存" + this.channel_name + "频道内容排序"); //记录日志
JscriptMsg("保存排序成功啦!", Utils.CombUrlTxt("article_page_list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}",
this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property), "Success");
}
示例6: ShowPage
/// <summary>
/// 重写虚方法,此方法将在Init事件前执行
/// </summary>
protected override void ShowPage()
{
id = DTRequest.GetQueryInt("id");
page = DTRequest.GetQueryString("page");
BLL.article bll = new BLL.article();
BLL.sys_channel bll_channel = new BLL.sys_channel();
if (id > 0)
{
if (!bll.Exists(id))
{
HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + Utils.UrlEncode("出错啦,您要浏览的页面不存在或已删除啦!"));
return;
}
model = bll.GetContentModel(id);
}
else if (!string.IsNullOrEmpty(page))
{
if (!bll.ContentExists(page))
{
HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + Utils.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);
}
channel = bll_channel.GetModel(model.channel_id);
}
示例7: rptList_ItemCommand
//设置操作
protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
{
ChkAdminLevel("channel_" + this.channel_name + "_list", DTEnums.ActionEnum.Edit.ToString()); //检查权限
int id = Convert.ToInt32(((HiddenField)e.Item.FindControl("hidId")).Value);
BLL.article bll = new BLL.article();
Model.article model = bll.GetModel(id);
switch (e.CommandName)
{
case "lbtnIsMsg":
if (model.is_msg == 1)
bll.UpdateField(id, "is_msg=0");
else
bll.UpdateField(id, "is_msg=1");
break;
case "lbtnIsTop":
if (model.is_top == 1)
bll.UpdateField(id, "is_top=0");
else
bll.UpdateField(id, "is_top=1");
break;
case "lbtnIsRed":
if (model.is_red == 1)
bll.UpdateField(id, "is_red=0");
else
bll.UpdateField(id, "is_red=1");
break;
case "lbtnIsHot":
if (model.is_hot == 1)
bll.UpdateField(id, "is_hot=0");
else
bll.UpdateField(id, "is_hot=1");
break;
case "lbtnIsSlide":
if (model.is_slide == 1)
bll.UpdateField(id, "is_slide=0");
else
bll.UpdateField(id, "is_slide=1");
break;
}
this.RptBind(this.channel_id, this.category_id, "id>0" + CombSqlTxt(this.keywords, this.property), "sort_id asc,add_time desc,id desc");
}
示例8: view_article_click
private void view_article_click(HttpContext context)
{
int article_id = DTRequest.GetInt("id", 0);
int click = DTRequest.GetInt("click", 0);
int hide = DTRequest.GetInt("hide", 0);
int count = 0;
if (article_id > 0)
{
BLL.article bll = new BLL.article();
count = bll.GetClick(article_id);
if (click > 0)
{
bll.UpdateField(article_id, "click=click+1");
}
}
if (hide == 0)
{
context.Response.Write("document.write('" + count + "');");
}
}
示例9: digg_article_add
//资讯模块
private void digg_article_add(HttpContext context)
{
string channel_type = DTRequest.GetFormString("channel_type");
string digg_type = DTRequest.GetFormString("digg_type");
int id = DTRequest.GetFormInt("id");
BLL.article bll = new BLL.article();
if (!bll.Exists(id))
{
context.Response.Write("{msg:0, msgbox:\"信息不存在或已删除!\"}");
return;
}
if (digg_type == "good")
{
bll.UpdateField(id, "digg_good=digg_good+1");
}
else
{
bll.UpdateField(id, "digg_act=digg_act+1");
}
Model.article model = bll.GetModel(id);
context.Response.Write("{msg:1, digggood:" + model.digg_good + ", diggact:" + model.digg_act + ", msgbox:\"成功顶或踩了一下!\"}");
Utils.WriteCookie(DTKeys.COOKIE_DIGG_KEY, channel_type + id.ToString(), id.ToString(), 8640);
return;
}
示例10: LinkButton2_Click
protected void LinkButton2_Click(object sender, EventArgs e)
{
ChkAdminLevel("channel_" + this.channel_name + "_list", DTEnums.ActionEnum.Delete.ToString()); //检查权限
int sucCount = 0; //成功数量
int errorCount = 0; //失败数量
BLL.article bll = new BLL.article();
Repeater rptList = new Repeater();
switch (this.prolistview)
{
case "Txt":
rptList = this.rptList1;
break;
default:
rptList = this.rptList2;
break;
}
for (int i = 0; i < rptList.Items.Count; i++)
{
int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
if (cb.Checked)
{
bll.UpdateField(id, "is_put=1");
}
}
AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "上架" + this.channel_name + "频道内容成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志
JscriptMsg("批量上架成功!", Utils.CombUrlTxt("article_list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}",
this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property), "Success");
}
示例11: ddlMoveId_SelectedIndexChanged
//批量移动
protected void ddlMoveId_SelectedIndexChanged(object sender, EventArgs e)
{
ChkAdminLevel("channel_" + this.channel_name + "_list", DTEnums.ActionEnum.Edit.ToString()); //检查权限
int sucCount = 0; //成功数量
if (ddlMoveId.SelectedValue == "")
{
ddlMoveId.SelectedIndex = 0;
JscriptMsg("请选择要移动的类别!", string.Empty);
return;
}
BLL.article bll = new BLL.article();
Repeater rptList = new Repeater();
switch (this.prolistview)
{
case "Txt":
rptList = this.rptList1;
break;
default:
rptList = this.rptList2;
break;
}
for (int i = 0; i < rptList.Items.Count; i++)
{
int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
if (cb.Checked)
{
sucCount++;
bll.UpdateField(id, "category_id=" + ddlMoveId.SelectedValue);
}
}
AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "批量移动" + this.channel_name + "频道内容分类"); //记录日志
JscriptMsg("批量移动成功" + sucCount + "条", Utils.CombUrlTxt("article_list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}",
this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property));
}