Esempio n. 1
0
 protected void suaDanhMuc_Command(object sender, CommandEventArgs e)
 {
     if (e.CommandName == "suaDanhMuc")
     {
         int     update  = Convert.ToInt16(e.CommandArgument);
         danhMuc danhMuc = getDanhMuc.get1danhMuc(update);
         Session["ma"] = danhMuc;
         Response.Redirect("SuaDanhMuc.aspx");
     }
 }
Esempio n. 2
0
 protected void btnaddcategory_Click(object sender, EventArgs e)
 {
     try
     {
         danhMuc danhMuc = new danhMuc();
         danhMuc.tendanhmuc = txtTenDanhMuc.Text;
         getDanhMuc.themDanhMuc(danhMuc);
         msgaddcategory.Text = "Thêm thành công";
     }
     catch
     {
         msgaddcategory.Text = "Có lỗi";
     }
 }
Esempio n. 3
0
 protected void btnupdatecategory_Click(object sender, EventArgs e)
 {
     try
     {
         danhMuc danhMuc = (danhMuc)Session["ma"];
         danhMuc.tendanhmuc = txtTenDanhMuc.Text;
         getDanhMuc.suaDanhMuc(danhMuc);
         msgudpatecategory.Text = "Cập nhật thành công";
     }
     catch
     {
         msgudpatecategory.Text = "Có lỗi, không cập nhật được";
     }
 }
Esempio n. 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["TaiKhoan"] != null)
     {
     }
     else
     {
         Response.Redirect("../../index.aspx");
     }
     if (!IsPostBack)
     {
         danhMuc danhMuc = (danhMuc)Session["ma"];
         txtTenDanhMuc.Text = danhMuc.tendanhmuc;
         DataBind();
     }
 }