Ejemplo n.º 1
0
 public string GenTableQueryCode(TableQueryGenModel model)
 {
     string code = "";
     switch (model.GenType)
     {
         case TableQueryGenType.Get:
             code = codeGen.Gen(this.Temp_TableSnippet_Get, model);
             break;
         case TableQueryGenType.GetList:
             code = codeGen.Gen(this.Temp_TableSnippet_GetList, model);
             break;
         case TableQueryGenType.Paged:
             code = codeGen.Gen(this.Temp_TableSnippet_Paged, model);
             break;
         case TableQueryGenType.Top:
             code = codeGen.Gen(this.Temp_TableSnippet_Top, model);
             break;
         case TableQueryGenType.Exist:
             code = codeGen.Gen(this.Temp_TableSnippet_Exist, model);
             break;
         case TableQueryGenType.Count:
             code = codeGen.Gen(this.Temp_TableSnippet_Count, model);
             break;
         default:
             break;
     }
     return code;
 }
Ejemplo n.º 2
0
        private void OrderByPage_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
        {
            OrderByItems = ctrlOrderBy.GetOrderByItems();

            DbSnippetGen gen = new DbSnippetGen();
            TableQueryGenModel model = new TableQueryGenModel();
            model.Table = this.Table;
            model.GenType = this.GenType;
            model.WhereColumns = this.WhereColumns;
            model.OrderBy = this.OrderByItems;
            model.ResultItemClassName = this.Table.PascalName;
            string code = gen.GenTableQueryCode(model);

            ctrlCodeView.Show(code);
        }