private void button_Copy1_Click(object sender, RoutedEventArgs e) { Win_AddUser wn = new Win_AddUser(); wn.ShowDialog(); ShowUserinfo(SearchStatement); }
private void button_Edit_Click(object sender, RoutedEventArgs e) { object item = dataGrid_User.SelectedItem; Win_AddUser wn = new Win_AddUser(); if (item == null) { MessageBox.Show("لطفا کاربر مورد نظر را انتخاب کنید"); return; } wn.Window_State = 2; wn.UserID = Convert.ToInt32((dataGrid_User.SelectedCells[0].Column.GetCellContent(item) as TextBlock).Text); wn.UserName = (dataGrid_User.SelectedCells[1].Column.GetCellContent(item) as TextBlock).Text; wn.UserFamily = (dataGrid_User.SelectedCells[2].Column.GetCellContent(item) as TextBlock).Text; wn.UserTell = (dataGrid_User.SelectedCells[3].Column.GetCellContent(item) as TextBlock).Text; wn.UserAge = Convert.ToByte((dataGrid_User.SelectedCells[4].Column.GetCellContent(item) as TextBlock).Text); wn.UserGender = (dataGrid_User.SelectedCells[5].Column.GetCellContent(item) as TextBlock).Text; wn.UserUserName = (dataGrid_User.SelectedCells[8].Column.GetCellContent(item) as TextBlock).Text; wn.ShowDialog(); ShowUserinfo(SearchStatement); }