private void RptBind(string _strWhere, string _orderby) { this.page = DTRequest.GetQueryInt("page", 1); this.txtKeywords.Text = this.keywords; BLL.service bll = new BLL.service(); this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("list.aspx", "keywords={0}&page={1}", this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { //ChkAdminLevel("sys_dept", DTEnums.ActionEnum.Delete.ToString()); //检查权限 BLL.service bll = new BLL.service(); 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 && GetAdminInfo().id != id) { bll.Delete(id); } } JscriptMsg("批量删除成功啦!", Utils.CombUrlTxt("list.aspx", "keywords={0}", this.keywords), "Success"); }
private bool DoAdd() { bool result = true; Model.service model = new Model.service(); BLL.service bll = new BLL.service(); model.name = txtName.Text.Trim(); model.add_time = DateTime.Now; if (bll.Add(model) < 1) { result = false; } return(result); }
private bool DoEdit(int _id) { bool result = true; BLL.service bll = new BLL.service(); Model.service model = bll.GetModel(_id); model.name = txtName.Text.Trim(); if (!bll.Update(model)) { result = false; } return(result); }
private void ShowInfo(int _id) { BLL.service bll = new BLL.service(); Model.service model = bll.GetModel(_id); txtName.Text = model.name; }