Ejemplo n.º 1
0
        //添加供应商信息
        private void AddSupplier(object sender, RoutedEventArgs e)
        {
            SupplierInfoManage sim = new SupplierInfoManage();

            sim.ShowDialog();
            LoadData();
        }
Ejemplo n.º 2
0
        //更新供应商信息
        private void UpdateSupplier(object sender, RoutedEventArgs e)
        {
            Object item = SupplierListView.SelectedItem;

            if (item == null)
            {
                MessageBox.Show("选择要更改的供应商", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }

            DataRowView selectedItem = item as DataRowView;
            Supplier    supplierInfo = new Supplier();

            //有待改进
            supplierInfo.Sno    = selectedItem["Sno"].ToString();
            supplierInfo.Sname  = selectedItem["Sname"].ToString();
            supplierInfo.Sphone = selectedItem["Sphone"].ToString();
            supplierInfo.Saddr  = selectedItem["Saddr"].ToString();
            SupplierInfoManage sim = new SupplierInfoManage(supplierInfo);

            sim.ShowDialog();
            LoadData();
        }