protected void lbtnUpdate_Click(object sender, EventArgs e) { if (this.objCheckPermision.Permission(this.objCheckPermision.LayQuyen("strThuongHieu_Sua"))) { try { foreach (ListViewDataItem lvit in this.lv_ThongTinSP.Items) { string BranchID; if (((HiddenField)lvit.FindControl("hfID")).Value != "") { BranchID = ((HiddenField)lvit.FindControl("hfID")).Value; } else { this.ltr_Notice.Text = this.objComm.ShowNotice( false, "Cập nhật thông tin thất bại.\nLỗi trong quá trình nhận dạng chi nhánh"); return; } Brand t0 = BrandDAO.Get(Int32.Parse(BranchID)); t0.Name = ((TextBox)lvit.FindControl("txtName")).Text; t0.Note = ((TextBox)lvit.FindControl("txtNote")).Text; ProductDAO.Update(); } this.ltr_Notice.Text = this.objComm.ShowNotice(true, "Cập nhật thông tin thành công!"); } catch (Exception ex) { this.ltr_Notice.Text = this.objComm.ShowNotice( false, "Cập nhật thông tin thất bại. Chi tiết lỗi: " + ex.Message); } } else { this.objComm.wr( "<script language='javascript'>alert('Bạn không có quyền thực hiện chức năng này.');location.href='thong-tin-san-pham';</script>"); } }
private void BinList() { this.lv_ThongTinSP.DataSource = BrandDAO.Get(); this.lv_ThongTinSP.DataBind(); }
public Brand Get(int id) { return(brandDAO.Get(id)); }