Esempio n. 1
0
 private static void GetParameterListItemPunc(InterpolationArgs args, string column, out string conjunction, out string indent, out string endLine)
 {
     if (args.TemplateName == "DELETE")
     {
         conjunction = GetConjunction(args, dr => args.IsPrimaryKey(dr["COLUMN_NAME"].ToString()), string.Empty, " ", ",");
         indent = args.IsFirstPrimaryKey(column) ? string.Empty : args.IndentString;
         endLine = args.IsLastPrimaryKey(column) ? string.Empty : Environment.NewLine;
     }
     else if (args.TemplateName == "INSERT")
     {
         conjunction = GetConjunction(args, dr => !args.IsIdentity(dr["COLUMN_NAME"].ToString()), string.Empty, " ", ",");
         indent = args.IsFirstNonIdentity(column) ? string.Empty : args.IndentString;
         endLine = args.IsLastNonIdentity(column) ? string.Empty : Environment.NewLine;
     }
     else
     {
         conjunction = GetConjunction(args, string.Empty, " ", ",");
         indent = args.ColumnIndex == 0 ? string.Empty : args.IndentString;
         endLine = args.ColumnIndex == args.Columns.Count - 1 ? string.Empty : Environment.NewLine;
     }
 }