Пример #1
0
        protected void chb_chnage(object sender, EventArgs e)
        {
            CheckBox chb  = (CheckBox)sender;
            string   js   = "";
            string   cols = "";

            if (chb.Checked)
            {
                List <USP_getallcolumnsResult> obj = Reportgenrator.Getallcolumns(chb.ToolTip);
                for (int i = 0; i < obj.Count; i++)
                {
                    cols += obj[i].COLUMN_NAME + "~" + obj[i].DATA_TYPE + "~" + obj[i].CHARACTER_MAXIMUM_LENGTH.ToString() + "^";
                }
                if (cols.Length > 0)
                {
                    cols = cols.Substring(0, cols.Length - 1);
                }

                js = "createtable('" + chb.ToolTip + "','" + cols + "');";
                ddlmtables.Items.Add(new ListItem(chb.ToolTip));
            }
            else
            {
                js = "removetable('" + chb.ToolTip + "');";
                ddlmtables.Items.Remove(ddlmtables.Items.FindByText(chb.ToolTip));
            }
            ScriptManager.RegisterStartupScript(Page, GetType(), "js", js, true);
        }
Пример #2
0
 protected void ddlrpt_change(object sender, EventArgs e)
 {
     if (ddlrpt.SelectedValue != "22")
     {
         chklicensetypes.Visible = false;
         btngenerate.Visible     = false;
         lblcounty.Visible       = false;
         ddl_county.Visible      = false;
         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);
     }
     else
     {
         lblcounty.Visible       = true;
         ddl_county.Visible      = true;
         chklicensetypes.Visible = true;
         btngenerate.Visible     = true;
         ScriptManager.RegisterStartupScript(Page, GetType(), "js", "HideDivandResultPanel()", true);
     }
 }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ddlrpt.DataSource     = Reportgenrator.Getrpt("select rptname,rptid from tbl_rpt_details  where rpttype like 'R' order by rptname");
                ddlrpt.DataTextField  = "rptname";
                ddlrpt.DataValueField = "rptid";
                ddlrpt.DataBind();
                if (ddlrpt.SelectedIndex != -1)
                {
                    ddlrpt_change(null, null);
                }

                chklicensetypes.DataSource     = Reportgenrator.GetLicensetype();
                chklicensetypes.DataTextField  = "License_Type";
                chklicensetypes.DataValueField = "LicenseType_ID";
                chklicensetypes.DataBind();

                ddl_county.DataSource     = Person_Details.Licensing_Details.Get_Lkp_tablesdata(10);
                ddl_county.DataValueField = "Lkp_data_ID";
                ddl_county.DataTextField  = "Values";
                ddl_county.DataBind();
                ddl_county.Items.Insert(0, new ListItem("All", "-1"));
                var items = from ListItem li in ddl_county.Items
                            where li.Text.Contains("All")
                            select li;
                foreach (ListItem li in items)
                {
                    li.Selected = true;
                }
            }
        }
Пример #4
0
 protected void ddlviews_changed(object sender, EventArgs e)
 {
     ddlselectcolmns.DataSource     = Reportgenrator.Getallcolumns(ddlviews.SelectedItem.Text);
     ddlselectcolmns.DataTextField  = "COLUMN_NAME";
     ddlselectcolmns.DataValueField = "COLUMN_NAME";
     ddlselectcolmns.DataBind();
     ddlcols_change(null, null);
 }
Пример #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         // dtlst.DataSource = Reportgenrator.Getalltables().OrderBy(c => c.TABLE_NAME);
         // dtlst.DataBind();
         dtlst1.DataSource = Reportgenrator.Getallviews();
         dtlst1.DataBind();
     }
 }
Пример #6
0
 protected void btndel_click(object sender, EventArgs e)
 {
     Reportgenrator.Delete_print(Convert.ToInt32(hfdselprnt.Value));
     if (File.Exists(Server.MapPath("../Prints") + "//" + hfdselprnt.Value + ".aspx"))
     {
         File.Delete(Server.MapPath("../Prints") + "//" + hfdselprnt.Value + ".aspx");
     }
     btnclr_click(null, null);
     ScriptManager.RegisterStartupScript(Page, GetType(), "js", "afterdel()", true);
 }
Пример #7
0
        protected void btnedit_click(object sender, EventArgs e)
        {
            tbl_print obj  = Reportgenrator.Get_printdetails(hfdselprnt.Value);
            string    ftxt = File.ReadAllText(Server.MapPath("../Prints") + "//" + hfdselprnt.Value + ".aspx");
            int       sind = ftxt.IndexOf("<div class=Section1>") + 20;
            int       lind = ftxt.LastIndexOf("</div>");

            txtsummarycomplaint.Text = ftxt.Substring(sind, lind - sind).Replace("<%=", ":%=").Replace("%>", "%:");
            txtfilename.Text         = obj.fname;
            ScriptManager.RegisterStartupScript(Page, GetType(), "js", "afteredit()", true);
        }
Пример #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ddlviews.DataSource     = Reportgenrator.Getallviews_frm();
                ddlviews.DataTextField  = "view_name";
                ddlviews.DataValueField = "view_name";
                ddlviews.DataBind();
                ddlviews_changed(null, null);


                //Page.GetPostBackEventReference(btndel);
            }
        }
Пример #9
0
        protected void btn_save_click(object sender, EventArgs e)
        {
            string filepath = Reportgenrator.Insert_print(Convert.ToInt32(hfdselprnt.Value), ddlflds.SelectedValue, ddlviews.SelectedItem.Text, txtfilename.Text, ddlselectcolmns.Items[0].Text);


            if (File.Exists(Server.MapPath("../Prints") + "//" + filepath + ".aspx"))
            {
                File.Delete(Server.MapPath("../Prints") + "//" + filepath + ".aspx");
            }

            StringBuilder stb = new StringBuilder();

            stb.Append(File.ReadAllText(Server.MapPath("../Prints") + "//top.txt").ToString());
            stb.Append("@page Section1 ");
            stb.Append("{size:" + txtpagewidth.Text + " " + txtpageheight.Text + "; ");
            stb.Append("margin:" + txtmrgtop.Text + " " + txtmrgrght.Text + " " + txtmrgbotom.Text + " " + txtmrgleft.Text + ";} ");
            stb.Append("div.Section1 ");
            stb.Append("{page:Section1;} ");
            stb.Append("Table ");
            stb.Append("{ ");
            stb.Append("font-family:Arial; ");
            stb.Append("font-size:11pt; ");
            stb.Append("} ");

            stb.Append("--> ");
            stb.Append("</style> ");

            stb.Append("</head> ");

            stb.Append("<body lang=EN-US> ");

            stb.Append("<div class=Section1> ");
            string str = txtsummarycomplaint.Text;

            str = str.Replace(":%", "<%");
            str = str.Replace("%:", "%>");
            str = str.Replace("&quot;", Convert.ToString('"'));
            stb.Append(str);
            stb.Append("</div></body></html>");
            StreamWriter sw = File.CreateText(Server.MapPath("../Prints") + "//" + filepath + ".aspx");

            sw.Write(stb);
            sw.Close();
            btnclr_click(null, null);
            string js = "";

            js = "clr();";
            ScriptManager.RegisterStartupScript(Page, GetType(), "js1", js, true);
        }
Пример #10
0
 public DataSet binddrp(string oths)
 {
     string[] cls = oths.Split(',');
     if (cls.Length == 3)
     {
         string  query = "select " + cls[1] + " as disp," + cls[2] + " as val from " + cls[0] + " order by disp";
         DataSet ds    = Reportgenrator.Getrpt(query);
         DataRow dr    = ds.Tables[0].NewRow();
         dr[0] = "All";
         dr[1] = "0";
         ds.Tables[0].Rows.InsertAt(dr, 0);
         ds.AcceptChanges();
         return(ds);
     }
     return(null);
 }
Пример #11
0
 protected void btnrpt_save(object sender, EventArgs e)
 {
     hfdrptid.Value = Reportgenrator.Save_rpt(hfdrptid.Value, txtrpt.Text, hfdquery.Value, hfdfltrs.Value, hfdcols.Value);
     //  ScriptManager.RegisterStartupScript(Page, GetType(), "js", "aftersave()", true);
     Page.RegisterStartupScript("js", "<script>aftersave();</script>");
 }
Пример #12
0
        protected void btndel_click(object sender, EventArgs e)
        {
            Reportgenrator.Delete_rpt(Convert.ToInt32(hfdsel.Value));

            ScriptManager.RegisterStartupScript(Page, GetType(), "js", "afterdel()", true);
        }