public BaseLogic(BaseCache cache, DataBase.ITable table) { this.Table = table; this.Cache = cache; //addLogic(this); }
public static BaseLogic TryGetLogic(DataBase.ITable table) { BaseLogic logic; _logics.TryGetValue(table, out logic); return(logic); }
public static BaseLogic GetLogic(DataBase.ITable table) { if (_logics.ContainsKey(table)) { return(_logics[table]); } else { return(null); } }
private static bool RelationColumnExist(DataBase.ITable table, string columnName) { var result = false; for (int i = 0; i < table.Columns.Count; i++) { var column = table.GetColumn(i); if (column.Name == columnName) { result = true; break; } } return(result); }
public static string GetShortFIO(DataBase.ITable Table, uint ID, params int[] ColIndex) { string temp = Table.Rows.Get <string>(ID, ColIndex[0]) + ' ' , temp1; for (int i = 1; i < ColIndex.Length; i++) { temp1 = Table.Rows.Get <string>(ID, ColIndex[i]); if (temp1.Length == 0) { temp += '.'; } else { temp += temp1.Substring(0, 1).ToUpper() + '.'; } } return(temp); }
private void SetPoolAction(DataBase.ITable _Table, DataBase.AddSet_class Vals) { Vals.Add(_Table.Columns.Count - 1, LastPoolID); }
/// <summary>Добавить не кеширующую таблицу</summary> static bool AddRemote(StartupLogo_Window.Loading_class Loading, string Name, string AlterName, ref DataBase.ITable Table, ref DataBase.ISTable SubTable, AddCols_delegate AddCols, bool Dedicate) { if (Loading != null) { Loading.LoadingComment = Name; } if (Table != null) { throw new Exception("Таблица уже существует!"); } Table = data.T1.Tables.Add(Name, AlterName); AddCols(Table); Table.AutoSave(Dedicate, DataBase.TypeOfTable.Remote); if (data.T1.type == DataBase.RemoteType.Local || Table.Parent.DataSourceEnabled) { SubTable = Table.CreateSubTable(); return(true); } else { if (Loading != null) { Loading.LoadingComment = "Ошибка"; } return(false); } }
static void clearCache(DataBase.ITable table) { ClearQuerryCacheAll(); }
private void SetPoolAction(DataBase.ITable table, DataBase.AddSet_class e) { e.Add(table.Columns.Count - 1, this._parent.LastPoolID); }
public BaseLogicTyped(DataBase.ITable table) : base(new Cache <ModelT>(), table) { this.Table.Rows.AfterAddRow += (t, id) => getModel(id); this._table = Table.CreateSubTable(false); }
static bool AddSynch(DataBase db, StartupLogo_Form.Loading_class Loading, string Name, string AlterName, ref DataBase.ITable Table, ref DataBase.ISTable SubTable, AddCols_delegate AddCols, bool Dedicate) { if (Loading != null) { Loading.LoadingComment = Name; } if (CheckTablesExist && Table != null) { throw new Exception("Таблица уже существует!"); } Table = db.Tables.Add(Encoding.GetEncoding(866), Name, AlterName); AddCols(Table); Table.AutoSave(Dedicate, DataBase.TypeOfTable.Combine); if (Table.Parent.DataSourceEnabled || Table.Parent.type == DataBase.RemoteType.Local) { SubTable = Table.CreateSubTable(); SubTable.QUERRY().SHOW.DO(); return(true); } else { if (Loading != null) { Loading.LoadingComment = "Ошибка"; } return(false); } }
public Table_struct(DataBase.ITable Table) { this.Table = Table; }