private void New_user_button_Click(object sender, EventArgs e) { // this.Hide(); Add_Mod_user_window nw = new Add_Mod_user_window(0); nw.ShowDialog(); Users_DataGridviev.DataSource = (from p in AdminSection.Find_user(Uname_text_box.Text, Lname_text_box.Text, Fname_text_box.Text) select new { Last_Name = p.lname, First_Name = p.fname, User_Name = p.uname, Rola = p.role, Data_wygaśnięcia = p.dt_exp }); }
private void Mod_User_Button_Click(object sender, EventArgs e) { try { int numer = Convert.ToInt32(Users_DataGridviev.CurrentRow.Index); string zmienna = Users_DataGridviev.Rows[numer].Cells[2].Value.ToString(); Add_Mod_user_window nw = new Add_Mod_user_window(1, zmienna); nw.ShowDialog(); } catch { MessageBox.Show("Proszę wybrać użytkownika"); } Users_DataGridviev.DataSource = (from p in AdminSection.Find_user(Uname_text_box.Text, Lname_text_box.Text, Fname_text_box.Text) select new { Last_Name = p.lname, First_Name = p.fname, User_Name = p.uname, Rola = p.role, Data_wygaśnięcia = p.dt_exp }); }