当前位置: 首页>>代码示例>>C#>>正文


C# Util.MySqlFilter方法代码示例

本文整理汇总了C#中Util.MySqlFilter方法的典型用法代码示例。如果您正苦于以下问题:C# Util.MySqlFilter方法的具体用法?C# Util.MySqlFilter怎么用?C# Util.MySqlFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Util的用法示例。


在下文中一共展示了Util.MySqlFilter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UpdateStagingAppXmlFromAdmin

 public void UpdateStagingAppXmlFromAdmin(Hashtable State)
 {
     try
     {
         string NOW = DateTime.Now.ToUniversalTime().ToString("u").Replace("Z", "");
         DB db = new DB();
         StringBuilder b_sql = new StringBuilder("UPDATE applications SET ");
         b_sql.Append("application_type='" + State["SelectedAdminAppType"].ToString() + "',");
         XmlDocument doc = (XmlDocument)State["AdminAppDesign"];
         Util util = new Util();
         b_sql.Append("staging_app_xml='" + util.MySqlFilter(doc.OuterXml) + "',");
         b_sql.Append("date_time_modified='" + NOW + "' ");
         b_sql.Append("WHERE application_name='" + State["SelectedAdminApp"].ToString() + "'");
         b_sql.Append(" AND customer_id='" + State["ServerAdminCustomerID"].ToString() + "'");
         db.ViziAppsExecuteNonQuery(State, b_sql.ToString());
         db.CloseViziAppsDatabase(State);
     }
     catch (Exception ex)
     {
         throw new Exception("Error in UpdateStagingAppXmlFromAdmin: " + ex.Message + ": " + ex.StackTrace);
     }
 }
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:22,代码来源:ShowXmlDesign.aspx.cs

示例2: UpdateProfile_Click

    protected void UpdateProfile_Click(object sender, EventArgs e)
    {
        Util util = new Util();
        Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
        if (util.CheckSessionTimeout(State, Response, "Default.aspx")) return;

        Message.Text = "";

        PasswordTextBox.Text = Request.Form.Get("PasswordTextBox");
        ConfirmPasswordBox.Text = Request.Form.Get("ConfirmPasswordBox");
        CompanyTextBox.Text = Request.Form.Get("CompanyTextBox");
        RoleTextBox.Text = Request.Form.Get("RoleTextBox");
        FirstNameTextBox.Text = Request.Form.Get("FirstNameTextBox");
        LastNameTextBox.Text = Request.Form.Get("LastNameTextBox");
        StreetTextBox.Text = Request.Form.Get("StreetTextBox");
        CityTextBox.Text = Request.Form.Get("CityTextBox");
        StateList.Text = Request.Form.Get("StateList");
        PostalCodeTextBox.Text = Request.Form.Get("PostalCodeTextBox");
        CountryTextBox.Text = Request.Form.Get("CountryTextBox");
        PhoneTextbox.Text = Request.Form.Get("PhoneTextbox");
        EmailTextBox.Text = Request.Form.Get("EmailTextBox");
        string force_1_user_sessions = Request.Form.Get("Force1UserSessions");
        Force1UserSessions.Checked = force_1_user_sessions == "on" ? true : false;

        //validation
        if (CompanyTextBox.Text.Length > 0 && !Check.ValidateName(Message, CompanyTextBox.Text))
        {
            return;
        }
        if (RoleTextBox.Text.Length > 0 && !Check.ValidateString(Message, RoleTextBox.Text))
        {
            return;
        }
        if (FirstNameTextBox.Text.Length > 0 && !Check.ValidateName(Message, FirstNameTextBox.Text))
        {
            return;
        }
        if (LastNameTextBox.Text.Length > 0 && !Check.ValidateName(Message, LastNameTextBox.Text))
        {
            return;
        }
        if (StreetTextBox.Text.Length > 0 && !Check.ValidateText(Message, StreetTextBox.Text))
        {
            return;
        }
        if (CityTextBox.Text.Length > 0 && !Check.ValidateName(Message, CityTextBox.Text))
        {
            return;
        }
        if (PostalCodeTextBox.Text.Length > 0 && !Check.ValidateZipcode(Message, PostalCodeTextBox.Text))
        {
            return;
        }
        if (CountryTextBox.Text.Length > 0 && !Check.ValidateName(Message, CountryTextBox.Text))
        {
            return;
        }
        if (!Check.ValidatePhone(Message, PhoneTextbox.Text))
        {
            return;
        }
        if (!Check.ValidateEmail(Message, EmailTextBox.Text))
        {
            return;
        }

        StringBuilder sql = null;
        DB db = new DB();
        string username = null;
        if (State["Username"].ToString() != "admin")
        {
            username =  State["Username"].ToString();
        }
        else
        {
            username =  State["ServerAdminUsername"].ToString();
        }

        if (PasswordTextBox.Text.Length > 0 || ConfirmPasswordBox.Text.Length > 0)
        {
            if (PasswordTextBox.Text == ConfirmPasswordBox.Text)
            {
                if (!Check.ValidatePassword(Message, PasswordTextBox.Text))
                {
                    return;
                }
                sql = new StringBuilder("UPDATE customers SET password='" + util.MySqlFilter(PasswordTextBox.Text) + "'");
                sql.Append(" WHERE username='" + username + "'");
                db.ViziAppsExecuteNonQuery(State, sql.ToString());

                sql = new StringBuilder("SELECT email from customers WHERE username='" + username + "'");
                string to_email = db.ViziAppsExecuteScalar(State, sql.ToString());

                Email email = new Email();
                StringBuilder body = new StringBuilder("\nYour ViziApps password has been changed.\n\n");

                body.Append("If you did not change it, contact our support team at [email protected] right away. ");
                body.Append("\n\n - The ViziApps Team \n");

                email.SendEmail(State,   HttpRuntime.Cache["TechSupportEmail"].ToString(), to_email, "", "", "ViziApps Notice", body.ToString(), "",false);
//.........这里部分代码省略.........
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:101,代码来源:TabMyProfile.aspx.cs

示例3: UpdatePassword_Click

 protected void UpdatePassword_Click(object sender, EventArgs e)
 {
     DB db = new DB();
     Util util = new Util();
     if (Password.Text.Length < 6)
     {
         AdminMessage.Text = "Passwords must 6 characters or more.";
         return;
     }
     Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
     string sql = "UPDATE customers SET password='" + util.MySqlFilter(Password.Text) + "' WHERE customer_id='" + State["ServerAdminCustomerID"].ToString() + "'";
     db.ViziAppsExecuteNonQuery(State, sql);
     db.CloseViziAppsDatabase(State);
     AdminMessage.Text = "Password has been set.";
 }
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:15,代码来源:Admin.aspx.cs

示例4: UpdateAccountTypes_Click

 protected void UpdateAccountTypes_Click(object sender, EventArgs e)
 {
     DB db = new DB();
     Util util = new Util();
     if (AccountTypes.Text.Length == 0)
     {
         AdminMessage.Text = "Account Types cannot be empty.";
         return;
     }
     Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
     string sql = "UPDATE customers SET account_type='type=" + util.MySqlFilter(AccountTypes.Text.Trim()) + ";' WHERE customer_id='" + State["ServerAdminCustomerID"].ToString() + "'";
     db.ViziAppsExecuteNonQuery(State, sql);
     db.CloseViziAppsDatabase(State);
     AdminMessage.Text = "Account Types have been set";
 }
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:15,代码来源:Admin.aspx.cs


注:本文中的Util.MySqlFilter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。