protected void btDanhMuc_Click(object sender, EventArgs e)
 {
     if (tbDanhMuc.Text.Trim().Length == 0)
         lbError.Text = "Chưa nhập tên danh mục";
     else
     {
         string cmdText = string.Format("EXEC [bc_setsNhan] @userID={0}, @tenNhan=N'{1}'", UserId, tbDanhMuc.Text);
         csBaoCao ob = new csBaoCao();
         ob.executeData(cmdText);
         tbDanhMuc.Text = "";
         lbError.Text = "Thêm danh mục thành công";
         getsNhanBC();
     }
 }
Example #2
0
 protected void btCapNhat_Click(object sender, EventArgs e)
 {
     if (tbTenNhom.Text.Trim() == "")
     {
         lbError.Text = "Chưa nhập tên nhóm";
         return;
     }
     string thanhVien = "";
     for (int i = 0; i < gvThanhVien.Rows.Count; i++)
     {
         bool check = ((CheckBox)gvThanhVien.Rows[i].FindControl("CheckBox1")).Checked;
         if (check) thanhVien += ", " + gvThanhVien.Rows[i].Cells[1].Text;
     }
     if (thanhVien.Length < 2)
     {
         lbError.Text = "Chưa chọn thành viên trong nhóm";
         return;
     }
     else thanhVien = thanhVien.Remove(0, 2);
     string nhomID = lbIDSua.Text == "" ? "0" : lbIDSua.Text;
     string cmdText = string.Format("EXEC [bc_setsNhom] @userID={0}, @nhomID={1}, @tenNhom=N'{2}', @thanhVien=N'{3}'",
         UserId, nhomID, tbTenNhom.Text, thanhVien);
     csBaoCao ob = new csBaoCao();
     ob.executeData(cmdText);
     lbError.Text = "Cập nhật nhóm người nhận thành công";
     getNhom();
     lbIDSua.Text = "";
     tbTenNhom.Text = "";
     getThanhVien(lbIDSua.Text);
 }