コード例 #1
0
        private void Add_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                InspectorModel inspector = new InspectorModel()
                {
                    FirstName     = FirtsName.Text,
                    LastName      = LastName.Text,
                    Patronymic    = Patronymic.Text,
                    DateBirth     = DateBirth.SelectedDate.Value,
                    Login         = Login.Text,
                    Password      = Password.Text,
                    PasportSeries = PasportSeries.Text,
                    PasportNumber = PasportNumber.Text,
                    Position      = LogicPosition.GetIdByName(Position.Text)
                };

                LogicInspector.SaveInspector(inspector);
                MessageBox.Show("Инспектор успешно зарегистрирован!");

                InspectorList inspectorList = new InspectorList();
                inspectorList.Show();
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #2
0
        private void Back_Click(object sender, RoutedEventArgs e)
        {
            InspectorList inspectorList = new InspectorList();

            inspectorList.Show();
            this.Close();
        }