public void BindList_CongViec() { string where = " NguoiNhan = " + _user.UserID.ToString(); if (ddl_User.SelectedIndex > 0) { where += " AND ( NguoiTao = " + ddl_User.SelectedValue.ToString() + " OR NguoiGiaoViec = " + ddl_User.SelectedValue.ToString() + ")"; } if (!String.IsNullOrEmpty(txt_NgayTao.Text.Trim())) { where += " AND " + string.Format(" NgayTao >='{0}'", this.txt_NgayTao.Text.Trim() + " 00:00:00"); } if (!String.IsNullOrEmpty(txt_Ngayhoanthanh.Text.Trim())) { where += " AND " + string.Format(" NgayHoanthanh <='{0}'", this.txt_Ngayhoanthanh.Text.Trim() + " 23:59:59"); } CongviecDAL _DAL = new CongviecDAL(); DataSet _ds; pages.PageSize = Global.MembersPerPage; _ds = _DAL.BindGridT_Congviec(pages.PageIndex, pages.PageSize, where); int TotalRecords = Convert.ToInt32(_ds.Tables[1].Rows[0].ItemArray[0].ToString()); int TotalRecord = Convert.ToInt32(_ds.Tables[0].Rows.Count); if (TotalRecord == 0) { _ds = _DAL.BindGridT_Congviec(pages.PageIndex - 1, pages.PageSize, where); } if (_ds.Tables[0].Rows.Count > 0) { grdListCVCanLam.DataSource = _ds; grdListCVCanLam.DataBind(); } else { _ds.Tables[0].Rows.Add(_ds.Tables[0].NewRow()); grdListCVCanLam.DataSource = _ds; grdListCVCanLam.DataBind(); int columncount = grdListCVCanLam.Items[0].Cells.Count; grdListCVCanLam.Items[0].Cells.Clear(); grdListCVCanLam.Items[0].Cells.Add(new TableCell()); grdListCVCanLam.Items[0].Cells[0].ColumnSpan = columncount; grdListCVCanLam.Items[0].Cells[0].Text = "Không có bản ghi nào"; } pages.TotalRecords = curentPages.TotalRecords = TotalRecords; curentPages.TotalPages = pages.CalculateTotalPages(); curentPages.PageIndex = pages.PageIndex; Session["CurrentPage"] = pages.PageIndex; }
//Phần danh sách công việc #region public void BindList_CongViec() { string where = " NguoiNhan = " + _user.UserID.ToString() + " OR NguoiTao = " + _user.UserID.ToString() + " OR NguoiGiaoViec = " + _user.UserID.ToString() + " "; CongviecDAL _DAL = new CongviecDAL(); DataSet _ds; pages.PageSize = 8; _ds = _DAL.BindGridT_Congviec(pages.PageIndex, pages.PageSize, where); int TotalRecords = Convert.ToInt32(_ds.Tables[1].Rows[0].ItemArray[0].ToString()); int TotalRecord = Convert.ToInt32(_ds.Tables[0].Rows.Count); if (TotalRecord == 0) { _ds = _DAL.BindGridT_Congviec(pages.PageIndex - 1, pages.PageSize, where); } if (_ds.Tables[0].Rows.Count > 0) { grdList.DataSource = _ds; grdList.DataBind(); } else { _ds.Tables[0].Rows.Add(_ds.Tables[0].NewRow()); grdList.DataSource = _ds; grdList.DataBind(); int columncount = grdList.Items[0].Cells.Count; grdList.Items[0].Cells.Clear(); grdList.Items[0].Cells.Add(new TableCell()); grdList.Items[0].Cells[0].ColumnSpan = columncount; grdList.Items[0].Cells[0].Text = "Không có bản ghi nào"; } pages.TotalRecords = curentPages.TotalRecords = TotalRecords; curentPages.TotalPages = pages.CalculateTotalPages(); curentPages.PageIndex = pages.PageIndex; Session["CurrentPage"] = pages.PageIndex; }
public void BindListGiaoViec() { string where = _GetWhereGiaoViec(); CongviecDAL _DAL = new CongviecDAL(); DataSet _ds; pages.PageSize = Global.MembersPerPage; _ds = _DAL.BindGridT_Congviec(pages.PageIndex, pages.PageSize, where); int TotalRecords = Convert.ToInt32(_ds.Tables[1].Rows[0].ItemArray[0].ToString()); int TotalRecord = Convert.ToInt32(_ds.Tables[0].Rows.Count); if (TotalRecord == 0) { _ds = _DAL.BindGridT_Congviec(pages.PageIndex - 1, pages.PageSize, where); } if (_ds.Tables[0].Rows.Count > 0) { grdListTheodoi.DataSource = _ds; grdListTheodoi.DataBind(); } else { _ds.Tables[0].Rows.Add(_ds.Tables[0].NewRow()); grdListTheodoi.DataSource = _ds; grdListTheodoi.DataBind(); int columncount = grdListTheodoi.Items[0].Cells.Count; grdListTheodoi.Items[0].Cells.Clear(); grdListTheodoi.Items[0].Cells.Add(new TableCell()); grdListTheodoi.Items[0].Cells[0].ColumnSpan = columncount; grdListTheodoi.Items[0].Cells[0].Text = "Không có bản ghi nào"; } pages.TotalRecords = curentPages.TotalRecords = TotalRecords; curentPages.TotalPages = pages.CalculateTotalPages(); curentPages.PageIndex = pages.PageIndex; Session["CurrentPage"] = pages.PageIndex; }