Ejemplo n.º 1
0
 private void Menu_Edit(object sender, RoutedEventArgs e)
 {
     ///弹出用户编辑修改框,修改数据库用户记录
     ///
     try
     {
         DataRowView          mySelectedElement = (DataRowView)datagriduser.SelectedItem;
         string               user_id           = mySelectedElement.Row[0].ToString();
         string               username          = mySelectedElement.Row[1].ToString();
         string               password          = mySelectedElement.Row[2].ToString();
         WPFs.WPF_User_Manual wPF_User_Manual   = new WPFs.WPF_User_Manual(this, mySelectedElement, "edit");
         wPF_User_Manual.password.Password = password;
         wPF_User_Manual.username.Text     = username;
         wPF_User_Manual.Title             = "用户编辑";
         wPF_User_Manual.ShowDialog();
     }
     catch (NullReferenceException)
     {
         MessageBox.Show("未选中编辑行");
     }
     catch (InvalidCastException)
     {
         MessageBox.Show("导入的excel不能编辑");
     }
 }
Ejemplo n.º 2
0
 private void User_Add(object sender, RoutedEventArgs e)
 {
     ///弹出用户添加输入框,添加用户记录到数据库
     ///
     WPFs.WPF_User_Manual wPF_User_Add = new WPFs.WPF_User_Manual(this, view, "add");
     wPF_User_Add.ShowDialog();
 }