Exemplo n.º 1
0
        private void UpdateBut_Click(object sender, RoutedEventArgs e)
        {
            switch (_mode)
            {
            case 1:
                query = $"UPDATE USERS SET LOGIN = '******' WHERE ID = {Int32.Parse(_ID)}";
                EX_QUERY(query, $"Data Source={Data}");
                _PUC.Content = ChangeBox.Text;
                _Window.Close();
                break;

            case 3:
                query = $"UPDATE USERS SET FIRST_NAME = '{ChangeBox.Text}' WHERE ID = {Int32.Parse(_ID)}";
                EX_QUERY(query, $"Data Source={Data}");
                _PUC.FNLBL.Content = ChangeBox.Text;
                _PV.FN_man.Content = ChangeBox.Text;

                fullname = ((_main.FN_LNlbl.Content).ToString()).Split();
                _main.FN_LNlbl.Content = ChangeBox.Text + " " + fullname[1];
                _Window.Close();
                break;

            case 4:
                query = $"UPDATE USERS SET LAST_NAME = '{ChangeBox.Text}' WHERE ID = {Int32.Parse(_ID)}";
                EX_QUERY(query, $"Data Source={Data}");
                _PUC.LNLBL.Content = ChangeBox.Text;
                _PV.LN_man.Content = ChangeBox.Text;

                fullname = ((_main.FN_LNlbl.Content).ToString()).Split();
                _main.FN_LNlbl.Content = fullname[0] + " " + ChangeBox.Text;
                _Window.Close();
                break;

            case 5:
                query = $"UPDATE USERS SET E_MAIL = '{ChangeBox.Text}' WHERE ID = {Int32.Parse(_ID)}";
                EX_QUERY(query, $"Data Source={Data}");
                _PUC.EMAILLBL.Content = ChangeBox.Text;
                _Window.Close();
                break;

            case 7:
                query = $"UPDATE USERS SET CITY = '{ChangeBox.Text}' WHERE ID = {Int32.Parse(_ID)}";
                EX_QUERY(query, $"Data Source={Data}");
                _PUC.CityLBL.Content = ChangeBox.Text;
                _Window.Close();
                break;
            }
        }
Exemplo n.º 2
0
 private void UpdateBut_Click(object sender, RoutedEventArgs e)
 {
     if (CrePass[0] == OLDPass.Password.ToString())
     {
         query = $"UPDATE USERS SET PASS = '******' WHERE ID = {Int32.Parse(_identity)}";
         EX_QUERY(query, $"Data Source={Data}");
         _Window.Close();
     }
     else
     {
         MessageBox.Show("Nieprawidłowe hasło");
     }
 }