Esempio n. 1
0
        public void SetReadOnly()
        {
            panelDispatcherTools.Visible = false;
            panelGetTools.Visible        = false;

            for (int i = 0; i < panelPoints.Controls.Count; i++)
            {
                UserControlPoint control = (UserControlPoint)panelPoints.Controls[i];
                control.SetReadOnly();
            }
        }
Esempio n. 2
0
 private void comboBoxUnits_SelectedValueChanged(object sender, EventArgs e)
 {
     if (database != null && comboBoxUnits.SelectedItem is Unit)
     {
         panelPoints.Controls.Clear();
         Points points   = new Points(database, (Unit)comboBoxUnits.SelectedItem);
         int    position = 0;
         for (int i = 0; i < points.Count; i++)
         {
             UserControlPoint control = new UserControlPoint();
             control.Database = database;
             control.Point    = points[i];
             control.Top      = position;
             control.Left     = 0;
             position        += control.Height;
             panelPoints.Controls.Add(control);
         }
         RefreshData();
     }
 }
Esempio n. 3
0
        public void RefreshData()
        {
            buttonRefresh.Text = "обновл¤ю";
            int idAppoint = 0;

            if (dataGridViewDispatcher.DataSource != null &&
                dataGridViewDispatcher.CurrentCell != null &&
                dataGridViewDispatcher.Rows.Count > 0)
            {
                idAppoint = ((Appoints)dataGridViewDispatcher.DataSource)[dataGridViewDispatcher.CurrentCell.RowIndex].Id;
            }

            Appoints appoints = new Appoints(database, DocStateGroups.Dispatcher,
                                             (Unit)comboBoxUnits.SelectedItem);

            dataGridViewDispatcher.DataSource = appoints;
            int index = appoints.FindIndex("Id", idAppoint, EPV.Data.SearchTerm.Full, 0);

            if (index > -1)
            {
                dataGridViewDispatcher.CurrentCell = dataGridViewDispatcher[0, index];
            }

            dataGridViewInWay.DataSource = new Appoints(database, DocStateGroups.BeforeStart,
                                                        (Unit)comboBoxUnits.SelectedItem);

            //panelPoints.Visible = false;
            for (int i = 0; i < panelPoints.Controls.Count; i++)
            {
                UserControlPoint control = (UserControlPoint)panelPoints.Controls[i];
                control.RefreshData();
            }
            //panelPoints.Visible = true;

            timerToRefresh     = Settings.Default.SecondsToRefresh;
            buttonRefresh.Text = "обновить";
        }