Пример #1
0
        public string UpdateRule(SqlRelationModel model, params string[] conditions)
        {
            UpdateTemplate template   = new UpdateTemplate();
            var            temp_model = model.CopyInstance();

            temp_model.FilterFunction = model.FilterFunction;
            temp_model.ResetMembers(model.PreTable);
            string sql = template.UpdateWithCondition(temp_model, conditions);

            model.ClearFilter();
            return(sql);
        }
Пример #2
0
 /// <summary>
 /// 根据model信息生成 UPDATE [TableName] SET([member1]=@member1,[member2]...=@member2...) WHERE [condition1]=@condition,[condition2]=@condition2.....
 /// </summary>
 /// <param name="model">载有生成信息的Model</param>
 /// <param name="condition_models">需要匹配的成员集合</param>
 /// <returns>更新字符串结果</returns>
 public static string UpdateWithCondition(SqlModel model, params string[] conditions)
 {
     return(Update.UpdateWithCondition(model, conditions));
 }