/// <summary> /// device 추가 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button1_Click(object sender, RoutedEventArgs e) { conn = new SQLiteConnection(@"Data Source=C:\Users\Endas\Desktop\test.db;Version=3;"); conn.Open(); String sql = "INSERT INTO Device VALUES ('" + device_ip.Text + "','" + device_id.Text + "','" + device_pw.Text + "','" + device_Mac.Text + "','" + device_subn.Text + "')"; SQLiteCommand command = new SQLiteCommand(sql, conn); int result = command.ExecuteNonQuery(); management MG = management.instance(); Device NewDevice = new Device(device_ip.Text, device_id.Text, device_pw.Text, device_Mac.Text, device_subn.Text); MG.AddToDevice(NewDevice); conn.Close(); }
public MainWindow() { InitializeComponent(); //디비 연동해서 디바이스 카메라 초기에 리스트에 담아두기 MG = management.instance(); MG.AddToDevice(); MG.AddToCamera(); this.Loaded += new RoutedEventHandler(MainWindow_Loaded); this.MouseLeftButtonDown += Window1_MouseLeftButtonDown; // SQLiteConnection conn = null; // conn = new SQLiteConnection(@"Data Source=C:\Users\Endas\Desktop\test.db;Version=3;"); // conn.Open(); frame.Source = new Uri("dashboard.xaml", UriKind.Relative); this.Loaded += new RoutedEventHandler(MainWindow_Loaded); this.Closed += MainWindow_Closed; }