예제 #1
0
        private void Change_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                TransportModel transport = new TransportModel()
                {
                    Manufacturer      = Manufacturer.Text,
                    Model             = Model.Text,
                    CategoryTransport = LogicCategoryTransport.GetIdByName(CategoryTransport.Text),
                    YearTransport     = YearTransport.Text,
                    NumberEngine      = NumberEngine.Text,
                    ModelEngine       = ModelEngine.Text,
                    YearEngine        = YearEngine.Text,
                    PowerEngineKVT    = PowerEngineK.Text,
                    PowerEngineH      = PowerEngineH.Text,
                    MaxLoad           = double.Parse(MaxLoad.Text),
                    Color             = Color.Text,
                    Weight            = double.Parse(Weight.Text),
                    VIN         = VIN.Text,
                    TypeOfDrive = LogicTypeOfDrive.GetIdByName(TypeOfDrive.Text),
                    Description = Description.Text
                };

                LogicTransport.ChangeTransport(transport);
                MessageBox.Show("Транспорт успешно изменен");

                TransportList transportList = new TransportList();
                transportList.Show();
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
예제 #2
0
        private void Back_Click(object sender, RoutedEventArgs e)
        {
            SecurityContext.CurrentTransport = 0;
            TransportList transportList = new TransportList();

            transportList.Show();
            this.Close();
        }
예제 #3
0
        private void Delete_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                LogicTransport.DeleteTransport();
                MessageBox.Show("Автомобиль успешно удален");

                TransportList transportList = new TransportList();
                transportList.Show();
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
예제 #4
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            switch (Logic.SecurityContext.CurrentWindow)
            {
            case EnumWindow.AddInsurance:
                this.Close();
                break;

            case EnumWindow.AddLicense:
                this.Close();
                break;

            case EnumWindow.ChangeDriver:
                this.Close();
                break;

            case EnumWindow.TransportList:
                TransportList TransportList = new TransportList();
                TransportList.Show();
                this.Close();
                break;
            }
        }