Exemplo n.º 1
0
        public Profedit_win(Main_win super, Profile_win profile)
        {
            this.super = super;
            prof_win   = profile;
            InitializeComponent();
            string        sql  = "select login, pass, mail, fname, sname, pname from my_own_trainer(" + super.user_id + ")";
            NpgsqlCommand comm = new NpgsqlCommand(sql, super.conn);

            try
            {
                super.conn.Open();
                NpgsqlDataReader reader = comm.ExecuteReader();
                reader.Read();
                old_login          = tb_login.Text = reader.GetString(0);
                tb_pass.Password   = reader.GetString(1);
                tb_repass.Password = reader.GetString(1);
                tb_mail.Text       = reader.GetValue(2).ToString();
                tb_fname.Text      = reader.GetString(3);
                tb_sname.Text      = reader.GetString(4);
                tb_pname.Text      = reader.GetString(5);
            }
            catch (NpgsqlException ex)
            {
                MessageBox.Show(ex.Message, "Ошибка на сервере", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK);
            }
            finally { super.conn.Close(); }
        }
Exemplo n.º 2
0
 public Passreq(Main_win super, Profile_win prof)
 {
     this.super = super;
     this.prof  = prof;
     InitializeComponent();
 }
Exemplo n.º 3
0
        private void B_profile_Click(object sender, RoutedEventArgs e)
        {
            Profile_win win = new Profile_win(this);

            win.Show();
        }