public void LoadData() { int nPageNumber = int.Parse(txtPageNumber.Text); int nPageSize = int.Parse(txtPageSize.Text); SessionUserLogin nUserLogin = (SessionUserLogin)Session["UserLogin"]; DataTable nTable = History_Data.GetDetail(key, nPageSize, nPageNumber); if (nTable.Rows.Count == 0) { nTable.Rows.Add(null, "", 0); } nTable.Columns.Add(); GV_History.DataSource = nTable; GV_History.DataBind(); DateTime dt = DateTime.Now; //txtfromDatetime.Text = "01/" + DateTime.Now.ToString("MM/yyyy"); //txttoDatetime.Text = DateTime.Now.ToString("dd/MM/yyyy"); LoadPages(); }
protected void Page_Load(object sender, EventArgs e) { SessionUserLogin nUserLogin = (SessionUserLogin)Session["UserLogin"]; key = Request["Key"].ToInt(); if (nUserLogin != null) { //nUserLogin.CheckRole("CU0002"); //if (!nUserLogin.Role.Read) //{ // //Response.Write("<script >alert('Bạn không có quyền xem danh mục này!')</script>"); // Response.Write("<script >window.location.href='Error.aspx';</script>"); //} //else { if (!IsPostBack) { int nPageNumber = int.Parse(txtPageNumber.Text); int nPageSize = int.Parse(txtPageSize.Text); DataTable nTable = History_Data.GetDetail(key, nPageSize, nPageNumber); //string listseeds = ""; //for (int i = 0; i < nTable.Rows.Count; i++) //{ // if (i < nTable.Rows.Count - 1) // { // listseeds += nTable.Rows[i]["Name"].ToString() + ","; // } // else // { // listseeds += nTable.Rows[i]["Name"].ToString(); // } //} //LoadDataToToolboxWeb.DropDown_DDL(DDLSeeds, "Select SeedsName,SeedsName from PUL_Seeds where SeedsKey IN (" + listseeds + ")", false); // LoadDataToToolboxWeb.DropDown_DDL(DDLSeeds, "Select SeedsName,SeedsName from PUL_Seeds where SeedsKey IN(Select SeedsKey from PUL_SeedProcess where dbo.PUL_SeedProcess.MemberKey = " + Convert.ToInt16(Session["EmployeeKey"]).ToString() + ")", false); LoadData(); } } } }