Ejemplo n.º 1
0
    private void bindIssueGrd(int custId)
    {
        try
        {
            grdIssueStatus.DataSource = null;
            grdIssueStatus.DataBind();
            string searchValue = txtsearchValue.Text.Trim();
            searchValue = Regex.Replace(searchValue, @"\s+", " ");
            string    stprocedure = "spIssueDetails";
            DataTable dt          = new DataTable();
            if (ddlsortby.SelectedIndex == 0)
            {
                DataSet ds = q.ProcdureWith6Param(stprocedure, 1, custId, 0, "", "", "");
                dt = ds.Tables[0];
            }
            if (ddlsortby.SelectedIndex == 1)
            {
                DataSet ds = q.ProcdureWith6Param(stprocedure, 3, custId, 0, "", searchValue, "");
                dt = ds.Tables[0];
            }
            else if (ddlsortby.SelectedIndex == 2)
            {
                DataSet ds = q.ProcdureWith6Param(stprocedure, 4, custId, 0, "", "", searchValue);
                dt = ds.Tables[0];
            }
            else if (ddlsortby.SelectedIndex == 3)
            {
                DataSet ds = q.ProcdureWith6Param(stprocedure, 6, custId, 0, searchValue, "", "");
                dt = ds.Tables[0];
            }
            else if (ddlsortby.SelectedIndex == 4)
            {
                try
                {
                    int     issueid = Convert.ToInt32(searchValue);
                    DataSet ds      = q.ProcdureWith6Param(stprocedure, 5, custId, issueid, "", "", "");
                    dt = ds.Tables[0];
                }
                catch (Exception ex)
                {
                    g.ShowMessage(this.Page, "Issue Id is accept only numeric value. " + ex.Message);
                }
            }



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

            checkAuthority();
        }
        catch (Exception ex)
        {
            g.ShowMessage(this.Page, ex.Message);
        }
    }
Ejemplo n.º 2
0
    private void bindGaugeSupplierGrd(int custId)
    {
        try
        {
            string    stprocedure = "spGaugeSupplier";
            DataTable dt          = new DataTable();
            if (ddlsortby.SelectedItem.Text == "--Select--")
            {
                DataSet ds = q.ProcdureWith6Param(stprocedure, 1, custId, "", "", "", "");
                dt = ds.Tables[0];
            }
            else if (ddlsortby.SelectedItem.Text == "Gauge Name-Wise")
            {
                DataSet ds = q.ProcdureWith6Param(stprocedure, 2, custId, txtsearchValue.Text, "", "", "");
                dt = ds.Tables[0];
            }
            else if (ddlsortby.SelectedItem.Text == "Gauge Sr.No.-Wise")
            {
                DataSet ds = q.ProcdureWith6Param(stprocedure, 4, custId, "", txtsearchValue.Text, "", "");
                dt = ds.Tables[0];
            }
            else if (ddlsortby.SelectedItem.Text == "Supplier Name-Wise")
            {
                DataSet ds = q.ProcdureWith6Param(stprocedure, 5, custId, "", "", txtsearchValue.Text, "");
                dt = ds.Tables[0];
            }
            else if (ddlsortby.SelectedItem.Text == "Gauge Type-Wise")
            {
                DataSet ds = q.ProcdureWith6Param(stprocedure, 6, custId, "", "", "", txtsearchValue.Text);
                dt = ds.Tables[0];
            }

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

            checkAuthority();
        }
        catch (Exception ex)
        {
            g.ShowMessage(this.Page, ex.Message);
        }
    }
Ejemplo n.º 3
0
    private void bindIssueReportGrd()
    {
        try
        {
            Session["AllPrintData"] = null;
            dtPrint = null;


            bool   Status      = g.CheckSuperAdmin(Convert.ToInt32(Session["User_ID"]));
            string stprocedure = "spIssueDetails";
            // Check super Admin condition
            #region Supper admin
            if (Status == true)
            {
                if (ddlcust.SelectedIndex == 0)
                {
                    DataSet ds = q.ProcdureWith6Param(stprocedure, 2, 0, 0, "", "", "");
                    grdIssueReport.DataSource = ds.Tables[0];

                    grdIssueReport.DataBind();

                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        Session["AllPrintData"] = ds.Tables[0];
                    }
                    else
                    {
                        Session["AllPrintData"] = null;
                    }
                }
                else if (ddlcust.SelectedIndex > 0)
                {
                    fillSortWiseData(Convert.ToInt32(ddlcust.SelectedValue));
                }
            }
            #endregion
            #region Employee wise
            else
            {
                fillSortWiseData(Convert.ToInt32(Session["Customer_ID"]));
            }
            #endregion

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