private void Add_Click(object sender, RoutedEventArgs e) { try { InsurancesModel insurances = new InsurancesModel() { IdTransport = LogicTransport.GetIdByVIN(VIN.Text), InsurancesDate = DateInsurance.SelectedDate.Value, ExpireDate = DateExpire.SelectedDate.Value, Series = Series.Text, Number = Number.Text, Type = LogicTypeInsurances.GetIdByName(Type.Text), Sum = double.Parse(Sum.Text) }; LogicInsurances.SaveInsurance(insurances); MessageBox.Show("Страховка успешно зарегистрирована"); InspectorMainWindow inspector = new InspectorMainWindow(); inspector.Show(); this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void Back_Click(object sender, RoutedEventArgs e) { InspectorMainWindow inspector = new InspectorMainWindow(); inspector.Show(); this.Close(); }
private void Change_Click(object sender, RoutedEventArgs e) { try { if (NextDriverList.SelectedCells.Count > 0) { LogicTransport.ChangeDriver(dtDriver.Rows[NextDriverList.SelectedIndex].ItemArray[2].ToString()); MessageBox.Show("Смена владельца прошла успешно!"); Logic.SecurityContext.CurrentTransport = 0; InspectorMainWindow inspector = new InspectorMainWindow(); inspector.Show(); this.Close(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void Change_Click(object sender, RoutedEventArgs e) { try { StatusChangeModel status = new StatusChangeModel(); status.DateChange = DateTime.Today; status.Descriptoin = Description.Text; status.IdLicense = LogicLicense.GetId(License.Text); status.CurrentStatus = LogicStatusLicense.GetIdByName(StatusName.Text); LogicLicense.ChangeStatusLicense(status); MessageBox.Show("Статус лицензии успешно изменен!"); InspectorMainWindow inspector = new InspectorMainWindow(); inspector.Show(); this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }