示例#1
0
        public static String GetUpsert(String table, Dictionary <String, Object> insert_list, List <String> primary_keys, String compare_field, String compare_value)
        {
            String  result         = "";
            var     converted_list = ConvertToStringValues(insert_list);
            DBTable dbtable        = new DBTable(table, converted_list, primary_keys);
            Dictionary <String, String> primary_values = new Dictionary <String, String>();

            foreach (String key in primary_keys)
            {
                primary_values.Add(key, insert_list[key].ToString());
            }
            result += dbtable.GenerateCreateUpdate(converted_list, primary_values, compare_field, compare_value);
            return(result);
        }
示例#2
0
        public static String GetUpsert(String table, Dictionary <String, Object> insert_list, List <String> primary_keys, List <String> pValue)
        {
            String  result         = "";
            var     converted_list = ConvertToStringValues(insert_list);
            DBTable dbtable        = new DBTable(table, converted_list, primary_keys);
            Dictionary <String, String> primary_values = new Dictionary <String, String>();
            int index = 0;

            foreach (String key in primary_keys)
            {
                primary_values.Add(key, pValue[index]);
                index += 1;
            }
            result += dbtable.GenerateCreateUpdate(converted_list, primary_values, null, null);
            return(result);
        }