Ejemplo n.º 1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Informacje newInfo = new Informacje()
            {
                Id         = 1,
                Wlasciciel = Owner.Text,
                Adres      = Address.Text,
                Telefon    = PhoneNumber.Text,
                Fax        = Fax.Text,
                Kasjerzy   = Cashiers.Text,
                Myjnia     = Wash_Stuff.Text,
                Monitoring = Monitoring_Stuff.Text,
                ObslugaLPG = LPG_Stuff.Text
            };

            using (SQLite.SQLiteConnection conn = new SQLite.SQLiteConnection(App.databasePath))
            {
                conn.CreateTable <Informacje>();
                conn.InsertOrReplace(newInfo);
            }

            MessageBox.Show("Zaktualizowano.");
            MainWindow mainWindow = new MainWindow(_loggedInAccount);

            this.Close();
            mainWindow.Show();
        }
Ejemplo n.º 2
0
        private void showOwner(object sender, RoutedEventArgs e)
        {
            using (SQLiteConnection conn = new SQLiteConnection(App.databasePath))
            {
                conn.CreateTable <Informacje>();
                owner = (conn.Table <Informacje>().FirstOrDefault());

                Owner.Content            = owner.Wlasciciel;
                Address.Content          = owner.Adres;
                PhoneNumber.Content      = owner.Telefon;
                Fax.Content              = owner.Fax;
                Cashiers.Content         = owner.Kasjerzy;
                Wash_Stuff.Content       = owner.Myjnia;
                Monitoring_Stuff.Content = owner.Monitoring;
                LPG_Stuff.Content        = owner.ObslugaLPG;
            }
        }
Ejemplo n.º 3
0
        public Contact_Data_Window(Konto account)
        {
            _loggedInAccount = account;
            InitializeComponent();
            Informacje data = new Informacje();

            using (SQLite.SQLiteConnection conn = new SQLite.SQLiteConnection(App.databasePath))
            {
                data = conn.Table <Informacje>().FirstOrDefault();
            }
            if (data != null)
            {
                Owner.Text            = data.Wlasciciel;
                Address.Text          = data.Adres;
                PhoneNumber.Text      = data.Telefon;
                Fax.Text              = data.Fax;
                Cashiers.Text         = data.Kasjerzy;
                Wash_Stuff.Text       = data.Myjnia;
                Monitoring_Stuff.Text = data.Monitoring;
                LPG_Stuff.Text        = data.ObslugaLPG;
            }
        }