protected void ddlrpt_change(object sender, EventArgs e)
        {
            DataSet ds = Reportgenrator.Getrpt("select * from  tbl_rpt_details where rptid=" + ddlrpt.SelectedValue);

            if (ds.Tables[0].Rows.Count > 0)
            {
                hfdquery.Value = ds.Tables[0].Rows[0]["query"].ToString();
                hfdfltrs.Value = ds.Tables[0].Rows[0]["fltrs"].ToString();
                hfdcols.Value  = ds.Tables[0].Rows[0]["ordby"].ToString();
            }
            ScriptManager.RegisterStartupScript(Page, GetType(), "js", "afterbind()", true);
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ddlrpt.DataSource     = Reportgenrator.Getrpt("select rptname,rptid from tbl_rpt_details  where rpttype like 'L' order by rptname");
         ddlrpt.DataTextField  = "rptname";
         ddlrpt.DataValueField = "rptid";
         ddlrpt.DataBind();
         if (ddlrpt.SelectedIndex != -1)
         {
             ddlrpt_change(null, null);
         }
     }
 }
예제 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var count = Request.QueryString.Count;

            if (!IsPostBack)
            {
                string pid = "0";

                if (Request.QueryString["pid"] != null)
                {
                    pid = Request.QueryString["pid"].ToString();
                }

                if (Request.QueryString.Count == 3 || (Request.QueryString.Count == 4 && pid == "0"))
                {
                    tbl_print obj   = Reportgenrator.Get_printbyid(Request.QueryString[1].ToString());
                    string    query = "select * from [" + obj.Vwname + "] where [" + obj.fltrcol + "]='" + Request.QueryString[2].ToString() + "'";
                    DataSet   ds    = Reportgenrator.Getrpt(query);
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        dr = ds.Tables[0].Rows[0];
                    }
                }
                else
                if (pid != "0")
                {
                    tbl_print obj   = Reportgenrator.Get_printbyid(Request.QueryString[1].ToString());
                    string    query = "select * from [" + obj.Vwname + "] where [" + obj.fltrcol + "]='" + Request.QueryString[2].ToString() + "' and perid=" + Request.QueryString["pid"].ToString();
                    DataSet   ds    = Reportgenrator.Getrpt(query);
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        dr = ds.Tables[0].Rows[0];
                    }
                }
                else
                if (Request.QueryString.Count == 4)
                {
                    tbl_print obj   = Reportgenrator.Get_printbyid(Request.QueryString[1].ToString());
                    string    query = "select * from [" + obj.Vwname + "] where [" + obj.fltrcol + "]='" + Request.QueryString[2].ToString() + "'";
                    DataSet   ds    = Reportgenrator.Getrpt(query);
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        dr = ds.Tables[0].Rows[0];
                    }
                    DataList dtl = (DataList)this.Page.FindControl("dtlstresp");
                    dtl.DataSource = Getrespondents();
                    dtl.DataBind();
                }
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ddlrpt.DataSource     = Reportgenrator.Getrpt("select rptname,rptid from tbl_rpt_details  where rpttype like 'C' order by rptname");
         ddlrpt.DataTextField  = "rptname";
         ddlrpt.DataValueField = "rptid";
         ddlrpt.DataBind();
         if (ddlrpt.SelectedIndex != -1)
         {
             ddlrpt_change(null, null);
         }
         chk_lictypes.DataSource     = Reportgenrator.GetLicensetype();
         chk_lictypes.DataTextField  = "License_Type";
         chk_lictypes.DataValueField = "LicenseType_ID";
         chk_lictypes.DataBind();
         CheckBoxList_SelectedIndexChanged1(null, null);
     }
 }