Пример #1
0
        public void Delete(DataClasses.ReportColumnsSchema column)
        {
            DbContext.ReportColumnsSchemas.DeleteAllOnSubmit(RetrieveAllColumnsSchema().Where(t => t.ReportColumnsSchemaId == column.ReportColumnsSchemaId));

            DbContext.SubmitChanges();
            DataManager.Commit();
        }
Пример #2
0
 public void Update(DataClasses.ReportColumnsSchema original_x, DataClasses.ReportColumnsSchema x)
 {
     //DbContext.ReportColumnsSchemas.Attach(original_x);
     original_x.CopyPropertiesFrom(x);
     DbContext.SubmitChanges();
     DataManager.Commit();
 }
Пример #3
0
 private void BuildSort(DataClasses.ReportSettings settings)
 {
     query.Append(" ORDER BY   ");
     foreach (DataClasses.ReportSort sort in settings.SortedColumns)
     {
         DataClasses.ReportColumnsSchema columnSchema = GetColumnSchema(sort.ReportTablesSchemaId, sort.ReportColumnsSchemaId);
         if (!columnSchema.Source.Contains(")"))
         {
             query.Append(columnSchema.Source + ((bool)sort.Ascending ? ", " : " DESC, "));
         }
     }
     // Remove trailing ", "
     query.Remove(query.Length - 2, 2);
 }
Пример #4
0
 private void AddColumnInQuery(DataClasses.ReportColumn column)
 {
     DataClasses.ReportColumnsSchema columnSchema = null;
     // DataClasses.ReportDataFunction function;
     //if (column.ReportDataFunctionId == null)
     //{
     columnSchema = GetColumnSchema(column.ReportTablesSchemaId, column.ReportColumnsSchemaId);
     query.Append(columnSchema.Source + " as [" + columnSchema.Name + "], ");
     //}
     //else
     //{
     //    function = null;
     //    query.Append(function.SqlText.Replace("[=Column=]", columnSchema.Source) + ", ");
     //}
 }
Пример #5
0
        public DataReader RetrieveFilterListItems(DataClasses.ReportColumnsSchema column)
        {
            string query = @"SELECT " + column.PrimaryKey + ", " + column.PrimaryLabelColumn + " FROM " + column.PrimaryTable;

            return(DataManager.ExecuteReader(query));
        }
Пример #6
0
 public void Insert(DataClasses.ReportColumnsSchema column)
 {
     DbContext.ReportColumnsSchemas.InsertOnSubmit(column);
     DbContext.SubmitChanges();
     DataManager.Commit();
 }