Esempio n. 1
0
//        var ctx = new SchoolDBEntities()

//var student = ctx.Students.Where(s => s.Name == "John Doe").First();

//        student.Name = "Erik Blessman";

//ctx.SaveChanges(); // Will update the  student
        private void UPDATE_Click(object sender, RoutedEventArgs e)
        {
            Model1 db = new Model1();

            try
            {
                Users user = new Users
                {
                    username = us.Text,
                    password = pa.Text,
                    fio      = fi.Text,
                    role     = ro.Text
                };
                DeviceLogic.ChangeDevice(ChangeDevice);
                MessageBox.Show("Информация об устройсте успешно изменена");
                DeviceListWindow deviceList = new DeviceListWindow();
                deviceList.Show();
                this.Close();
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        private void LoadConfig()
        {
            var window = new DeviceListWindow();
            var dialog = window.ShowDialog().GetValueOrDefault();

            if (dialog)
            {
                currentConfig = window.DeviceConfig;
                TCList        = JsonConvert.DeserializeObject <ObservableCollection <TCViewModel> >(currentConfig.DeviceContent);
            }
        }