Exemple #1
0
        /// <summary>
        /// Показывает поля работы с заявками
        /// </summary>
        private void viewRequests()
        {
            rightFunctionPanel.Controls.Clear();
              rightFunctionPanel.RowCount = 2;      // badcode
              rightFunctionPanel.ColumnCount = 3;   // badcode
              rightFunctionPanel.ColumnStyles.Insert(0, new ColumnStyle(SizeType.Percent, 33F));
              rightFunctionPanel.ColumnStyles.Insert(1, new ColumnStyle(SizeType.Percent, 33F));
              rightFunctionPanel.ColumnStyles.Insert(2, new ColumnStyle(SizeType.Percent, 33F));
              rightFunctionPanel.RowStyles.Insert(0, new RowStyle(SizeType.Percent, 90F));
              rightFunctionPanel.RowStyles.Insert(1, new RowStyle(SizeType.Absolute, ConstForms.ROW_HEIGHT));

              workDataGridView = initializeRequestDataGridView();
              List<List<string>> list = Program.mainMiddleClass.AllRequests();
              foreach (List<string> l in list) {
            workDataGridView.Rows.Add(l.ToArray<string>());
              }
              workDataGridView.Sort(workDataGridView.Columns[3], ListSortDirection.Descending);
              rightFunctionPanel.Controls.Add(workDataGridView, 0, 0);
              rightFunctionPanel.SetColumnSpan(workDataGridView, 3);

              AppButton addRequestButton = createAppButton("Добавить заявку");
              addRequestButton.Click += new EventHandler(addRequestButton_Click);
              rightFunctionPanel.Controls.Add(addRequestButton, 0, 1);

              AppButton deleteRequestButton = createAppButton("Удалить заявку");
              deleteRequestButton.Click += new EventHandler(deleteRequestButton_Click);
              rightFunctionPanel.Controls.Add(deleteRequestButton, 1, 1);

              AppButton passRequestButton = createAppButton("Отметить заявки выполненными");
              passRequestButton.Click += new EventHandler(passRequestButton_Click);
              rightFunctionPanel.Controls.Add(passRequestButton);
        }
Exemple #2
0
        private void viewProviders()
        {
            rightFunctionPanel.Controls.Clear();
              rightFunctionPanel.RowCount = 2;      // badcode
              rightFunctionPanel.ColumnCount = 3;   // badcode
              rightFunctionPanel.ColumnStyles.Insert(0, new ColumnStyle(SizeType.Percent, 33F));
              rightFunctionPanel.ColumnStyles.Insert(1, new ColumnStyle(SizeType.Percent, 33F));
              rightFunctionPanel.ColumnStyles.Insert(2, new ColumnStyle(SizeType.Percent, 33F));
              rightFunctionPanel.RowStyles.Insert(0, new RowStyle(SizeType.Percent, 90F));
              rightFunctionPanel.RowStyles.Insert(1, new RowStyle(SizeType.Absolute, ConstForms.ROW_HEIGHT));

              workDataGridView = initializeProviderDataGridView();
              rightFunctionPanel.Controls.Add(workDataGridView, 0, 0);
              rightFunctionPanel.SetColumnSpan(workDataGridView, 3);

              List<List<string>> list = Program.mainMiddleClass.AllProviders();
              foreach (List<string> l in list) {
            workDataGridView.Rows.Add(l.ToArray<string>());
              }

              AppButton addProviderButton = createAppButton("Добавить поставщика");
              addProviderButton.Click += new EventHandler(addProviderButton_Click);
              rightFunctionPanel.Controls.Add(addProviderButton, 0, 1);

              AppButton deleteProviderButton = createAppButton("Удалить поставщика");
              deleteProviderButton.Click += new EventHandler(deleteProviderButton_Click);
              rightFunctionPanel.Controls.Add(deleteProviderButton, 1, 1);
        }
Exemple #3
0
        /// <summary>
        /// Инициализирует DataGridView с заявками
        /// </summary>
        private AppDataGridView initializeRequestDataGridView()
        {
            AppDataGridView requestDataGridView = new AppDataGridView() {
            Indent = AppDataGridView.ControlIndent.Middle,
            Font = new Font("Times New Roman", 11F),
            AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells,
            RowHeadersVisible = false,
            ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize
              };
              List<string> columnNames = Program.mainMiddleClass.RequestFields();
              List<DataGridViewTextBoxColumn> columns = new List<DataGridViewTextBoxColumn>();
              foreach (string c in columnNames) {
            columns.Add(new DataGridViewTextBoxColumn() { HeaderText = c, AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill });
              }
              requestDataGridView.Columns.AddRange(columns.ToArray<DataGridViewColumn>());

              DataGridViewCheckBoxColumn checkColumn = new DataGridViewCheckBoxColumn() {
            AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill,
            FillWeight = 20F,
            ToolTipText = "Отметить выполнение"
              };
              requestDataGridView.Columns.Add(checkColumn);
              requestDataGridView.MinimumSize = new System.Drawing.Size(400, 400);
              requestDataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
              requestDataGridView.Columns[0].Width = 40;
              requestDataGridView.CellValueChanged += new DataGridViewCellEventHandler(requestDataGridView_CellValueChanged);
              CheckColumnIndex = requestDataGridView.Columns.Count - 1;
              return requestDataGridView;
        }
Exemple #4
0
        private AppDataGridView initializeProviderDataGridView()
        {
            AppDataGridView providerDataGridView = new AppDataGridView() {
            Indent = AppDataGridView.ControlIndent.Middle,
            Font = new Font("Times New Roman", 11F),
            AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells,
            RowHeadersVisible = false,
            ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize
              };
              List<string> columnNames = Program.mainMiddleClass.ProviderFields();
              List<DataGridViewTextBoxColumn> columns = new List<DataGridViewTextBoxColumn>();
              foreach (string c in columnNames) {
            columns.Add(new DataGridViewTextBoxColumn() { HeaderText = c, AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill });
              }
              providerDataGridView.Columns.AddRange(columns.ToArray<DataGridViewColumn>());

              providerDataGridView.MinimumSize = new System.Drawing.Size(400, 400);
              providerDataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
              providerDataGridView.Columns[0].Width = 40;
              return providerDataGridView;
        }
        private void viewClients()
        {
            rightFunctionPanel.Controls.Clear();
            rightFunctionPanel.RowCount = 2;      // badcode
            rightFunctionPanel.ColumnCount = 3;   // badcode
            rightFunctionPanel.ColumnStyles.Insert(0, new ColumnStyle(SizeType.Percent, 33F));
            rightFunctionPanel.ColumnStyles.Insert(1, new ColumnStyle(SizeType.Percent, 33F));
            rightFunctionPanel.ColumnStyles.Insert(2, new ColumnStyle(SizeType.Percent, 33F));
            rightFunctionPanel.RowStyles.Insert(0, new RowStyle(SizeType.Percent, 90F));
            rightFunctionPanel.RowStyles.Insert(1, new RowStyle(SizeType.Absolute, ConstForms.ROW_HEIGHT));

            workDataGridView = initializeClientDataGridView();
            List<List<string>> list = Program.mainMiddleClass.AllClients();
            for (int i = 0; i < list.Count; i++) {
                workDataGridView.Rows.Add(list[i].ToArray<string>());
                if (list[i][list[i].Count - 1] == "True") {
                    workDataGridView.Rows[i].Cells[workDataGridView.Rows.Count - 1].Value = true;
                }
            }
            rightFunctionPanel.Controls.Add(workDataGridView, 0, 0);
            rightFunctionPanel.SetColumnSpan(workDataGridView, 3);

            AppButton addClientButton = createAppButton("Добавить клиента");
            addClientButton.Click += new EventHandler(addClientButton_Click);
            rightFunctionPanel.Controls.Add(addClientButton, 0, 1);

            AppButton deleteClientButton = createAppButton("Удалить клиента");
            deleteClientButton.Click += new EventHandler(deleteClientButton_Click);
            rightFunctionPanel.Controls.Add(deleteClientButton, 1, 1);
        }
 private AppDataGridView initializeClientDataGridView()
 {
     AppDataGridView clientDataGridView = new AppDataGridView() {
         Indent = AppDataGridView.ControlIndent.Middle,
         Font = new Font("Times New Roman", 11F),
         AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells,
         RowHeadersVisible = false,
         ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize
     };
     List<string> columnNames = Program.mainMiddleClass.ClientFields();
     List<DataGridViewTextBoxColumn> columns = new List<DataGridViewTextBoxColumn>();
     foreach (string c in columnNames) {
         columns.Add(new DataGridViewTextBoxColumn() { HeaderText = c, AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill });
     }
     clientDataGridView.Columns.AddRange(columns.ToArray<DataGridViewColumn>());
     clientDataGridView.MinimumSize = new System.Drawing.Size(400, 400);
     clientDataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
     clientDataGridView.Columns[1].Width = 50;
     clientDataGridView.CellValueChanged += new DataGridViewCellEventHandler(requestDataGridView_CellValueChanged);
     for (int i = 0; i < clientDataGridView.Rows.Count; i++) {
         clientDataGridView.DoubleClick += new EventHandler(clientDataGridView_DoubleClick);
         clientDataGridView.SelectionChanged += new EventHandler(clientDataGridView_SelectionChanged);
     }
     return clientDataGridView;
 }