Exemplo n.º 1
0
 private void Menu_Edit(object sender, RoutedEventArgs e)
 {
     ///弹出料箱编辑输入框,数据同步到数据库
     ///
     ///
     try
     {
         DataRowView         mySelectedElement = (DataRowView)datagridbox.SelectedItem;
         string              box_id            = mySelectedElement.Row[0].ToString();
         string              box_color         = mySelectedElement.Row[1].ToString();
         string              box_capacity      = mySelectedElement.Row[2].ToString();
         string              box_status        = mySelectedElement.Row[3].ToString();
         string              box_desc          = mySelectedElement.Row[4].ToString();
         string              shelf_id          = mySelectedElement.Row[5].ToString();
         WPFs.WPF_Box_Manual wPF_Box_Manual    = new WPFs.WPF_Box_Manual(this, mySelectedElement, "edit");
         wPF_Box_Manual.box_id.Text       = box_id;
         wPF_Box_Manual.box_color.Text    = box_color;
         wPF_Box_Manual.box_capacity.Text = box_capacity;
         wPF_Box_Manual.box_status.Text   = box_status;
         wPF_Box_Manual.shelf_id.Text     = shelf_id;
         wPF_Box_Manual.box_desc.Text     = box_desc;
         wPF_Box_Manual.Title             = "料箱编辑";
         wPF_Box_Manual.ShowDialog();
     }
     catch (NullReferenceException)
     {
         MessageBox.Show("未选中编辑行");
     }
     catch (InvalidCastException)
     {
         MessageBox.Show("导入的excel不能进行编辑操作");
     }
 }
Exemplo n.º 2
0
 public void Box_Add(object sender, RoutedEventArgs e)
 {
     ///弹出料箱输入框,数据同步到数据库
     ///
     WPFs.WPF_Box_Manual wPF_Box_Manual = new WPFs.WPF_Box_Manual(this, view, "add");
     wPF_Box_Manual.ShowDialog();
 }