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

                    //DataSet ds = new DataSet();
                    //ds = iTotalTemp.GetInventoryBrActivityDetail(branchID, cldStartDt.SelectedDate.ToShortDateString(), reportType);
                    //dtTotal = ds.Tables[0];

                    dtTotal         = iTotal.GetInventoryBrActivityDetail(branchID, cldStartDt.SelectedDate.ToShortDateString(), reportType);
                    hidPeriod.Value = cldStartDt.SelectedDate.ToShortDateString();
                }
                else
                {
                    dtTotal = iTotal.GetInventoryBrActivityDetail(branchID, hidPeriod.Value, reportType);
                }

                if (dtTotal != null && dtTotal.Rows.Count > 0)
                {
                    sortExpression           = ((hidSort.Value != "") ? hidSort.Value : "TypeofTransaction 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;
            }
        }
Esempio n. 2
0
        public void BindDataGrid()
        {
            try
            {
                //DataSet ds = new DataSet();
                //ds = iTotalTemp.GetInventoryBrActivityDetail(Request.QueryString["Branch"].ToString(),Request.QueryString["Period"].ToString(), reportType);
                //dtTotal = ds.Tables[0];

                dtTotal = iTotal.GetInventoryBrActivityDetail(Request.QueryString["Branch"].ToString(), Request.QueryString["Period"].ToString(), reportType);

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