Example #1
0
    protected void BaseUc_Page_Load(object sender, EventArgs e)
    {
        SH = Screen.PrimaryScreen.Bounds.Height;

        SW        = Screen.PrimaryScreen.Bounds.Width;
        dt_a00201 = Fun.getDtBySql("Select t.* from A00201_V01 t where a00201_key = '" + a00201_key + "'");
        // dt_a0130101 = Fun.getA0130101(a00201_key);
        //dt_a013010101 = Fun.getA013010101(a00201_key);
        // showdatasql = Fun.getShowDataSql(a00201_key);
        //  A002_ID='[REQUEST_A002ID]'
        //解析出request
        for (int i = 0; i < Request.QueryString.AllKeys.Length; i++)
        {
            string key = Request.QueryString.AllKeys.GetValue(i).ToString();
            // Request.QueryString("").
            showdatasql = showdatasql.Replace("[REQUEST_" + key.ToUpper() + "]", Request.QueryString[key].ToString());
        }
        string json = "";

        try
        {
            json = Session["J_" + dt_a00201.Rows[0]["A00201_KEY"].ToString()].ToString();
        }
        catch
        {
            json = "";
        }
        if (json == "")
        {
            Hashtable ht = new Hashtable();
            dt_a013010101 = Fun.getA013010101(a00201_key);
            ht.Add("P1", Fun.DataTable2Json(dt_a013010101));
            ht.Add("P2", dt_a00201.Rows[0]["TABLE_KEY"].ToString());
            ht.Add("P3", dt_a00201.Rows[0]["main_key"].ToString());
            ht.Add("P4", dt_a00201.Rows[0]["table_id"].ToString());
            ht.Add("P5", Fun.DataTable2Json(Fun.getDtBySql("select t.* from A00210_V01 t  where a00201_key ='" + dt_a00201.Rows[0]["A00201_KEY"].ToString() + "' and   rb_type='C'")));
            ht.Add("P6", Fun.DataTable2Json(Fun.getDtBySql("select t.* from A00210_V01 t  where a00201_key ='" + dt_a00201.Rows[0]["A00201_KEY"].ToString() + "' and   rb_type='U'")));
            ht.Add("P7", dt_a00201.Rows[0]["tbl_type"].ToString());
            ht.Add("P8", Fun.DataTable2Json(Fun.getDtBySql("select t.*   from a00201_v02 t  where a00201_key ='" + dt_a00201.Rows[0]["A00201_KEY"].ToString() + "' order by sort_by")));

            //        ht.Add("P001", Fun.DataTable2Json(Fun.getDtBySql("Select t.* from A00201_V01 t where a00201_key = '" + a00201_key + "'")));
            //      ht.Add("P002", Fun.getA0130101(a00201_key));
            //  ht.Add("P003", Fun.DataTable2Json(dt_a013010101));
            ht.Add("P004", Fun.getShowDataSql(a00201_key));
            string jsonText = JsonConvert.SerializeObject(ht);
            Session["J_" + dt_a00201.Rows[0]["A00201_KEY"].ToString()] = jsonText;
            json = jsonText;
        }
        else
        {
            dt_a013010101 = Fun.getdtByJson(Fun.getJson(json, "P1"));
        }
        showdatasql = Fun.getJson(json, "P004");
    }
Example #2
0
    public String getPData(string a00201_key___, string pnum)
    {
        string v = "";

        try
        {
            string jsonText = Session["J_" + a00201_key___].ToString();
            v = Fun.getJson(jsonText, pnum);
            return(v);
        }
        catch (Exception ex) {
            v = "";
        }
        return(v);
    }
Example #3
0
    public void PageBase_Load(object sender, System.EventArgs e)
    {
        if (GlobeAtt.A007_KEY == "")
        {
            Response.Write("showlogin();");
            return;
        }


        try
        {
            Stream       RequestStream       = Request.InputStream;
            StreamReader RequestStreamReader = new StreamReader(RequestStream);
            RequestXml = RequestStreamReader.ReadToEnd();
            RequestStream.Close();

            a00201_key = BaseFun.getAllHyperLinks(RequestXml, "<A00201KEY>", "</A00201KEY>")[0].Value;
            try
            {
                RequestURL = BaseFun.getAllHyperLinks(RequestXml, "<URL>", "</URL>")[0].Value;
            }
            catch
            {
                RequestURL = "";
            }
        }
        catch (Exception ex)
        {
            a00201_key = "-1";
            return;
        }

        // a00201_key = Request.QueryString["A00201KEY"] == null ? "-1" : Request.QueryString["A00201KEY"].ToString();
        if (a00201_key == "-1")
        {
            return;
        }

        try
        {
            json = Session["JSON_" + a00201_key].ToString();
        }
        catch
        {
            json = "";
        }
        if (GlobeAtt.SYS_MODE == "K")
        {
            json = "";
        }
        if (json == "")
        {
            Hashtable ht = new Hashtable();
            dt_a013010101 = Fun.getA013010101(a00201_key);
            dt_a00201     = Fun.getDtBySql("Select t.* from A00201_V01 t where a00201_key = '" + a00201_key + "' order by  line_no  ");
            //列属性
            ht.Add("P1", Fun.DataTable2Json(dt_a013010101));
            //菜单属性
            ht.Add("P2", Fun.DataTable2Json(dt_a00201));
            //数据检测属性
            if (dt_a00201.Rows[0]["IF_MAIN"].ToString() == "1")
            {
                ht.Add("P3", Fun.DataTable2Json(Fun.getDtBySql("select t.* from A00210_V01 t  where menu_id ='" + dt_a00201.Rows[0]["MENU_ID"].ToString() + "' and   rb_type='C'")));
                ht.Add("P4", Fun.DataTable2Json(Fun.getDtBySql("select t.* from A00210_V01 t  where menu_id ='" + dt_a00201.Rows[0]["MENU_ID"].ToString() + "' and   rb_type='U'")));
                ht.Add("P9", Fun.DataTable2Json(Fun.getDtBySql("select t.* from A00201_V01 t  where menu_id ='" + dt_a00201.Rows[0]["MENU_ID"].ToString() + "' order by line_no")));
            }
            //右键属性
            ht.Add("P5", Fun.DataTable2Json(Fun.getDtBySql("select t.*   from a00201_v02 t  where a00201_key ='" + a00201_key + "' order by sort_by")));
            //查询数据的SQL
            showdatasql = Fun.getShowDataSql(a00201_key);
            ht.Add("P6", showdatasql);
            //查询数据数量的SQL
            getShowDataCountSql = Fun.getShowDataCountSql(a00201_key);
            ht.Add("P7", getShowDataCountSql);
            //打印列表
            if (dt_a00201.Rows[0]["if_main"].ToString() == "1")
            {
                ht.Add("P8", Fun.DataTable2Json(Fun.getDtBySql("select t.*   from A00205 t  where menu_id ='" + dt_a00201.Rows[0]["menu_id"].ToString() + "' order by sort_by")));
            }
            else
            {
                ht.Add("P8", "");
            }
            string form_init = dt_a00201.Rows[0]["FORM_INIT"].ToString();

            ht.Add("P10", form_init);
            string jsonText = JsonConvert.SerializeObject(ht);
            Session["JSON_" + a00201_key] = jsonText;
            json = jsonText;
        }
        else
        {
            dt_a013010101       = Fun.getdtByJson(Fun.getJson(json, "P1"));
            dt_a00201           = Fun.getdtByJson(Fun.getJson(json, "P2"));
            showdatasql         = Fun.getJson(json, "P6");
            getShowDataCountSql = Fun.getJson(json, "P7");
        }

        try
        {
            QUERYID = BaseFun.getAllHyperLinks(RequestXml, "<QUERYID>", "</QUERYID>")[0].Value;
        }
        catch
        {
            QUERYID = "";
        }
        string condition = "";

        if (QUERYID != "")
        {
            condition = Fun.getQueryCondition(dt_a00201, QUERYID);
            int    pos       = condition.IndexOf("ORDER BY");
            string str_order = "";
            if (pos > 0)
            {
                str_order = condition.Substring(pos);
                condition = condition.Substring(0, pos - 1);
            }

            showdatasql         = showdatasql + condition + "  " + str_order;
            getShowDataCountSql = getShowDataCountSql + condition;
        }
        string url = "";

        try
        {
            url = BaseFun.getAllHyperLinks(RequestXml, "<URL>", "</URL>")[0].Value;
        }
        catch
        {
            url = "";
        }
        if (url.IndexOf("?") > 0)
        {
            int pos = url.IndexOf("?");
            url = url.Substring(pos + 1);
            string[] data_ = url.Split('&');
            for (int i = 0; i < data_.Length; i++)
            {
                string[] data1_ = data_[i].Split('=');
                showdatasql         = showdatasql.Replace("[REQUEST_" + data1_[0] + "]", data1_[1]);
                getShowDataCountSql = getShowDataCountSql.Replace("[REQUEST_" + data1_[0] + "]", data1_[1]);
            }
        }
    }