public void Delete(DataClasses.ReportColumnsSchema column) { DbContext.ReportColumnsSchemas.DeleteAllOnSubmit(RetrieveAllColumnsSchema().Where(t => t.ReportColumnsSchemaId == column.ReportColumnsSchemaId)); DbContext.SubmitChanges(); DataManager.Commit(); }
public void Update(DataClasses.ReportColumnsSchema original_x, DataClasses.ReportColumnsSchema x) { //DbContext.ReportColumnsSchemas.Attach(original_x); original_x.CopyPropertiesFrom(x); DbContext.SubmitChanges(); DataManager.Commit(); }
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); }
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) + ", "); //} }
public DataReader RetrieveFilterListItems(DataClasses.ReportColumnsSchema column) { string query = @"SELECT " + column.PrimaryKey + ", " + column.PrimaryLabelColumn + " FROM " + column.PrimaryTable; return(DataManager.ExecuteReader(query)); }
public void Insert(DataClasses.ReportColumnsSchema column) { DbContext.ReportColumnsSchemas.InsertOnSubmit(column); DbContext.SubmitChanges(); DataManager.Commit(); }