protected void Button1_Click(object sender, EventArgs e) { int BLID = Convert.ToInt32(Request.QueryString["BLID"]); if (BLCategoryDAL.update(this.TextBox1.Text, BLID) > 0) { Alert("修改成功"); Response.Redirect("goodLType.aspx"); } else { Alert("修改失败"); } }
protected void ImageButton2_Click(object sender, ImageClickEventArgs e) { ImageButton btu = sender as ImageButton; int BID = Convert.ToInt32(btu.CommandArgument); if (BLCategoryDAL.delete(BID) > 0) { //刷新数据 ShowDate(); } else { Alert("删除失败"); } }
protected void Button1_Click(object sender, EventArgs e) { string BLName = this.TextBox1.Text; //if (BLCategoryDAL.selByname(BLName)==0) //{ if (BLCategoryDAL.addBLCategory(BLName) > 0) { Alert("添加成功"); } else { Alert("添加失败"); } //} //else //{ // Alert("已存在此类别"); //} }
protected void Button1_Click(object sender, EventArgs e) { if (this.TextBox1.Text != "") { //if (BLCategoryDAL.selByname(TextBox1.Text) == 0) //{ if (BLCategoryDAL.addBLCategory(this.TextBox1.Text) > 0) { Alert("添加成功"); this.TextBox1.Text = ""; ShowDate(); } else { Alert("添加失败"); } //} //else //{ // Alert("已存在大类别"); //} } }
/// <summary> /// 根据id修改大类名称 /// </summary> /// <param name="BLName"></param> /// <param name="BLID"></param> /// <returns></returns> public static int update(string BLName, int BLID) { return BLCategoryDAL.update(BLName,BLID); }
/// <summary> /// 根据大类ID删除大类 /// </summary> /// <param name="BID"></param> /// <returns></returns> public static int delete(int BID) { return BLCategoryDAL.delete(BID); }
/// <summary> /// 添加大类 /// </summary> /// <returns></returns> public static int addBLCategory(string BLName) { return BLCategoryDAL.addBLCategory(BLName); }
public static SqlDataReader SelecBLIDtBook(int count, int page, int BLID) { return(BLCategoryDAL.SelecBLIDtBook(count, page, BLID)); }
public static List <BLCategory> SelectAll() { return(BLCategoryDAL.SelectAll()); }