Ejemplo n.º 1
0
        public void BindDataGrid()
        {
            try
            {
                lblPeriod.Text = "Period : " + cldStartDt.SelectedDate.ToShortDateString();

                dtTotal = iTotal.GetBranchInventoryOnHand(cldStartDt.SelectedDate.ToShortDateString());


                if (dtTotal != null && dtTotal.Rows.Count > 0)
                {
                    sortExpression                   = ((hidSort.Value != "") ? hidSort.Value : "Branch asc");
                    dtTotal.DefaultView.Sort         = sortExpression;
                    Session["BranchInventoryOnHand"] = dtTotal.DefaultView.ToTable();
                    dvBIOnhand.DataSource            = dtTotal.DefaultView.ToTable();
                    dvBIOnhand.Visible               = true;
                    lblStatus.Visible                = false;
                    dvBIOnhand.DataBind();
                }
                else
                {
                    Session["BranchInventoryOnHand"] = null;
                    dvBIOnhand.Visible = false;
                    lblStatus.Visible  = true;
                    lblStatus.Text     = "No Records Found";
                }


                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;
            }
        }
        public void BindDataGrid()
        {
            try
            {
                dtBranchInventory = iTotal.GetBranchInventoryOnHand(Request.QueryString["Period"].ToString(), pkgType);

                if (dtBranchInventory != null && dtBranchInventory.Rows.Count > 0)
                {
                    sortExpression = ((Request.QueryString["Sort"].ToString() != "") ? Request.QueryString["Sort"].ToString() : "Branch asc");
                    showUsage      = Request.QueryString["ShowUsage"].ToString();

                    if (showUsage == "true")
                    {
                        dvBIOnhand.Columns[7].Visible  = true;
                        dvBIOnhand.Columns[8].Visible  = true;
                        dvBIOnhand.Columns[9].Visible  = true;
                        dvBIOnhand.Columns[10].Visible = true;
                        dvBIOnhand.Width = (Unit)900;
                    }
                    else
                    {
                        dvBIOnhand.Columns[7].Visible  = false;
                        dvBIOnhand.Columns[8].Visible  = false;
                        dvBIOnhand.Columns[9].Visible  = false;
                        dvBIOnhand.Columns[10].Visible = false;
                        dvBIOnhand.Width = (Unit)600;
                    }

                    dtBranchInventory.DefaultView.Sort = sortExpression;
                    dvBIOnhand.DataSource = dtBranchInventory.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;
            }
        }
Ejemplo n.º 3
0
        public void BindDataGrid()
        {
            try
            {
                if (sort == "")
                {
                    lblPeriod.Text  = "Period : " + cldStartDt.SelectedDate.ToShortDateString();
                    hidPeriod.Value = cldStartDt.SelectedDate.ToShortDateString();
                }
                if (ddlPkgType.SelectedValue == "ALL" && hidPeriod.Value == cldStartDt.VisibleDate.ToString())
                {
                    dtTotal = iTotal.GetBranchInventoryOnHand(hidPeriod.Value, ddlPkgType.SelectedValue = "ALL");
                }
                else if (ddlPkgType.SelectedValue == "PKG")
                {
                    dtTotal = iTotal.GetBranchInventoryOnHand(hidPeriod.Value, ddlPkgType.SelectedValue = "PKG");
                }
                else if (ddlPkgType.SelectedValue == "BULK")
                {
                    dtTotal = iTotal.GetBranchInventoryOnHand(hidPeriod.Value, ddlPkgType.SelectedValue = "BULK");
                }
                else if (ddlPkgType.SelectedValue == "ALL")
                {
                    dtTotal = iTotal.GetBranchInventoryOnHand(hidPeriod.Value, "ALL");
                }

                if (dtTotal != null && dtTotal.Rows.Count > 0)
                {
                    if (chkShowUsage.Checked)
                    {
                        dvBIOnhand.Columns[8].Visible  = true;
                        dvBIOnhand.Columns[9].Visible  = true;
                        dvBIOnhand.Columns[10].Visible = true;
                        dvBIOnhand.Columns[11].Visible = true;
                    }
                    else
                    {
                        dvBIOnhand.Columns[8].Visible  = false;
                        dvBIOnhand.Columns[9].Visible  = false;
                        dvBIOnhand.Columns[10].Visible = false;
                        dvBIOnhand.Columns[11].Visible = false;
                    }

                    sortExpression                   = ((hidSort.Value != "") ? hidSort.Value : "Branch asc");
                    dtTotal.DefaultView.Sort         = sortExpression;
                    Session["BranchInventoryOnHand"] = dtTotal.DefaultView.ToTable();
                    Session["DropDownSelVal"]        = ddlPkgType.SelectedValue;
                    dvBIOnhand.DataSource            = dtTotal.DefaultView.ToTable();
                    dvBIOnhand.Visible               = true;
                    lblStatus.Visible                = false;
                    dvBIOnhand.DataBind();
                }
                else
                {
                    Session["BranchInventoryOnHand"] = null;
                    dvBIOnhand.Visible = false;
                    lblStatus.Visible  = true;
                    lblStatus.Text     = "No Records Found";
                }


                upnlGrid.Update();
                ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "process", "window.parent.document.getElementById('Progress').style.display='none';", true);


                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;
            }
        }