Example #1
0
        private void btn_add_Click(object sender, RoutedEventArgs e)
        {
            Window_ItemInfo win_iteminfo = new Window_ItemInfo(manager);

            win_iteminfo.OnItemChanged += new EventHandler(win_iteminfo_OnItemChanged);
            win_iteminfo.Show();
        }
Example #2
0
        private void DataGridHyperlinkColumn_Click(object sender, RoutedEventArgs e)
        {
            DataGrid  g     = sender as DataGrid;
            object    value = g.SelectedValue;
            Hyperlink h     = e.OriginalSource as Hyperlink;

            if (h == null || value == null)
            {
                return;
            }
            string oper   = h.NavigateUri.OriginalString;
            string itemId = value.ToString();

            if (oper == "修改")
            {
                Window_ItemInfo win_iteminfo = new Window_ItemInfo(manager, itemId);
                win_iteminfo.OnItemChanged += new EventHandler(win_iteminfo_OnItemChanged);
                win_iteminfo.Show();
            }
            else if (oper == "删除")
            {
                MessageBoxResult r = MessageBox.Show("确认删除该物品?", this.Title, MessageBoxButton.YesNoCancel, MessageBoxImage.Question);
                if (r == MessageBoxResult.Yes)
                {
                    IMG_loading.Visibility = System.Windows.Visibility.Visible;
                    string[] arr_itemId = new string[] { itemId };
                    Thread   t          = new Thread(new ParameterizedThreadStart(doDelItems));
                    t.IsBackground = true;
                    t.Start(arr_itemId);
                }
            }
        }
Example #3
0
        private void btn_edit_Click(object sender, RoutedEventArgs e)
        {
            object obj = dataGrid1.SelectedValue;

            if (obj != null)
            {
                Window_ItemInfo win_iteminfo = new Window_ItemInfo(manager, obj.ToString());
                win_iteminfo.OnItemChanged += new EventHandler(win_iteminfo_OnItemChanged);
                win_iteminfo.Show();
            }
        }