private void listAllQuestionOfRoom() { ListQuestionBSO listQuestionBSO = new ListQuestionBSO(); DataTable dt = new DataTable(); dt = listQuestionBSO.GetListQuestionAll(); DataView view1 = new DataView(dt); string strCate = GetCateParentIDArrayByID(); if (!string.IsNullOrEmpty(strCate)) { string restr = strCate.Remove(strCate.LastIndexOf(",")).Replace(",", "','"); view1.RowFilter = "CateNewsID in('" + restr + "')"; grvListQuestion.DataSource = view1; grvListQuestion.DataBind(); } }
private void listAllQuestionOfRoom(string RolesName_) { ListQuestionBSO listQuestionBSO = new ListQuestionBSO(); DataTable dt = new DataTable(); dt = listQuestionBSO.GetListQuestionAll(); DataView view1 = new DataView(dt); string strCate = GetCateParentIDArrayByID(); //Lay danh sach ID cua cac san pham if (RolesName_ == "Guest") { view1.RowFilter = "CreateUserName ='******'"; grvListQuestion.Columns[6].Visible = false; iconForUser(); } else if (!string.IsNullOrEmpty(strCate)) { string restr = strCate.Remove(strCate.LastIndexOf(",")).Replace(",", "','"); if (RolesName_ == "mod") //Nguoi quan ly nhom san pham { view1.RowFilter = "CateNewsID in('" + restr + "') or CreateUserName ='******'"; } } //else //{ // if (RolesName_ == "Guest") // { // view1.RowFilter = "CreateUserName ='******'"; // grvListQuestion.Columns[6].Visible = false; // iconForUser(); // } //} grvListQuestion.DataSource = view1; grvListQuestion.DataBind(); }