示例#1
0
        public ClientServiceForm()
        {
            InitializeComponent();
            DB.DETLT2020Entities entities = new DB.DETLT2020Entities();

            mainGrid.ItemsSource = entities.ClientServices.ToList();
        }
示例#2
0
        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("Запись  сохранне  в бд");
        }
示例#3
0
        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);
            }
        }
示例#4
0
        public AddClient()
        {
            InitializeComponent();

            DB.DETLT2020Entities entities = new DB.DETLT2020Entities();

            newClient            = new DB.Client();
            mainGrid.DataContext = newClient;
            cbGender.ItemsSource = entities.Genders.ToList();
        }
示例#5
0
        public addClientServisForm()
        {
            InitializeComponent();

            DB.DETLT2020Entities entities = new DB.DETLT2020Entities();

            cbClient.ItemsSource = entities.Clients.ToList();
            cbServis.ItemsSource = entities.Services.ToList();


            dtMaim.Value = DateTime.Now;
        }
示例#6
0
 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("Ошибка БД");
     }
 }
示例#7
0
        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));
            }
        }
示例#8
0
        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  ");
            }
        }
示例#9
0
 private void Refresh()
 {
     entities             = new DB.DETLT2020Entities();
     clients              = new List <DB.Client>(entities.Clients.ToList());
     mainGrid.ItemsSource = clients;
 }
示例#10
0
 public ServisController(DB.Service service)
 {
     entities = new DB.DETLT2020Entities();
     Service  = service;
 }