コード例 #1
0
 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>");
     }
 }
コード例 #2
0
 private void BinList()
 {
     this.lv_ThongTinSP.DataSource = BrandDAO.Get();
     this.lv_ThongTinSP.DataBind();
 }
コード例 #3
0
 public Brand Get(int id)
 {
     return(brandDAO.Get(id));
 }