Beispiel #1
0
        public void RefreshData()
        {
            Appoints appoints = new Appoints(database, DocStateGroups.OnPoint, point);

            labelState.Text = appoints.Count.ToString() + " / " + point.Capacity.ToString();
            dataGridViewAppoints.DataSource = appoints;
        }
Beispiel #2
0
        private void buttonNegative_Click(object sender, EventArgs e)
        {
            Appoints appoints = (Appoints)dataGridViewInWay.DataSource;

            if (appoints.Count > 0 &&
                MessageBox.Show("ќтказать в обработке?", "¬нимание", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                ((Appoints)dataGridViewInWay.DataSource)[dataGridViewInWay.CurrentCell.RowIndex].GetOut(database, User);
            }
            RefreshData();
        }
Beispiel #3
0
        private void buttonReturn_Click(object sender, EventArgs e)
        {
            Appoints appoints = (Appoints)dataGridViewInWay.DataSource;

            if (appoints.Count > 0 &&
                MessageBox.Show("¬ернуть машину на сто¤нку?", "¬нимание", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                ((Appoints)dataGridViewInWay.DataSource)[dataGridViewInWay.CurrentCell.RowIndex].ReturnToDispatcher(database, User);
            }
            RefreshData();
        }
        private void buttonNextStep_Click(object sender, EventArgs e)
        {
            Appoints appoints = (Appoints)bindingSourceAppoints.DataSource;

            FormStart      form        = (FormStart)MdiParent;
            FormSetToPoint formAppoint = new FormSetToPoint();

            formAppoint.Database = database;
            formAppoint.Appoint  = (Appoint)bindingSourceAppoints.Current;

            form.AddChild(formAppoint);
        }
Beispiel #5
0
        private void buttonToPoint_Click(object sender, EventArgs e)
        {
            Appoints appoints = (Appoints)dataGridViewInWay.DataSource;

            if (appoints.Count > 0)
            {
                FormStart      form    = (FormStart)MdiParent;
                FormGetAppoint formGet = new FormGetAppoint();
                formGet.Database = database;
                formGet.Ready    = true;
                formGet.Appoint  = ((Appoints)dataGridViewInWay.DataSource)[dataGridViewInWay.CurrentCell.RowIndex];
                form.AddDialog(formGet);
                RefreshData();
            }
        }
Beispiel #6
0
        private void buttonIdle_Click(object sender, EventArgs e)
        {
            Appoints appoints = (Appoints)dataGridViewDispatcher.DataSource;

            if (appoints.Count > 0)
            {
                FormStart      parent = (FormStart)MdiParent;
                FormBrakeOrOut form   = new FormBrakeOrOut();
                form.Database = database;
                form.Appoint  = ((Appoints)dataGridViewDispatcher.DataSource)[dataGridViewDispatcher.CurrentCell.RowIndex];
                form.GetOut   = false;
                parent.AddDialog(form);
                RefreshData();
            }
        }
Beispiel #7
0
        private void textBoxLookup_TextChanged(object sender, EventArgs e)
        {
            string str = textBoxLookup.Text;

            string[] properties = { "LicensePlate", "DriverName", "Warrant" };

            Appoints appoints = (Appoints)dataGridViewDispatcher.DataSource;

            if (appoints.Count > 0 && str.Length > 0)
            {
                int index = appoints.FindIndex(properties[comboBoxProperties.SelectedIndex],
                                               str, SearchTerm.Contains, 0);
                if (index == -1)
                {
                    index = 0;
                }
                dataGridViewDispatcher.CurrentCell = dataGridViewDispatcher[0, index];
            }
        }
Beispiel #8
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 = "обновить";
        }