public ClientServiceForm() { InitializeComponent(); DB.DETLT2020Entities entities = new DB.DETLT2020Entities(); mainGrid.ItemsSource = entities.ClientServices.ToList(); }
private void add_Click(object sender, RoutedEventArgs e) { var cl = cbClient.SelectedItem as DB.Client; var servis = cbServis.SelectedItem as DB.Service; DateTime date = dtMaim.Value.GetValueOrDefault(); DB.DETLT2020Entities entities = new DB.DETLT2020Entities(); var s = new DB.ClientService(); s.ServiceID = servis.ID; s.ClientID = cl.ID; s.StartTime = date; s.Comment = "lyalya"; entities.ClientServices.Add(s); entities.SaveChanges(); MessageBox.Show("Запись сохранне в бд"); }
private void add_Click(object sender, RoutedEventArgs e) { newClient = mainGrid.DataContext as DB.Client; var gender = cbGender.SelectedItem as DB.Gender; newClient.GenderCode = gender.Code; newClient.RegistrationDate = dt2.DisplayDate; newClient.Birthday = dt.SelectedDate; try { DB.DETLT2020Entities entities = new DB.DETLT2020Entities(); entities.Clients.Add(newClient); entities.SaveChanges(); MessageBox.Show("сохранение прошло успешно"); DialogResult = true; this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public AddClient() { InitializeComponent(); DB.DETLT2020Entities entities = new DB.DETLT2020Entities(); newClient = new DB.Client(); mainGrid.DataContext = newClient; cbGender.ItemsSource = entities.Genders.ToList(); }
public addClientServisForm() { InitializeComponent(); DB.DETLT2020Entities entities = new DB.DETLT2020Entities(); cbClient.ItemsSource = entities.Clients.ToList(); cbServis.ItemsSource = entities.Services.ToList(); dtMaim.Value = DateTime.Now; }
public ServisController(BL.ModelView.ServisView view) { try { entities = new DB.DETLT2020Entities(); Service = entities.Services.Where(x => x.Title == view.Title).First();; } catch { throw new Exception("Ошибка БД"); } }
public ImageControllercs( ) { DB.DETLT2020Entities entities = new DB.DETLT2020Entities(); var imag = entities.Services.Select(x => x.MainImagePath).Distinct(); ImageViews = new List <ImageView>(); foreach (var s in imag) { ImageViews.Add(new ImageView(s)); } }
public ServisController() { ServisViews = new List <ModelView.ServisView>(); try { entities = new DB.DETLT2020Entities(); var serv = entities.Services.ToList(); foreach (var l in serv) { ServisViews.Add(new ModelView.ServisView(l)); } } catch { throw new Exception("Eror db "); } }
private void Refresh() { entities = new DB.DETLT2020Entities(); clients = new List <DB.Client>(entities.Clients.ToList()); mainGrid.ItemsSource = clients; }
public ServisController(DB.Service service) { entities = new DB.DETLT2020Entities(); Service = service; }