protected void btnSave2_Click(object sender, EventArgs e) { Page.Validate("CheckPageSize"); if (Page.IsValid == true) { if (CheckForPageSize(Convert.ToInt32(txtPageSize.Text)) == false) { if (BAL_Paging.InsertUpdatePagingInfo(Convert.ToInt32(lblMode.Text), Convert.ToInt32(txtPageSize.Text)) == true) { if (Convert.ToInt32(lblMode.Text) != 0) { ShowMessage("Record updated successfully."); } else { ShowMessage("Record inserted successfully."); } FillGrid(); txtPageSize.Text = string.Empty; lblMode.Text = "0"; } else { ShowMessage("Error in record insertion."); } } else { ShowMessage("Page Size is already inserted!"); } } }
private void FillDropDown() { DataTable table = BAL_Paging.SelectPagingInfo(); ddlPerpage.DataSource = table; ddlPerpage.DataTextField = table.Columns["PageSize"].ToString(); ddlPerpage.DataValueField = table.Columns["PageSize"].ToString(); ddlPerpage.DataBind(); ddlPerpage.Items.Insert(0, new ListItem("Default", "-1")); //ddlAgeFrom.Items.Clear(); //ddlAgeTo.Items.Clear(); //for (int i = 1; i < 50; i++) //{ // ddlAgeFrom.Items.Add(new ListItem(i.ToString(), i.ToString())); // ddlAgeTo.Items.Add(new ListItem(i.ToString(), i.ToString())); //} //ddlMileageFrom.Items.Clear(); //ddlMileageTo.Items.Clear(); //for (int i = 0; i < 100000; i += 5000) //{ // ddlMileageFrom.Items.Add(new ListItem(i.ToString(), i.ToString())); // ddlMileageTo.Items.Add(new ListItem(i.ToString(), i.ToString())); //} }
private void FillPageSize() { DataTable table = BAL_Paging.GetPageInfo(); if (table != null && table.Rows.Count > 0) { txtAdminPageSize.Text = Convert.ToString(table.Rows[0]["AdminPageSize"]); txtFrontPageSize.Text = Convert.ToString(table.Rows[0]["FrontPageSize"]); } }
private void FillDropDown() { DataTable table = BAL_Paging.SelectPagingInfo(); ddlPerpage.DataSource = table; ddlPerpage.DataTextField = table.Columns["PageSize"].ToString(); ddlPerpage.DataValueField = table.Columns["PageSize"].ToString(); ddlPerpage.DataBind(); ddlPerpage.Items.Insert(0, new ListItem("Default", "-1")); }
private void FillGrid() { int TotalCount; gvPagingGrid.PageIndex = gvIndex; DataTable table = BAL_Paging.GetPagingInfo(gvPagingGrid.PageIndex, gvPagingGrid.PageSize, gvPagingGrid.OrderBy, out TotalCount); gvPagingGrid.VirtualItemCount = TotalCount; gvPagingGrid.DataSource = table; gvPagingGrid.DataBind(); HideDispControl(); }
protected void btnSave1_Click(object sender, EventArgs e) { Page.Validate("CheckForPageSize"); if (Page.IsValid == true) { if (BAL_Paging.UpdatePageInfo(Convert.ToInt32(txtAdminPageSize.Text), Convert.ToInt32(txtFrontPageSize.Text)) == true) { FillGrid(); ShowMessage("Record inserted successfully!"); } else { ShowMessage("Error in record insertion!"); } } }
protected void btnInActive_Click(object sender, EventArgs e) { string _strId = GetPagingId(); if (!string.IsNullOrEmpty(_strId)) { if (BAL_Paging.ActivatePagingInfo(_strId.Substring(1), false) == true) { ShowMessage("Record activated successfully!"); FillGrid(); } else { ShowMessage("Error in record activation!"); } } }
protected override void OnLoad(EventArgs e) { DataTable table = BAL_Paging.GetPageInfo(); if (table == null || table.Rows.Count <= 0) { this.DefaultAdminPageSize = 10; this.DefaultFrontPageSize = 10; } else { this.DefaultAdminPageSize = Convert.ToInt32(table.Rows[0]["AdminPageSize"]); this.DefaultFrontPageSize = Convert.ToInt32(table.Rows[0]["FrontPageSize"]); } base.OnLoad(e); base.MaintainScrollPositionOnPostBack = true; }
protected override void OnLoad(EventArgs e) { if (Session["AccountDetail"] == null) { Response.Redirect("~/AdminLogin.aspx"); } else { DataTable table = BAL_Paging.GetPageInfo(); if (table == null || table.Rows.Count <= 0) { this.DefaultAdminPageSize = 10; this.DefaultFrontPageSize = 10; } else { this.DefaultAdminPageSize = Convert.ToInt32(table.Rows[0]["AdminPageSize"]); this.DefaultFrontPageSize = Convert.ToInt32(table.Rows[0]["FrontPageSize"]); } } base.OnLoad(e); //this.ValidateRequest = false; }