protected void btnDelete_Click(object sender, EventArgs e) { ChkAdminLevel("scenic", MXEnums.ActionEnum.Delete.ToString()); //检查权限 int sucCount = 0; int errorCount = 0; BLL.wx_travel_scenic bll = new BLL.wx_travel_scenic(); 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) { if (bll.Delete(id)) { sucCount += 1; } else { errorCount += 1; } } } AddAdminLog(MXEnums.ActionEnum.Delete.ToString(), "删除景区导览成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志 JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("scenic_list.aspx", "keywords={0}", Keywords), "Success", "parent.loadMenuTree"); }
public void Add() { BLL.wx_travel_scenic bll = new BLL.wx_travel_scenic(); Model.wx_travel_scenic model = new Model.wx_travel_scenic(); model.Name = "qweqwe"; model.Description = "qweqwe"; model.TemplateId = 1; model.FirstBgImg = "qweqwe"; model.IdentifyImg = "qweqwe"; model.DisplayAction = "qweqwe"; model.SecondBgImg = "qweqwe"; model.AutoDisplayNextPage = true; model.Delay = 1000; model.AudioPath = "qweqwe"; model.AutoPlayAudio = true; model.AudioLoop = true; model.VideoPath = "123123123123"; model.AutoPlayVideo = true; model.extInt1 = 1; model.extInt2 = 1; model.extStr1 = "qweqwe"; model.extStr2 = "qweqwe"; int result = bll.Add(model); Assert.AreNotEqual(result, 0); }
private void RptBind(string strWhere, string orderby) { this.CurrentPage = MXRequest.GetQueryInt("page", 1); this.txtKeywords.Text = this.Keywords; Model.wx_userweixin weixin = GetWeiXinCode(); strWhere = "wid=" + weixin.id + " " + strWhere; //列表显示 BLL.wx_travel_scenic bll = new BLL.wx_travel_scenic(); DataSet dsData = bll.GetPageList(PageSize, this.CurrentPage, strWhere, orderby, out TotalCount); this.rptList.DataSource = dsData; this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.PageSize.ToString(); string pageUrl = Utils.CombUrlTxt("scenic_list.aspx", "keywords={0}&page={1}", this.Keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.PageSize, this.CurrentPage, this.TotalCount, pageUrl, 8); }
public void GetModel() { BLL.wx_travel_scenic bll = new BLL.wx_travel_scenic(); var model = bll.GetModel(1); }