Ejemplo n.º 1
0
        public BaseLogic(BaseCache cache, DataBase.ITable table)
        {
            this.Table = table;
            this.Cache = cache;

            //addLogic(this);
        }
Ejemplo n.º 2
0
        public static BaseLogic TryGetLogic(DataBase.ITable table)
        {
            BaseLogic logic;

            _logics.TryGetValue(table, out logic);

            return(logic);
        }
Ejemplo n.º 3
0
 public static BaseLogic GetLogic(DataBase.ITable table)
 {
     if (_logics.ContainsKey(table))
     {
         return(_logics[table]);
     }
     else
     {
         return(null);
     }
 }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
 private void SetPoolAction(DataBase.ITable _Table, DataBase.AddSet_class Vals)
 {
     Vals.Add(_Table.Columns.Count - 1, LastPoolID);
 }
Ejemplo n.º 7
0
        /// <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);
            }
        }
Ejemplo n.º 8
0
 static void clearCache(DataBase.ITable table)
 {
     ClearQuerryCacheAll();
 }
Ejemplo n.º 9
0
 private void SetPoolAction(DataBase.ITable table, DataBase.AddSet_class e)
 {
     e.Add(table.Columns.Count - 1, this._parent.LastPoolID);
 }
Ejemplo n.º 10
0
 public BaseLogicTyped(DataBase.ITable table)
     : base(new Cache <ModelT>(), table)
 {
     this.Table.Rows.AfterAddRow += (t, id) => getModel(id);
     this._table = Table.CreateSubTable(false);
 }
Ejemplo n.º 11
0
        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);
            }
        }
Ejemplo n.º 12
0
 public Table_struct(DataBase.ITable Table)
 {
     this.Table = Table;
 }