Exemplo n.º 1
0
 public CreateEntitySP(string name, string author,
                       List <Column> columns, Column idColumn, Table table, bool needAutoGuid) : base(name, author)
 {
     this.needAutoGuid = needAutoGuid;
     this.idColumn     = idColumn;
     this.table        = table;
     this.columns      = columns;
     this.Description  = string.Format("Create entity of {0}", table.Name);
     this.Parameters   = new List <StoredProcedureParameter>();
     foreach (Column column in columns)
     {
         StoredProcedureParameter param = new StoredProcedureParameter(column);
         if (column.Name == idColumn.Name && needAutoGuid)
         {
             if (idColumn.CSTypeName == "int")
             {
                 param.ParameterDirection = System.Data.ParameterDirection.Output;
             }
             else if (idColumn.CSTypeName == "Guid")
             {
                 param.ParameterDirection = System.Data.ParameterDirection.Output;
             }
         }
         this.Parameters.Add(param);
     }
 }
Exemplo n.º 2
0
 public UpdateEntitySP(string name, string author,
                       List <Column> columns, Column idColumn, Table table)
     : base(name, author)
 {
     this.idColumn    = idColumn;
     this.table       = table;
     this.columns     = columns;
     this.Description = string.Format("Update entity of {0}", table.Name);
     this.Parameters  = new List <StoredProcedureParameter>();
     foreach (Column column in columns)
     {
         StoredProcedureParameter param = new StoredProcedureParameter(column);
         this.Parameters.Add(param);
     }
 }