private void bindMSATranHistoryGrd()
    {
        try
        {
            grdMSATranReport.DataSource = null;
            grdMSATranReport.DataBind();
            bool Status = g.CheckSuperAdmin(Convert.ToInt32(Session["User_ID"]));
            // Check super Admin condition
            #region supper Admin wise
            string searchValue = txtsearchValue.Text.Trim();
            searchValue = Regex.Replace(searchValue, @"\s+", " ");
            string    stprocedure = "spMSATransactionReport";
            DataTable dt          = new DataTable();

            if (Status == true)
            {
                if (ddlcust.SelectedIndex == 0)
                {
                    DataSet ds = q.ProcdureWith7Param(stprocedure, 1, 0, 0, "", "", "", "");
                    dt = ds.Tables[0];
                }
                if (ddlcust.SelectedIndex > 0)
                {
                    int custId = Convert.ToInt32(ddlcust.SelectedValue);

                    if (ddlsortby.SelectedItem.Text == "All")
                    {
                        DataSet ds = q.ProcdureWith7Param(stprocedure, 2, custId, 0, "", "", "", "");
                        dt = ds.Tables[0];
                    }
                    else if (ddlsortby.SelectedItem.Text == "Gauge Id-Wise")
                    {
                        try
                        {
                            int     gaugeId = Convert.ToInt32(searchValue);
                            DataSet ds      = q.ProcdureWith7Param(stprocedure, 3, custId, gaugeId, "", "", "", "");
                            dt = ds.Tables[0];
                        }
                        catch (Exception ex)
                        {
                            g.ShowMessage(this.Page, "Gauge Id is accept only numeric value. " + ex.Message);
                        }
                    }
                    else if (ddlsortby.SelectedItem.Text == "Gauge Name-Wise")
                    {
                        DataSet ds = q.ProcdureWith7Param(stprocedure, 4, custId, 0, searchValue, "", "", "");
                        dt = ds.Tables[0];
                    }
                    else if (ddlsortby.SelectedItem.Text == "Gauge Sr.No.-Wise")
                    {
                        DataSet ds = q.ProcdureWith7Param(stprocedure, 5, custId, 0, "", searchValue, "", "");
                        dt = ds.Tables[0];
                    }
                    else if (ddlsortby.SelectedItem.Text == "Manufacture Id-Wise")
                    {
                        DataSet ds = q.ProcdureWith7Param(stprocedure, 6, custId, 0, "", "", searchValue, "");
                        dt = ds.Tables[0];
                    }
                    else if (ddlsortby.SelectedItem.Text == "Gauge Type-Wise")
                    {
                        DataSet ds = q.ProcdureWith7Param(stprocedure, 7, custId, 0, "", "", "", searchValue);
                        dt = ds.Tables[0];
                    }
                }
                grdMSATranReport.DataSource = dt;
                grdMSATranReport.DataBind();
            }
            #endregion
            #region employee wise

            else
            {
                int custId = Convert.ToInt32(Session["Customer_ID"]);

                if (ddlsortby.SelectedItem.Text == "All")
                {
                    DataSet ds = q.ProcdureWith7Param(stprocedure, 2, custId, 0, "", "", "", "");
                    dt = ds.Tables[0];
                }
                else if (ddlsortby.SelectedItem.Text == "Gauge Id-Wise")
                {
                    try
                    {
                        int     gaugeId = Convert.ToInt32(searchValue);
                        DataSet ds      = q.ProcdureWith7Param(stprocedure, 3, custId, gaugeId, "", "", "", "");
                        dt = ds.Tables[0];
                    }
                    catch (Exception ex)
                    {
                        g.ShowMessage(this.Page, "Gauge Id is accept only numeric value. " + ex.Message);
                    }
                }
                else if (ddlsortby.SelectedItem.Text == "Gauge Name-Wise")
                {
                    DataSet ds = q.ProcdureWith7Param(stprocedure, 4, custId, 0, searchValue, "", "", "");
                    dt = ds.Tables[0];
                }
                else if (ddlsortby.SelectedItem.Text == "Gauge Sr.No.-Wise")
                {
                    DataSet ds = q.ProcdureWith7Param(stprocedure, 5, custId, 0, "", searchValue, "", "");
                    dt = ds.Tables[0];
                }
                else if (ddlsortby.SelectedItem.Text == "Manufacture Id-Wise")
                {
                    DataSet ds = q.ProcdureWith7Param(stprocedure, 6, custId, 0, "", "", searchValue, "");
                    dt = ds.Tables[0];
                }
                else if (ddlsortby.SelectedItem.Text == "Gauge Type-Wise")
                {
                    DataSet ds = q.ProcdureWith7Param(stprocedure, 7, custId, 0, "", "", "", searchValue);
                    dt = ds.Tables[0];
                }
                grdMSATranReport.DataSource = dt;
                grdMSATranReport.DataBind();
            }
            #endregion
            checkAuthority();
        }
        catch (Exception ex)
        {
            g.ShowMessage(this.Page, ex.Message);
        }
    }