• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Common_Func类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Common_Func的典型用法代码示例。如果您正苦于以下问题:C# Common_Func类的具体用法?C# Common_Func怎么用?C# Common_Func使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Common_Func类属于命名空间,在下文中一共展示了Common_Func类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            int ckint = 0;
            Common_Func cfc = new Common_Func();

            // 檢查使用者權限並存入登入紀錄
            //Check_Power("2002", true);

            #region 接受下一頁返回時的舊查詢條件
            if (Request["pageid"] != null)
            {
                if (int.TryParse(Request["pageid"], out ckint))
                {
                    if (ckint > gv_Fi_Content.PageCount)
                        ckint = gv_Fi_Content.PageCount;

                    gv_Fi_Content.PageIndex = ckint;
                }
                else
                    lb_pageid.Text = "0";
            }

            ods_Fi_Content.SelectParameters["fl_no"].DefaultValue = "2";

            if (Request["fc_name"] != null)
            {
                tb_fc_name.Text = cfc.CleanSQL(Request["fc_name"]);
                ods_Fi_Content.SelectParameters["fc_name"].DefaultValue = tb_fc_name.Text;
            }

            if (Request["fc_ext"] != null)
            {
                tb_fc_ext.Text = cfc.CleanSQL(Request["fc_ext"]);
                ods_Fi_Content.SelectParameters["fc_ext"].DefaultValue = tb_fc_ext.Text;
            }

            if (Request["fc_desc"] != null)
            {
                tb_fc_desc.Text = cfc.CleanSQL(Request["fc_desc"]);
                ods_Fi_Content.SelectParameters["fc_desc"].DefaultValue = tb_fc_desc.Text;
            }

            #endregion
        }

        #region 檢查頁數是否超過
        ods_Fi_Content.DataBind();
        gv_Fi_Content.DataBind();
        if (gv_Fi_Content.PageCount < gv_Fi_Content.PageIndex)
        {
            gv_Fi_Content.PageIndex = gv_Fi_Content.PageCount;
            gv_Fi_Content.DataBind();
        }

        lb_pageid.Text = gv_Fi_Content.PageIndex.ToString();
        #endregion
    }
开发者ID:fping1245,项目名称:test20121224,代码行数:59,代码来源:2002.aspx.cs


示例2: lb_ok_Click

    protected void lb_ok_Click(object sender, EventArgs e)
    {
        string mErr = "";
        string mg_pass, mg_pass1;

        // 載入公用函數
        Common_Func cfc = new Common_Func();

        mg_pass = tb_mg_pass.Text.Trim();
        mg_pass1 = tb_mg_pass1.Text.Trim();

        if (mg_pass == "")
            mErr = mErr + "「新登入密碼」沒有輸入!\\n";
        else
            if (cfc.CheckSQL(mg_pass))
                mErr = mErr + "「新登入密碼」請勿使用特殊符號!\\n";
            else if (mg_pass.Length > 12 || mg_pass.Length < 4)
                mErr = mErr + "「新登入密碼」長度為4~12個字!\\n";

        if (mg_pass != mg_pass1)
            mErr = mErr + "「新登入密碼」與「新密碼確認」不相同!\\n";

        if (mErr == "")
        {
            using (SqlConnection Sql_conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["AppSysConnectionString"].ConnectionString))
            {
                string SqlString = "";
                Decoder decoder = new Decoder();

                Sql_conn.Open();

                // 建立 SQL 修改資料的語法
                SqlString = "Update Manager Set mg_pass = @mg_pass";
                SqlString = SqlString + " Where mg_sid = @mg_sid";

                using (SqlCommand Sql_Command = new SqlCommand(SqlString, Sql_conn))
                {
                    Sql_Command.Parameters.AddWithValue("@mg_pass", decoder.EnCode(mg_pass));
                    Sql_Command.Parameters.AddWithValue("@mg_sid", lb_pg_mg_sid.Text);

                    Sql_Command.ExecuteNonQuery();
                }
            }
        }

        if (mErr == "")
        {
            mErr = "alert('密碼變更完成,新密碼該員於下次登入時生效!\\n');location.replace('10051.aspx" + lb_page.Text + "');";
        }
        else
            mErr = "alert('" + mErr + "')";

        lt_show.Text = "<script language=javascript>" + mErr + "</script>";
    }
开发者ID:fping1245,项目名称:test20121224,代码行数:54,代码来源:10051_pass.aspx.cs


示例3: Check_Power

    // 檢查使用者權限並存入登入紀錄
    private void Check_Power(string f_power, bool bl_save)
    {
        // 載入公用函數
        Common_Func cfc = new Common_Func();

        // 若 Session 不存在則直接顯示錯誤訊息
        try
        {
            if (cfc.Check_Power(Session["mg_sid"].ToString(), Session["mg_name"].ToString(), Session["mg_power"].ToString(), f_power, Request.ServerVariables["REMOTE_ADDR"], bl_save) > 0)
                Response.Redirect("../Error.aspx?ErrCode=1");
        }
        catch
        {
            Response.Redirect("../Error.aspx?ErrCode=2");
        }
    }
开发者ID:fping1245,项目名称:test20121224,代码行数:17,代码来源:4004a.aspx.cs


示例4: Chk_Filter

    // 檢查查詢條件是否改變
    private void Chk_Filter()
    {
        Common_Func cfc = new Common_Func();
        DateTime cktime;
        int ckint;

        if (! DateTime.TryParse(tb_btime.Text, out cktime))
            tb_btime.Text = "";
        ods_Mg_Log.SelectParameters["btime"].DefaultValue = tb_btime.Text;

        if (! DateTime.TryParse(tb_etime.Text, out cktime))
            tb_etime.Text = "";
        ods_Mg_Log.SelectParameters["etime"].DefaultValue = tb_etime.Text;

        if (! int.TryParse(tb_mg_sid.Text,out ckint))
            tb_mg_sid.Text = "";
        ods_Mg_Log.SelectParameters["mg_sid"].DefaultValue = tb_mg_sid.Text;

        tb_mg_name.Text = cfc.CleanSQL(tb_mg_name.Text);
        ods_Mg_Log.SelectParameters["mg_name"].DefaultValue = tb_mg_name.Text;

        tb_fi_name1.Text = cfc.CleanSQL(tb_fi_name1.Text);
        ods_Mg_Log.SelectParameters["fi_name1"].DefaultValue = tb_fi_name1.Text;

        tb_fi_name2.Text = cfc.CleanSQL(tb_fi_name2.Text);
        ods_Mg_Log.SelectParameters["fi_name2"].DefaultValue = tb_fi_name2.Text;

        tb_lg_ip.Text = cfc.CleanSQL(tb_lg_ip.Text);
        ods_Mg_Log.SelectParameters["lg_ip"].DefaultValue = tb_lg_ip.Text;

        gv_Mg_Log.DataBind();
        if (gv_Mg_Log.PageCount - 1 < gv_Mg_Log.PageIndex)
        {
            gv_Mg_Log.PageIndex = gv_Mg_Log.PageCount;
            gv_Mg_Log.DataBind();
        }
    }
开发者ID:fping1245,项目名称:test20121224,代码行数:38,代码来源:1008.aspx.cs


示例5: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        string mErr = "";

        if (!IsPostBack)
        {
            int tp_sid = -1, ckint = -1;
            string tmpstr = "";
            Common_Func cfc = new Common_Func();

            // 檢查使用者權限但不存入登入紀錄
            //Check_Power("B001", false);

            if (Request["sid"] != null)
            {
                if (int.TryParse(Request["sid"], out tp_sid))
                {
                    lb_tp_sid.Text = tp_sid.ToString();
                    ods_Ts_User.SelectParameters["tp_sid"].DefaultValue = tp_sid.ToString();

                    // 取得資料
                    if (!GetData())
                        mErr = "找不到相關資料!\\n";

                    #region 接收下一頁傳來的參數
                    if (Request["pageid1"] != null)
                    {
                        if (int.TryParse(Request["pageid1"], out ckint))
                        {
                            if (ckint > gv_Ts_User.PageCount)
                                ckint = gv_Ts_User.PageCount;

                            gv_Ts_User.PageIndex = ckint;
                        }
                        else
                            lb_pageid1.Text = "0";
                    }

                    if (Request["tu_name"] != null)
                    {
                        tmpstr = cfc.CleanSQL(Request["tu_name"].Trim());
                        if (tmpstr != "")
                        {
                            tb_tu_name.Text = tmpstr;
                            ods_Ts_User.SelectParameters["tu_name"].DefaultValue = tmpstr;
                        }
                        else
                        {
                            tb_tu_name.Text = "";
                            ods_Ts_User.SelectParameters["tu_name"].DefaultValue = "";
                        }
                    }

                    if (Request["tu_no"] != null)
                    {
                        tmpstr = cfc.CleanSQL(Request["tu_no"].Trim());
                        if (tmpstr != "")
                        {
                            tb_tu_no.Text = tmpstr;
                            ods_Ts_User.SelectParameters["tu_no"].DefaultValue = tmpstr;
                        }
                        else
                        {
                            tb_tu_no.Text = "";
                            ods_Ts_User.SelectParameters["tu_no"].DefaultValue = "";
                        }
                    }

                    if (Request["tu_ip"] != null)
                    {
                        tmpstr = cfc.CleanSQL(Request["tu_ip"].Trim());
                        if (tmpstr != "")
                        {
                            tb_tu_ip.Text = tmpstr;
                            ods_Ts_User.SelectParameters["tu_ip"].DefaultValue = tmpstr;
                        }
                        else
                        {
                            tb_tu_ip.Text = "";
                            ods_Ts_User.SelectParameters["tu_ip"].DefaultValue = "";
                        }
                    }

                    #endregion

                    #region 接收上一頁傳來的參數
                    if (Request["pageid"] != null)
                        lb_page.Text = "?pageid=" + Request["pageid"].Trim();
                    else
                        lb_page.Text = "?pageid=0";

                    if (Request["tp_sid"] != null)
                        lb_page.Text += "&tp_sid=" + Request["tp_sid"].Trim();

                    if (Request["tp_title"] != null)
                        lb_page.Text += "&tp_title=" + Server.UrlEncode(Request["tp_title"].Trim());

                    if (Request["is_show"] != null)
                        lb_page.Text += "&is_show=" + Request["is_show"].Trim();

//.........这里部分代码省略.........
开发者ID:fping1245,项目名称:test20121224,代码行数:101,代码来源:B0015.aspx.cs


示例6: GetSqlString

    // 產生對應的 Sql Where 字串
    private string GetSqlString(string ds_sid, string ds_code, string ds_name, string ds_database)
    {
        StringBuilder sbstring = new StringBuilder();
        Common_Func cfc = new Common_Func();
        string subSql = "", tmpstr = "";
        int ckint = 0;

        // 檢查 ds_sid 是否有值
        if (int.TryParse(ds_sid, out ckint))
        {
            subSql += " And ds_sid = " + ckint.ToString();
        }

        // 檢查 ds_code 是否有值,並清除 SQL 隱碼攻擊的字元
        tmpstr = cfc.CleanSQL(ds_code);
        if (tmpstr != "")
        {
            // 使用 like 時 要用 「%'[email protected]_code+'%」 的方式
            subSql += " And ds_code Like '%'[email protected]_code+'%'";
            sbstring.Append("@ds_code");
        }

        // 檢查 ds_name 是否有值,並清除 SQL 隱碼攻擊的字元
        tmpstr = cfc.CleanSQL(ds_name);
        if (tmpstr != "")
        {
            // 使用 like 時 要用 「%'[email protected]_name+'%」 的方式
            subSql += " And ds_name Like '%'[email protected]_name+'%'";
            sbstring.Append("@ds_name");
        }

        // 檢查 ds_database 是否有值,並清除 SQL 隱碼攻擊的字元
        tmpstr = cfc.CleanSQL(ds_database);
        if (tmpstr != "")
        {
            // 使用 like 時 要用 「%'[email protected]_database+'%」 的方式
            subSql += " And ds_database Like '%'[email protected]_database+'%'";
            sbstring.Append("@ds_database");
        }

        if (subSql != "")
            subSql = " Where" + subSql.Substring(4);

        ParaString = sbstring.ToString();

        return subSql;
    }
开发者ID:fping1245,项目名称:test20121224,代码行数:48,代码来源:ODS_Db_Sys_DataReader.cs


示例7: GetSqlString

    // 產生對應的 Sql Where 字串
    private string GetSqlString(string he_sid, string he_title, string he_desc, string btime, string etime)
    {
        StringBuilder sbstring = new StringBuilder();
        Common_Func cfc = new Common_Func();
        string subSql = "", tmpstr = "";
        int ckint = 0;
        DateTime cktime;

        // 檢查 he_sid 是否有值
        if (int.TryParse(he_sid, out ckint))
        {
            subSql += " And he_sid = " + ckint.ToString();
        }

        // 檢查 he_title 是否有值,並清除 SQL 隱碼攻擊的字元
        tmpstr = cfc.CleanSQL(he_title);
        if (tmpstr != "")
        {
            // 使用 like 時 要用 「%'[email protected]_title+'%」 的方式
            subSql += " And he_title Like '%'[email protected]_title+'%'";
            sbstring.Append("@he_title");
        }

        // 檢查 he_desc 是否有值,並清除 SQL 隱碼攻擊的字元
        tmpstr = cfc.CleanSQL(he_desc);
        if (tmpstr != "")
        {
            // 使用 like 時 要用 「%'[email protected]_desc+'%」 的方式
            subSql += " And he_desc Like '%'[email protected]_desc+'%'";
            sbstring.Append("@he_desc");
        }

        // 檢查異動時間開始範圍是否有值
        if (DateTime.TryParse(btime, out cktime))
            subSql += " And init_time >= '" + cktime.ToString("yyyy/MM/dd HH:mm:ss") + "'";

        // 檢查異動時間結束範圍是否有值
        if (DateTime.TryParse(etime, out cktime))
            subSql += " And init_time <= '" + cktime.ToString("yyyy/MM/dd HH:mm:ss") + "'";

        if (subSql != "")
            subSql = " Where" + subSql.Substring(4);

        ParaString = sbstring.ToString();

        return subSql;
    }
开发者ID:fping1245,项目名称:test20121224,代码行数:48,代码来源:ODS_Html_Edit_DataReader.cs


示例8: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        int ckint = 0;
        Common_Func cfc = new Common_Func();
        DateTime ckbtime, cketime;

        if (!IsPostBack)
        {
            // 檢查使用者權限並存入登入紀錄
            //Check_Power("A002", true);

            #region 接受下一頁返回時的舊查詢條件
            if (Request["pageid"] != null)
            {
                if (int.TryParse(Request["pageid"], out ckint))
                {
                    if (ckint > gv_Bt_Head.PageCount)
                        ckint = gv_Bt_Head.PageCount;

                    gv_Bt_Head.PageIndex = ckint;
                }
                else
                    lb_pageid.Text = "0";
            }

            if (Request["bh_sid"] != null)
            {
                if (int.TryParse(Request["bh_sid"], out ckint))
                {
                    tb_bh_sid.Text = ckint.ToString();
                    ods_Bt_Head.SelectParameters["bh_sid"].DefaultValue = ckint.ToString();
                }
            }

            if (Request["is_check"] != null)
            {
                if (Request["is_check"] == "0")
                {
                    rb_is_check0.Checked = true;
                    rb_is_check1.Checked = false;
                    rb_is_check_all.Checked = false;
                }
                else if (Request["is_check"] == "1")
                {
                    rb_is_check0.Checked = false;
                    rb_is_check1.Checked = true;
                    rb_is_check_all.Checked = false;
                }
                else
                {
                    rb_is_check0.Checked = false;
                    rb_is_check1.Checked = false;
                    rb_is_check_all.Checked = true;
                }
            }
            else
            {
                rb_is_check0.Checked = false;
                rb_is_check1.Checked = false;
                rb_is_check_all.Checked = true;
            }

            if (Request["btime"] != null)
            {
                if (DateTime.TryParse(Request["btime"], out ckbtime))
                {
                    tb_btime.Text = Request["btime"];
                    ods_Bt_Head.SelectParameters["btime"].DefaultValue = ckbtime.ToString("yyyy/MM/dd HH:mm:ss");
                }
            }

            if (Request["etime"] != null)
            {
                if (DateTime.TryParse(Request["etime"], out cketime))
                {
                    tb_btime.Text = Request["etime"];
                    ods_Bt_Head.SelectParameters["etime"].DefaultValue = cketime.ToString("yyyy/MM/dd HH:mm:ss");
                }
            }
            #endregion
        }

        #region 檢查頁數是否超過
        ods_Bt_Head.DataBind();
        gv_Bt_Head.DataBind();
        if (gv_Bt_Head.PageCount < gv_Bt_Head.PageIndex)
        {
            gv_Bt_Head.PageIndex = gv_Bt_Head.PageCount;
            gv_Bt_Head.DataBind();
        }

        lb_pageid.Text = gv_Bt_Head.PageIndex.ToString();
        #endregion
    }
开发者ID:fping1245,项目名称:test20121224,代码行数:94,代码来源:A002_old.aspx.cs


示例9: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        string mErr = "";

        if (!IsPostBack)
        {
            int ds_sid = -1, dt_sid = -1;
            Common_Func cfc = new Common_Func();

            // 檢查使用者權限不存入登入紀錄
            //Check_Power("G001", false);

            if (Request["dt_sid"] != null && Request["ds_sid"] != null)
            {
                if (int.TryParse(Request["dt_sid"], out dt_sid) && int.TryParse(Request["ds_sid"], out ds_sid))
                {
                    lb_ds_sid.Text = ds_sid.ToString();
                    lb_dt_sid.Text = dt_sid.ToString();

                    ods_Db_Record.SelectParameters["ds_sid"].DefaultValue = ds_sid.ToString();
                    ods_Db_Record.SelectParameters["dt_sid"].DefaultValue = dt_sid.ToString();

                    if (GetData())
                    {
                        #region 接受上一頁查詢條件
                        lb_page.Text = "?ds_sid=" + ds_sid.ToString();
                        if (Request["pageid"] == null)
                            lb_page.Text += "&pageid=0";
                        else
                            lb_page.Text += "&pageid=" + Request["pageid"];

                        if (Request["ds_code"] != null)
                            lb_page.Text += "&ds_code=" + Server.UrlEncode(Request["ds_code"]);

                        if (Request["ds_name"] != null)
                            lb_page.Text += "&ds_name=" + Server.UrlEncode(Request["ds_name"]);

                        if (Request["ds_database"] != null)
                            lb_page.Text += "&ds_database=" + Server.UrlEncode(Request["ds_database"]);

                        if (Request["sort"] != null)
                            lb_page.Text += "&sort=" + Server.UrlEncode(Request["sort"]);

                        if (Request["pageid1"] != null)
                        {
                            lb_page.Text += "&pageid1=" + Request["pageid1"];
                        }

                        if (Request["dt_name"] != null)
                        {
                            lb_page.Text += "&dt_name=" + Server.UrlEncode(Request["dt_name"]);
                        }

                        if (Request["dt_caption"] != null)
                        {
                            lb_page.Text += "&dt_caption=" + Server.UrlEncode(Request["dt_caption"]);
                        }

                        if (Request["dt_area"] != null)
                        {
                            lb_page.Text += "&dt_area=" + Server.UrlEncode(Request["dt_area"]);
                        }

                        if (Request["sort1"] != null)
                        {
                            lb_page.Text += "&sort1=" + Server.UrlEncode(Request["sort1"]);
                        }
                        #endregion
                    }
                }
                else
                    mErr = "參數格式錯誤!\\n";
            }
            else
                mErr = "參數傳送錯誤!\\n";
        }

        if (mErr == "")
        {
            #region 檢查頁數是否超過
            ods_Db_Record.DataBind();
            gv_Db_Record.DataBind();
            if (gv_Db_Record.PageCount < gv_Db_Record.PageIndex)
            {
                gv_Db_Record.PageIndex = gv_Db_Record.PageCount;
                gv_Db_Record.DataBind();
            }

            lb_pageid2.Text = gv_Db_Record.PageIndex.ToString();
            #endregion
        }
        else
            ClientScript.RegisterStartupScript(this.GetType(), "ClientScript", "alert(\"" + mErr + "\");history.go(-1);", true);
    }
开发者ID:fping1245,项目名称:test20121224,代码行数:94,代码来源:G00144.aspx.cs


示例10: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            int ckint = 0;
            Common_Func cfc = new Common_Func();
            DateTime ckbtime, cketime;

            // 檢查使用者權限並存入登入紀錄
            //Check_Power("D001", true);

            ods_Fm_Forum.SelectParameters["is_close"].DefaultValue = "1";

            #region 接受下一頁返回時的舊查詢條件
            if (Request["pageid"] != null)
            {
                if (int.TryParse(Request["pageid"], out ckint))
                    gv_Fm_Forum.PageIndex = ckint;
                else
                    lb_pageid.Text = "0";
            }

            if (Request["ff_topic"] != null)
            {
                tb_ff_topic.Text = cfc.CleanSQL(Request["ff_topic"]);
                ods_Fm_Forum.SelectParameters["ff_topic"].DefaultValue = tb_ff_topic.Text;
            }

            if (Request["ff_desc"] != null)
            {
                tb_ff_desc.Text = cfc.CleanSQL(Request["ff_desc"]);
                ods_Fm_Forum.SelectParameters["ff_desc"].DefaultValue = tb_ff_desc.Text;
            }

            if (Request["ff_name"] != null)
            {
                tb_ff_name.Text = cfc.CleanSQL(Request["ff_name"]);
                ods_Fm_Forum.SelectParameters["ff_name"].DefaultValue = tb_ff_name.Text;
            }

            if (Request["btime"] != null)
            {
                if (DateTime.TryParse(Request["btime"], out ckbtime))
                {
                    tb_btime.Text = Request["btime"];
                    ods_Fm_Forum.SelectParameters["btime"].DefaultValue = ckbtime.ToString("yyyy/MM/dd HH:mm:ss");
                }
            }

            if (Request["etime"] != null)
            {
                if (DateTime.TryParse(Request["etime"], out cketime))
                {
                    tb_btime.Text = Request["etime"];
                    ods_Fm_Forum.SelectParameters["etime"].DefaultValue = cketime.ToString("yyyy/MM/dd HH:mm:ss");
                }
            }
            #endregion
        }

        #region 檢查頁數是否超過
        ods_Fm_Forum.DataBind();
        gv_Fm_Forum.DataBind();
        if (gv_Fm_Forum.PageCount < gv_Fm_Forum.PageIndex)
        {
            gv_Fm_Forum.PageIndex = gv_Fm_Forum.PageCount;
            gv_Fm_Forum.DataBind();
        }

        lb_pageid.Text = gv_Fm_Forum.PageIndex.ToString();
        #endregion
    }
开发者ID:fping1245,项目名称:test20121224,代码行数:72,代码来源:D001.aspx.cs


示例11: GetSqlString

    // 產生對應的 Sql Where 字串
    private string GetSqlString(string mg_sid, string mg_id, string mg_name, string mg_nike)
    {
        Common_Func cfc = new Common_Func();
        string subSql = "", tmpstr = "";
        int ckint = 0;

        // 檢查 mg_sid 是否有值
        if (int.TryParse(mg_sid, out ckint))
            subSql += " And m.mg_sid = " + ckint.ToString();

        // 檢查 mg_id 是否有值,並清除 SQL 隱碼攻擊的字元
        tmpstr = cfc.CleanSQL(mg_id);
        if (tmpstr != "")
            subSql += " And m.mg_id Like '%" + tmpstr + "%'";

        // 檢查 mg_name 是否有值,並清除 SQL 隱碼攻擊的字元
        tmpstr = cfc.CleanSQL(mg_name);
        if (tmpstr != "")
            subSql += " And m.mg_name Like '%" + tmpstr + "%'";

        // 檢查 mg_nike 是否有值,並清除 SQL 隱碼攻擊的字元
        tmpstr = cfc.CleanSQL(mg_nike);
        if (tmpstr != "")
            subSql += " And m.mg_nike Like '%" + tmpstr + "%'";

        return subSql;
    }
开发者ID:fping1245,项目名称:test20121224,代码行数:28,代码来源:ODS_Func_Power_DataReader.cs


示例12: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        int ckint = 0;

        if (!IsPostBack)
        {
            Common_Func cfc = new Common_Func();
            DateTime ckbtime, cketime;

            // 檢查使用者權限並存入登入紀錄
            //Check_Power("9001", true);

            #region 接受下一頁返回時的舊查詢條件
            if (Request["pageid1"] != null)
            {
                if (int.TryParse(Request["pageid1"], out ckint))
                {
                    if (ckint > gv_Ad_Member.PageCount)
                        ckint = gv_Ad_Member.PageCount;

                    gv_Ad_Member.PageIndex = ckint;
                }
                else
                    lb_pageid1.Text = "0";
            }

            if (Request["adb_sid"] != null)
            {
                if (int.TryParse(Request["adb_sid"], out ckint))
                {
                    tb_adb_sid.Text = ckint.ToString();
                    ods_Ad_Member.SelectParameters["adb_sid"].DefaultValue = ckint.ToString();
                }
            }

            if (Request["adb_email"] != null)
            {
                if (int.TryParse(Request["adb_email"], out ckint))
                {
                    tb_adb_email.Text = ckint.ToString();
                    ods_Ad_Member.SelectParameters["adb_email"].DefaultValue = ckint.ToString();
                }
            }

            if (Request["adb_ibtime"] != null)
            {
                if (DateTime.TryParse(Request["adb_ibtime"], out ckbtime))
                {
                    tb_ibtime.Text = ckint.ToString();
                    ods_Ad_Member.SelectParameters["btime"].DefaultValue = ckbtime.ToString();
                }
            }

            if (Request["adb_ietime"] != null)
            {
                if (DateTime.TryParse(Request["adb_ietime"], out cketime))
                {
                    tb_ietime.Text = ckint.ToString();
                    ods_Ad_Member.SelectParameters["etime"].DefaultValue = cketime.ToString();
                }
            }
            #endregion

            #region 承接上一頁的查詢條件設定
            if (Request["pageid"] != null)
            {
                if (int.TryParse(Request["pageid"].ToString(), out ckint))
                {
                    lb_page.Text = "?pageid=" + ckint.ToString();
                }
                else
                {
                    lb_page.Text = "?pageid=0";
                }
            }

            if (Request["adm_sid"] != null)
                lb_page.Text += "&adm_sid=" + Server.UrlEncode(Request["adm_sid"]);

            if (Request["adm_title"] != null)
                lb_page.Text += "&adm_title=" + Server.UrlEncode(Request["adm_title"]);

            if (Request["adm_fname"] != null)
                lb_page.Text += "&adm_fname=" + Server.UrlEncode(Request["adm_fname"]);

            if (Request["adm_fmail"] != null)
                lb_page.Text += "&adm_fmail=" + Server.UrlEncode(Request["adm_fmail"]);

            if (Request["btime"] != null)
                lb_page.Text += "&btime=" + Server.UrlEncode(Request["btime"]);

            if (Request["etime"] != null)
                lb_page.Text += "&etime=" + Server.UrlEncode(Request["etime"]);
            #endregion

            ods_Ad_Member.DataBind();
            gv_Ad_Member.DataBind();

            #region 檢查頁數是否超過
            if (gv_Ad_Member.PageCount < gv_Ad_Member.PageIndex + 1)
//.........这里部分代码省略.........
开发者ID:fping1245,项目名称:test20121224,代码行数:101,代码来源:90014.aspx.cs


示例13: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            int ckint = 0;
            Common_Func cfc = new Common_Func();
            DateTime ckbtime, cketime;

            // 檢查使用者權限並存入使用紀錄。
            //Check_Power("1005", true);

            #region 接受下一頁返回時的舊查詢條件
            if (Request["pageid"] != null)
            {
                if (int.TryParse(Request["pageid"], out ckint))
                    gv_Manager.PageIndex = ckint;
                else
                    lb_pageid.Text = "0";
            }

            if (Request["mg_sid"] != null)
            {
                if (int.TryParse(Request["mg_sid"], out ckint))
                {
                    tb_mg_sid.Text = ckint.ToString();
                    ods_Manager.SelectParameters["mg_sid"].DefaultValue = ckint.ToString();
                }
            }

            if (Request["mg_name"] != null)
            {
                tb_mg_name.Text = cfc.CleanSQL(Request["mg_name"]);
                ods_Manager.SelectParameters["mg_name"].DefaultValue = tb_mg_name.Text;
            }

            if (Request["mg_nike"] != null)
            {
                tb_mg_nike.Text = cfc.CleanSQL(Request["mg_nike"]);
                ods_Manager.SelectParameters["mg_nike"].DefaultValue = tb_mg_nike.Text;
            }

            if (Request["btime"] != null)
                if (DateTime.TryParse(Request["btime"], out ckbtime))
                {
                    tb_btime.Text = Request["btime"];
                    ods_Manager.SelectParameters["btime"].DefaultValue = ckbtime.ToString("yyyy/MM/dd HH:mm:ss");
                }

            if (Request["etime"] != null)
                if (DateTime.TryParse(Request["etime"], out cketime))
                {
                    tb_btime.Text = Request["etime"];
                    ods_Manager.SelectParameters["etime"].DefaultValue = cketime.ToString("yyyy/MM/dd HH:mm:ss");
                }
            #endregion
        }

        #region 檢查頁數是否超過
        ods_Manager.DataBind();
        gv_Manager.DataBind();
        if (gv_Manager.PageCount < gv_Manager.PageIndex)
        {
            gv_Manager.PageIndex = gv_Manager.PageCount;
            gv_Manager.DataBind();
        }

        lb_pageid.Text = gv_Manager.PageIndex.ToString();
        #endregion
    }
开发者ID:fping1245,项目名称:test20121224,代码行数:69,代码来源:1005.aspx.cs


示例14: Chk_Filter

    // 檢查查詢條件是否改變
    private void Chk_Filter()
    {
        Common_Func cfc = new Common_Func();

        int ckint = 0;
        DateTime ckbtime, cketime;
        string tmpstr = "";

        // 有輸入編號,則設定條件
        if (int.TryParse(tb_mg_sid.Text.Trim(), out ckint))
            ods_Manager.SelectParameters["mg_sid"].DefaultValue = ckint.ToString();
        else
        {
            tb_mg_sid.Text = "";
            ods_Manager.SelectParameters["mg_sid"].DefaultValue = "";
        }

        // 有輸入姓名,則設定條件 (cfc.CleanSQL() => 移除可能為 SQL 隱碼攻擊的字串)
        tmpstr = cfc.CleanSQL(tb_mg_name.Text.Trim());
        if (tmpstr != "")
            ods_Manager.SelectParameters["mg_name"].DefaultValue = tmpstr;
        else
        {
            tb_mg_name.Text = "";
            ods_Manager.SelectParameters["mg_name"].DefaultValue = "";
        }

        // 有輸入暱稱,則設定條件 (cfc.CleanSQL() => 移除可能為 SQL 隱碼攻擊的字串)
        tmpstr = cfc.CleanSQL(tb_mg_nike.Text.Trim());
        if (tmpstr != "")
            ods_Manager.SelectParameters["mg_nike"].DefaultValue = tmpstr;
        else
        {
            tb_mg_nike.Text = "";
            ods_Manager.SelectParameters["mg_nike"].DefaultValue = "";
        }

        // 有輸入開始時間範圍,則設定條件
        if (DateTime.TryParse(tb_btime.Text.Trim(), out ckbtime))
            ods_Manager.SelectParameters["btime"].DefaultValue = ckbtime.ToString("yyyy/MM/dd HH:mm:ss");
        else
        {
            tb_btime.Text = "";
            ods_Manager.SelectParameters["btime"].DefaultValue = "";
        }

        // 有輸入結束時間範圍,則設定條件
        if (DateTime.TryParse(tb_etime.Text.Trim(), out cketime))
            ods_Manager.SelectParameters["etime"].DefaultValue = cketime.ToString("yyyy/MM/dd HH:mm:ss");
        else
        {
            tb_etime.Text = "";
            ods_Manager.SelectParameters["etime"].DefaultValue = "";
        }

        gv_Manager.DataBind();
        if (gv_Manager.PageCount -1 < gv_Manager.PageIndex)
        {
            gv_Manager.PageIndex = gv_Manager.PageCount;
            gv_Manager.DataBind();
        }

        lb_pageid.Text = gv_Manager.PageIndex.ToString();
    }
开发者ID:fping1245,项目名称:test20121224,代码行数:65,代码来源:1005.aspx.cs


示例15: GetSqlString

    // 產生對應的 Sql Where 字串
    private string GetSqlString(string mg_sid, string mg_name, string mg_nike, string btime, string etime)
    {
        Common_Func cfc = new Common_Func();
        string subSql = "", tmpstr = "";
        int ckint = 0;
        DateTime cktime;

        if (int.TryParse(mg_sid, out ckint))
            subSql += " And mg_sid = " + ckint.ToString();

        // 檢查 mg_name 是否有值,並清除 SQL 隱碼攻擊的字元
        tmpstr = cfc.CleanSQL(mg_name);
        if (tmpstr != "")
            subSql += " And mg_name Like '%" + tmpstr + "%'";

        // 檢查 mg_nike 是否有值,並清除 SQL 隱碼攻擊的字元
        tmpstr = cfc.CleanSQL(mg_nike);
        if (tmpstr != "")
            subSql += " And mg_nike Like '%" + tmpstr + "%'";

        // 檢查開始時間是否有值
        if (DateTime.TryParse(btime, out cktime))
            subSql += " And last_date >= '" + cktime.ToString("yyyy/MM/dd HH:mm:ss") + "'";

        // 檢查結束時間是否有值
        if (DateTime.TryParse(etime, out cktime))
            subSql += " And last_date <= '" + cktime.ToString("yyyy/MM/dd HH:mm:ss") + "'";

        if (subSql != "")
            subSql = " Where" + subSql.Substring(4);

        return subSql;
    }
开发者ID:fping1245,项目名称:test20121224,代码行数:34,代码来源:ODS_Manager_DataReader.cs


示例16: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        string mErr = "";
        int ckint = 0;
        Common_Func cfc = new Common_Func();
        DateTime ckbtime, cketime;

        if (!IsPostBack)
        {
            // 檢查使用者權限並存入登入紀錄
            //Check_Power("9001", true);

            #region 檢查接收參數
            if (Request["sid"] == null)
            {
                mErr = "參數傳送錯誤!\\n";
            }
            else
            {
                if (int.TryParse(Request["sid"], out ckint))
                {
                    lb_adm_sid.Text = ckint.ToString();
                    ods_Ad_List.SelectParameters["adm_sid"].DefaultValue = ckint.ToString();
                    ods_Ad_List.UpdateParameters["adm_sid"].DefaultValue = ckint.ToString();
                    ods_Ad_List.InsertParameters["adm_sid"].DefaultValue = ckint.ToString();

                    Get_Data();
                }
                else
                    mErr = "參數傳送錯誤!\\n";
            }
            #endregion

            if (mErr == "")
            {
                #region 承接上一頁的查詢條件設定
                if (Request["pageid"] != null)
                {
                    if (int.TryParse(Request["pageid"].ToString(), out ckint))
                    {
                        lb_page.Text = "?pageid=" + ckint.ToString();
                    }
                    else
                    {
                        lb_page.Text = "?pageid=0";
                    }
                }
                else
                    lb_page.Text = "?pageid=0";

                if (Request["adm_sid"] != null)
                    lb_page.Text += "&adm_sid=" + Server.UrlEncode(Request["adm_sid"]);

                if (Request["adm_title"] != null)
                    lb_page.Text += "&adm_title=" + Server.UrlEncode(Request["adm_title"]);

                if (Request["adm_fname"] != null)
                    lb_page.Text += "&adm_fname=" + Server.UrlEncode(Request["adm_fname"]);

                if (Request["adm_fmail"] != null)
                    lb_page.Text += "&adm_fmail=" + Server.UrlEncode(Request["adm_fmail"]);

                if (Request["btime"] != null)
                    lb_page.Text += "&btime=" + Server.UrlEncode(Request["btime"]);

                if (Request["etime"] != null)
                    lb_page.Text += "&etime=" + Server.UrlEncode(Request["etime"]);
                #endregion

                #region 接受下一頁返回時的舊查詢條件
                lb_page.Text += "&sid=" + lb_adm_sid.Text;

                if (Request["pageid1"] != null)
                {
                    if (int.TryParse(Request["pageid1"], out ckint))
                    {
                        if (ckint > gv_Ad_List.PageCount)
                            ckint = gv_Ad_List.PageCount;

                        gv_Ad_List.PageIndex = ckint;

                        lb_page.Text += "&pageid1=" + ckint.ToString();
                    }
                    else
                        lb_pageid1.Text = "0";
                }

                if (Request["adl_email"] != null)
                {
                    if (int.TryParse(Request["adl_email"], out ckint))
                    {
                        tb_adl_email.Text = ckint.ToString();
                        ods_Ad_List.SelectParameters["adl_email"].DefaultValue = ckint.ToString();
                    }
                }

                if (Request["adb_ibtime"] != null)
                {
                    if (DateTime.TryParse(Request["adb_ibtime"], out ckbtime))
                    {
//.........这里部分代码省略.........
开发者ID:fping1245,项目名称:test20121224,代码行数:101,代码来源:90012.aspx.cs


示例17: Chk_Filter


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CommunicationHelper类代码示例发布时间:2022-05-24
下一篇:
C# CommonVars类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap