//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { ChkAdminLevel("motorcycle_type", DTEnums.ActionEnum.Delete.ToString()); //检查权限 int sucCount = 0; int errorCount = 0; BLL.MotorcycleType bll = new BLL.MotorcycleType(); 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(DTEnums.ActionEnum.Delete.ToString(), "删除车型" + sucCount + "条,失败" + errorCount + "条"); //记录日志 JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("motorcycle_type_list.aspx", "keywords={0}", this.keywords), "Success"); }
private void ShowInfo(int _id) { BLL.MotorcycleType bll = new BLL.MotorcycleType(); Model.MotorcycleType model = bll.GetModel(_id); txtName.Text = model.Name; }
//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { ChkAdminLevel("motorcycle_type", DTEnums.ActionEnum.Delete.ToString()); //检查权限 int sucCount = 0; int errorCount = 0; BLL.MotorcycleType bll = new BLL.MotorcycleType(); 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(DTEnums.ActionEnum.Delete.ToString(), "删除车型" + sucCount + "条,失败" + errorCount + "条"); //记录日志 JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("motorcycle_type_list.aspx", "keywords={0}", this.keywords), "Success"); }
private void RptBind(string _strWhere, string _orderby) { this.page = DTRequest.GetQueryInt("page", 1); this.txtKeywords.Text = this.keywords; BLL.MotorcycleType bll = new BLL.MotorcycleType(); 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("motorcycle_type_list.aspx", "keywords={0}&page={1}", this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
private bool DoAdd() { bool result = false; Model.MotorcycleType model = new Model.MotorcycleType(); BLL.MotorcycleType bll = new BLL.MotorcycleType(); model.Name = txtName.Text.Trim(); if (bll.Add(model) > 0) { AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加车型:" + model.Name); //记录日志 result = true; } return result; }
private bool DoEdit(int _id) { bool result = false; BLL.MotorcycleType bll = new BLL.MotorcycleType(); Model.MotorcycleType model = bll.GetModel(_id); model.Name = txtName.Text.Trim(); if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改车型信息:" + model.Name); //记录日志 result = true; } return(result); }
private bool DoAdd() { bool result = false; Model.MotorcycleType model = new Model.MotorcycleType(); BLL.MotorcycleType bll = new BLL.MotorcycleType(); model.Name = txtName.Text.Trim(); if (bll.Add(model) > 0) { AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加车型:" + model.Name); //记录日志 result = true; } return(result); }
private void TreeBind(string strWhere) { BLL.Motorcade bll = new BLL.Motorcade(); DataTable dt = bll.GetList(0, strWhere, "Id desc").Tables[0]; this.ddlMotorcadeName.Items.Clear(); this.ddlMotorcadeName.Items.Add(new ListItem("请选择车队...", "")); foreach (DataRow dr in dt.Rows) { this.ddlMotorcadeName.Items.Add(new ListItem(dr["Name"].ToString(), dr["Name"].ToString())); } BLL.MotorcycleType mtBLL = new BLL.MotorcycleType(); DataTable mtdt = mtBLL.GetList(0, strWhere, "Id desc").Tables[0]; this.ddlMotorcycleType.Items.Clear(); this.ddlMotorcycleType.Items.Add(new ListItem("请选择车型...", "")); foreach (DataRow dr in mtdt.Rows) { this.ddlMotorcycleType.Items.Add(new ListItem(dr["Name"].ToString(), dr["Name"].ToString())); } }
private void TreeBind(string strWhere) { BLL.Motorcade bll = new BLL.Motorcade(); DataTable dt = bll.GetList(0, strWhere, "Id desc").Tables[0]; this.ddlMotorcadeName.Items.Clear(); this.ddlMotorcadeName.Items.Add(new ListItem("请选择车队...", "")); foreach (DataRow dr in dt.Rows) { this.ddlMotorcadeName.Items.Add(new ListItem(dr["Name"].ToString(), dr["Name"].ToString())); } BLL.MotorcycleType mtBLL = new BLL.MotorcycleType(); DataTable mtdt = mtBLL.GetList(0, strWhere, "Id desc").Tables[0]; this.ddlMotorcycleType.Items.Clear(); this.ddlMotorcycleType.Items.Add(new ListItem("请选择车型...", "")); foreach (DataRow dr in mtdt.Rows) { this.ddlMotorcycleType.Items.Add(new ListItem(dr["Name"].ToString(), dr["Name"].ToString())); } }
private bool DoEdit(int _id) { bool result = false; BLL.MotorcycleType bll = new BLL.MotorcycleType(); Model.MotorcycleType model = bll.GetModel(_id); model.Name = txtName.Text.Trim(); if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改车型信息:" + model.Name); //记录日志 result = true; } return result; }
private void ShowInfo(int _id) { BLL.MotorcycleType bll = new BLL.MotorcycleType(); Model.MotorcycleType model = bll.GetModel(_id); txtName.Text = model.Name; }
private void RptBind(string _strWhere, string _orderby) { this.page = DTRequest.GetQueryInt("page", 1); this.txtKeywords.Text = this.keywords; BLL.MotorcycleType bll = new BLL.MotorcycleType(); 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("motorcycle_type_list.aspx", "keywords={0}&page={1}", this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }