Example #1
0
 public override void WriteGenSqlBody(CSharpWriter csw, RuleCompiler cmp)
 {
     if (!Mandatory)
     {
         csw.Begin("if ({0})", IsVariable);
     }
     csw.Begin("switch ({0})", EnumVarName);
     for (int i = 0; i < Chains.Count; i++)
     {
         csw.WriteLine("case {0}.{1}:", EnumTypeName, EnumElems[i]);
         csw.Inc();
         Chains[i].WriteGenSqlBody(csw, cmp);
         csw.WriteLine("break;");
         csw.Dec();
     }
     csw.End(); // switch
     if (!Mandatory)
     {
         csw.End();             // if ($IsVariable)
     }
 }