private void ShowInfo(int _id) { BLL.car_typebll bll = new BLL.car_typebll(); Model.car_typeinfo model = bll.GetModel(_id); txtType_Code.Text = model.Type_Code; txtType_Name.Text = model.Type_Name; }
private bool DoAdd() { bool result = true; Model.car_typeinfo model = new Model.car_typeinfo(); BLL.car_typebll bll = new BLL.car_typebll(); model.Type_Code = txtType_Code.Text.Trim(); model.Type_Name = txtType_Name.Text; if (bll.Add(model) < 1) { result = false; } return(result); }
private void RptBind(string _strWhere, string _orderby) { this.page = DTRequest.GetQueryInt("page", 1); this.txtKeywords.Text = this.keywords; BLL.car_typebll bll = new BLL.car_typebll(); 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("car_type_list.aspx", "group_id={0}&keywords={1}&page={2}", this.group_id.ToString(), this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
private bool DoEdit(int _id) { bool result = true; BLL.car_typebll bll = new BLL.car_typebll(); Model.car_typeinfo model = bll.GetModel(_id); model.Type_Code = txtType_Code.Text.Trim(); model.Type_Name = txtType_Name.Text; if (!bll.Update(model)) { result = false; } return(result); }
//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { ChkAdminLevel("users", DTEnums.ActionEnum.Delete.ToString()); //检查权限 BLL.car_typebll bll = new BLL.car_typebll(); 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.Delete(id); } } JscriptMsg("批量删除成功啦!", Utils.CombUrlTxt("car_type_list.aspx", "group_id={0}&keywords={1}", this.group_id.ToString(), this.keywords), "Success"); }