Ejemplo n.º 1
0
        private void AddOrder_Click(object sender, RoutedEventArgs e)
        {
            OrderInfoUpdate oiu = new OrderInfoUpdate(true);

            oiu.ShowDialog();
            LoadData();
        }
Ejemplo n.º 2
0
        //添加顾客信息
        private void AddCustomer_Click(object sender, RoutedEventArgs e)
        {
            Object item = LV_Customer.SelectedItem;

            if (item == null)
            {
                MessageBox.Show("选择要添加的顾客", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }

            DataRowView     selectedItem = item as DataRowView;
            OrderInfoUpdate oiu          = this.Owner as OrderInfoUpdate;

            oiu.tb_Cname.Text = selectedItem["Cname"].ToString();
            oiu.tb_Cname.Tag  = selectedItem["Cno"].ToString();

            this.Close();
        }
Ejemplo n.º 3
0
        private void EditOrder_Click(object sender, RoutedEventArgs e)
        {
            object item = LV_Order.SelectedItem;

            if (item == null)
            {
                MessageBox.Show("请选择一个订单", "错误", MessageBoxButton.OK,
                                MessageBoxImage.Error);
            }

            DataRowView     oneRow = item as DataRowView;
            OrderInfoUpdate oiu    = new OrderInfoUpdate(false,
                                                         new Orders(oneRow["Ono"].ToString(),
                                                                    oneRow["Cno"].ToString(),
                                                                    Convert.ToDateTime(oneRow["Odate"].ToString()),
                                                                    Convert.ToDouble(oneRow["Osum"].ToString()),
                                                                    Convert.ToDouble(oneRow["Omoney"].ToString())));

            oiu.ShowDialog();
            LoadData();
        }