コード例 #1
0
        public void BindDataGrid()
        {
            try
            {
                //dtTotal = iTotal.GetInventoryByCategoryBranch(Request.QueryString["Period"].ToString(), Request.QueryString["Category"].ToString());
                dtTotal = iTotal.GetInventoryByCategoryBranch(Request.QueryString["Period"].ToString(), Request.QueryString["Category"].ToString(), pkgType);


                if (dtTotal != null && dtTotal.Rows.Count > 0)
                {
                    dtTotal.DefaultView.Sort = Request.QueryString["Sort"].ToString();
                    dvBIOnhand.DataSource    = dtTotal.DefaultView.ToTable();
                    dvBIOnhand.Visible       = true;
                    lblStatus.Visible        = false;
                    dvBIOnhand.DataBind();
                }
                else
                {
                    dvBIOnhand.Visible = false;
                    lblStatus.Visible  = true;
                    lblStatus.Text     = "No Records Found";
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #2
0
        public void BindDataGrid()
        {
            try
            {
                if (sort == "")
                {
                    lblPeriod.Text  = "Period : " + cldStartDt.SelectedDate.ToShortDateString();
                    hidPeriod.Value = cldStartDt.SelectedDate.ToShortDateString();
                    //dtTotal = iTotal.GetInventoryByCategoryBranch(cldStartDt.SelectedDate.ToShortDateString(),category);
                }

                if (ddlPkgType.SelectedValue == "ALL")
                {
                    dtTotal = iTotal.GetInventoryByCategoryBranch(hidPeriod.Value, category, ddlPkgType.SelectedValue = "ALL");  //Pete added 11/17/2011
                }
                else if (ddlPkgType.SelectedValue == "PKG")
                {
                    dtTotal = iTotal.GetInventoryByCategoryBranch(hidPeriod.Value, category, ddlPkgType.SelectedValue = "PKG"); //Pete added 11/17/2011
                }
                else if (ddlPkgType.SelectedValue == "BULK")
                {
                    dtTotal = iTotal.GetInventoryByCategoryBranch(hidPeriod.Value, category, ddlPkgType.SelectedValue = "BULK"); //Pete added 11/17/2011
                }


                else
                {
                    dtTotal = iTotal.GetInventoryByCategoryBranch(hidPeriod.Value, category);
                }

                if (dtTotal != null && dtTotal.Rows.Count > 0)
                {
                    sortExpression           = ((hidSort.Value != "") ? hidSort.Value : "Branch asc");
                    dtTotal.DefaultView.Sort = sortExpression;
                    dvBIOnhand.DataSource    = dtTotal.DefaultView.ToTable();
                    dvBIOnhand.Visible       = true;
                    lblStatus.Visible        = false;
                    dvBIOnhand.DataBind();
                }
                else
                {
                    dvBIOnhand.Visible = false;
                    lblStatus.Visible  = true;
                    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;
            }
        }