protected void btncapnhat(object sender, RepeaterCommandEventArgs e) { if (e.CommandName == "ChonTK") { string ID = e.CommandArgument.ToString(); LoaiSanPhamDTO lsp = LoaiSanPhamBUS.LayDSLoaiSanPhamID(ID); txtid.Text = lsp.MaLoaiSP; txttenloai.Text = lsp.TenLoaiSP; txtid.Enabled = false; } }
protected void btnCapNhat_Click(object sender, EventArgs e) { LoaiSanPhamDTO lsp = LoaiSanPhamBUS.LayDSLoaiSanPhamID(txtid.Text); lsp.TenLoaiSP = txttenloai.Text; if (LoaiSanPhamBUS.CapNhatLSP(lsp, txtid.Text)) { load(); Response.Write("<script>alert('Cập nhật loại sản phẩm thành công!')</script>"); } else { Response.Write("<script>alert('Cập nhật loại phẩm thất bại!')</script>"); } }