Beispiel #1
0
    private void bindGaugeGrid(int custId)
    {
        try
        {
            string searchValue = txtsearchValue.Text.Trim();
            searchValue = Regex.Replace(searchValue, @"\s+", " ");
            string    stprocedure = "spGaugeDetails";
            DataTable dt          = new DataTable();
            if (ddlsortby.SelectedItem.Text == "--Select--")
            {
                DataSet ds = q.ProcdureWith8Param(stprocedure, 6, custId, 0, "", "", "", "", "");
                dt = ds.Tables[0];
            }
            else if (ddlsortby.SelectedItem.Text == "Gauge Id-Wise")
            {
                try
                {
                    int     gaugeId = Convert.ToInt32(searchValue);
                    DataSet ds      = q.ProcdureWith8Param(stprocedure, 2, 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.ProcdureWith8Param(stprocedure, 7, custId, 0, searchValue, "", "", "", "");
                dt = ds.Tables[0];
            }
            else if (ddlsortby.SelectedItem.Text == "Gauge Sr.No.-Wise")
            {
                DataSet ds = q.ProcdureWith8Param(stprocedure, 8, custId, 0, "", searchValue, "", "", "");
                dt = ds.Tables[0];
            }
            else if (ddlsortby.SelectedItem.Text == "Manufacture Id-Wise")
            {
                DataSet ds = q.ProcdureWith8Param(stprocedure, 9, custId, 0, "", "", searchValue, "", "");
                dt = ds.Tables[0];
            }
            else if (ddlsortby.SelectedItem.Text == "Size/Range-Wise")
            {
                DataSet ds = q.ProcdureWith8Param(stprocedure, 10, custId, 0, "", "", "", searchValue, "");
                dt = ds.Tables[0];
            }
            else if (ddlsortby.SelectedItem.Text == "Gauge Type-Wise")
            {
                DataSet ds = q.ProcdureWith8Param(stprocedure, 3, custId, 0, "", "", "", "", searchValue);
                dt = ds.Tables[0];
            }

            grdGauge.DataSource = dt;
            grdGauge.DataBind();

            checkAuthority();
        }
        catch (Exception ex)
        {
            g.ShowMessage(this.Page, ex.Message);
        }
    }