コード例 #1
0
ファイル: DB_Form.cs プロジェクト: jlovenpk1/LOJ
        public DB_Form(Synch.SynchPoolManager synchPoolManager, bool AdminShowSettings = false)
        {
            InitializeComponent();

            _synchPoolManager = synchPoolManager;

            _uTables = _synchPoolManager.UTables.ToArray();

            {
                var User = T.User.CreateSubTable(false);

                User.QUERRY().SHOW.DO();

                this.Users = new uint[User.Rows.Count];

                for (int i = 0; i < Users.Length; i++)
                {
                    Users[i] = User.Rows.GetID(i);
                    ForceUser_combo.Items.Add(User.Rows.Get <string>(i, C.User.Login));
                }
            }

            UpdatePeriod_Box.Text = UpdatePeriod.ToString();

            SelectCurrentSPool();

            ShowSettings = AdminShowSettings;

            Pass_Box_KeyDown(null, new KeyEventArgs(Keys.A));

            UTable_Grid.VirtualMode = true;

            UTable_Grid.Columns.Clear();
            UTable_Grid.Columns.Add("Number", "Номер");
            UTable_Grid.Columns.Add("Name", "Наименование");
            UTable_Grid.Columns.Add("Increment", "Инкремент");

            var column = new DataGridViewColumn();

            column.Name         = "Use";
            column.HeaderText   = "Задействовать";
            column.CellTemplate = new DataGridViewCheckBoxCell();

            UTable_Grid.Columns.Add(column);

            UTable_Grid.RowCount = _uTables.Length;

            PodrCode_label.Text += GetImportName(data.UserID);
        }
コード例 #2
0
        public UTable(SynchPoolManager Parent, DataBase.ISTable Table)
        {
            this._parent = Parent;
            this.Table   = Table;

            if (!RelationColumnExist(this.Table.Parent, "SPool"))
            {
                this.Table.Parent.Columns.AddRelation(T.SPool.GetColumn(C.SPool.Date), false, false);
            }

            this._id = 0;

            var tableName = Table.Parent.Name;

            if (_uTable == null)
            {
                _uTable = Parent.DataBase.Tables.First(x => x.Name == "UTable").CreateSubTable(false);
                _uTable.QUERRY().SHOW.DO();
            }

            for (int i = 0; i < _uTable.Rows.Count; i++)
            {
                var uTableName = _uTable.Rows.Get <string>(i, C.UTable.Name);

                if (String.Equals(tableName, uTableName, StringComparison.InvariantCultureIgnoreCase))
                {
                    this._id = _uTable.Rows.GetID(i);

                    if (this.Use)
                    {
                        this.Table.Parent.Rows.SetValue += SetPoolAction;
                    }

                    break;
                }
            }
        }