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


C# JavaScriptSerializer.Remove方法代码示例

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


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

示例1: modify

    public static Hashtable modify(String data, String executor)
    {
        Hashtable t_return = new Hashtable();
        SQLiteConnection conn = tools.getSqliteConn();
        SQLiteCommand comd = new SQLiteCommand();
        comd.Connection = conn;
        SQLiteDataReader rd = null;
        String sql = "";

        Hashtable t_data = new JavaScriptSerializer().Deserialize<Hashtable>(data);
        String username = (String)t_data["username"];
        t_data.Remove("username");
        String group_code = (String)t_data["group_code"];

        sql = "delete from basic_group_2_user where user_code = '" + username + "' ;";
        comd.CommandText = sql;
        comd.ExecuteNonQuery();
        sql = "insert into basic_group_2_user (user_code,group_code) values ('" + username + "','" + group_code + "');";
        comd.CommandText = sql;
        comd.ExecuteNonQuery();

        IDictionaryEnumerator en = t_data.GetEnumerator();
        Hashtable t_data2 = new Hashtable();
        while (en.MoveNext())
        {
            String value = en.Value.ToString();
            String key = en.Key.ToString();

            t_data2.Add(key, "'" + value + "'");
        }
        t_data = t_data2;
        t_data.Add("time_lastupdated", "now()");
        t_data.Add("count_updated", "count_updated+1");

        en = t_data.GetEnumerator();
        sql = "update basic_user set ";
        int columns = 0;
        while (en.MoveNext())
        {
            columns++;
            String value = en.Value.ToString();
            String key = en.Key.ToString();

            sql += key+ " = "+value+" ,";
        }
        sql = sql.Substring(0, sql.Length - 1);
        sql += " where username = '"+username+"'";
        comd.CommandText = sql;
        comd.ExecuteNonQuery();

        conn.Close();
        t_return.Add("status","1");
        t_return.Add("columns",columns);
        return t_return;
    }
开发者ID:noikiy,项目名称:ligerui-net-demo,代码行数:55,代码来源:basic_user.cs

示例2: modify

    public static Hashtable modify(String data, String executor)
    {
        Hashtable t_return = new Hashtable();
        SQLiteConnection conn = tools.getSqliteConn();
        SQLiteCommand comd = new SQLiteCommand();
        comd.Connection = conn;
        SQLiteDataReader rd = null;

        String sql = "";
        Hashtable t_data = new JavaScriptSerializer().Deserialize<Hashtable>(data);
        String code = (String)t_data["code"];
        t_data.Remove("code");

        IDictionaryEnumerator en = t_data.GetEnumerator();
        Hashtable t_data2 = new Hashtable();
        while (en.MoveNext())
        {
            String value = en.Value.ToString();
            String key = en.Key.ToString();

            t_data2.Add(key, "'" + value + "'");
        }
        t_data = t_data2;

        en = t_data.GetEnumerator();
        sql = "update basic_group set ";
        int columns = 0;
        while (en.MoveNext())
        {
            columns++;
            String value = en.Value.ToString();
            String key = en.Key.ToString();

            sql += key + " = " + value + " ,";
        }
        sql = sql.Substring(0, sql.Length - 1);
        sql += " where code = '" + code + "'";
        comd.CommandText = sql;
        comd.ExecuteNonQuery();

        conn.Close();
        t_return.Add("status", "1");
        t_return.Add("columns", columns);
        return t_return;
    }
开发者ID:noikiy,项目名称:ligerui-net-demo,代码行数:45,代码来源:basic_group.cs


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