Exemplo n.º 1
0
        private void simpleButtonAddDamage_Click(object sender, EventArgs e)
        {
            DamageForm df = new DamageForm();

            if (df.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }
            _damages.Add(df.GetDamage());
            gridControlDamages.DataSource = null;
            gridControlDamages.DataSource = _damages;
        }
Exemplo n.º 2
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            var df = new DamageForm();

            if (df.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }
            var dd = df.GetDamage();

            dd.CarId = _order.Car.Id;
            _order.Damages.Add(dd);
            ShowDamages();
        }
Exemplo n.º 3
0
        private void simpleButton2_Click(object sender, EventArgs e)
        {
            if (gridView1.SelectedRowsCount == 0)
            {
                MessageBox.Show(Resources.CloseOrderForm_simpleButton2_Click_Выберите_повреждение_для_редактирования_);
                return;
            }
            var idx = gridView1.GetSelectedRows()[0];
            var row = (Damage)gridView1.GetRow(idx);
            var df  = new DamageForm(row);

            if (df.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }
            df.GetDamage();
            ShowDamages();
        }
Exemplo n.º 4
0
        private void simpleButtonChangeDamage_Click(object sender, EventArgs e)
        {
            if (gridViewDamages.SelectedRowsCount == 0)
            {
                MessageBox.Show("Выберите повреждение для редактирования.");
                return;
            }
            var        idx    = gridViewDamages.GetSelectedRows()[0];
            var        damage = (Damage)gridViewDamages.GetRow(idx);
            DamageForm df     = new DamageForm(damage);

            if (df.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }
            df.GetDamage();
            gridControlDamages.DataSource = null;
            gridControlDamages.DataSource = _damages;
        }