Ejemplo n.º 1
0
 /// <summary>
 /// Add columnd to table in DB
 /// </summary>
 /// <param name="table">Table name</param>
 /// <param name="column">Column model</param>
 /// <returns>Exception message if failed, NULL if not</returns>
 public string AddColumn(string table, TableRowModel column)
 {
     try
     {
         var ctx = new DatabaseContext(SessionProvider.Instance.ConnectionType);
         ctx.AddColumn(table, column);
         return(null);
     }
     catch (Exception exception) when(exception is SqlException || exception is OracleException)
     {
         Output.WriteLine(OutputPanelListener.PrepareException(exception.Message));
         return(exception.Message);
     }
 }