public void BindDataGrid() { try { //dtTotal = iTotal.GetInventoryByCategoryBranchItem(Request.QueryString["Period"].ToString(), Request.QueryString["Category"].ToString(), Request.QueryString["Branch"].ToString()); dtTotal = iTotal.GetInventoryByCategoryBranchItem(Request.QueryString["Period"].ToString(), Request.QueryString["Category"].ToString(), Request.QueryString["Branch"].ToString(), pkgType); if (dtTotal != null && dtTotal.Rows.Count > 0) { dtTotal.DefaultView.Sort = Request.QueryString["Sort"].ToString(); dvBIOnhand.DataSource = dtTotal.DefaultView.ToTable(); dvBIOnhand.DataBind(); dvBIOnhand.Visible = true; lblStatus.Visible = false; } else { dvBIOnhand.Visible = false; lblStatus.Visible = true; lblStatus.Text = "No Records Found"; } } catch (Exception ex) { throw; } }
public void BindDataGrid() { try { if (sort == "") { lblPeriod.Text = "Period : " + cldStartDt.SelectedDate.ToShortDateString(); // dtTotal = iTotal.GetInventoryByCategoryBranchItem(cldStartDt.SelectedDate.ToShortDateString(), categoryID, branchID); hidPeriod.Value = cldStartDt.SelectedDate.ToShortDateString(); } if (ddlPkgType.SelectedValue == "ALL") { dtTotal = iTotal.GetInventoryByCategoryBranchItem(hidPeriod.Value, categoryID, branchID, ddlPkgType.SelectedValue = "ALL"); //Pete added 11/17/2011 } else if (ddlPkgType.SelectedValue == "PKG") { dtTotal = iTotal.GetInventoryByCategoryBranchItem(hidPeriod.Value, categoryID, branchID, ddlPkgType.SelectedValue = "PKG"); //Pete added 11/17/2011 } else if (ddlPkgType.SelectedValue == "BULK") { dtTotal = iTotal.GetInventoryByCategoryBranchItem(hidPeriod.Value, categoryID, branchID, ddlPkgType.SelectedValue = "BULK"); //Pete added 11/17/2011 } else { dtTotal = iTotal.GetInventoryByCategoryBranchItem(hidPeriod.Value, categoryID, branchID); } if (dtTotal != null && dtTotal.Rows.Count > 0) { sortExpression = ((hidSort.Value != "") ? hidSort.Value : "ItemNo asc"); dtTotal.DefaultView.Sort = sortExpression; dvBIOnhand.DataSource = dtTotal.DefaultView.ToTable(); Pager.InitPager(dvBIOnhand, pagesize); dvBIOnhand.Visible = true; lblStatus.Visible = false; Pager.Visible = true; } else { dvBIOnhand.Visible = false; lblStatus.Visible = true; Pager.Visible = false; lblStatus.Text = "No Records Found"; } upnlGrid.Update(); if (hidShowMode.Value == "Show") { ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "ShoW", "ShowPanel();", true); } else if (hidShowMode.Value == "ShowL") { ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "ShoWL", "ShowHide('Show');", true); } else if (hidShowMode.Value == "HideL") { ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "ShoWL", "ShowHide('Hide');", true); } } catch (Exception ex) { throw; } }