You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
161 lines
6.2 KiB
C#
161 lines
6.2 KiB
C#
using CentralControl.DBDAO;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Data;
|
|
using System.Windows.Documents;
|
|
using System.Windows.Input;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media.Imaging;
|
|
using System.Windows.Shapes;
|
|
using XGL;
|
|
using XGL.Data;
|
|
using XGL.Models;
|
|
using XGL.UControl;
|
|
|
|
namespace CSWMS.UControl
|
|
{
|
|
/// <summary>
|
|
/// UserAdd.xaml 的交互逻辑
|
|
/// </summary>
|
|
public partial class product_orderzy : Window
|
|
{
|
|
public static string id = "";
|
|
public static string order_code = "";
|
|
public static string line_code = "";
|
|
public static string prod_code = "";
|
|
public static string materiel_box_no = "";
|
|
public product_orderzy()
|
|
{
|
|
WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
|
{
|
|
//查询
|
|
try
|
|
{
|
|
List<common_base_unitModel> model = new List<common_base_unitModel>();
|
|
DBService userDb = new DBService();
|
|
var Items = userDb.GetOrderZYList();
|
|
if (Items != null && Items.Rows.Count > 0)
|
|
{
|
|
foreach (DataRow row in Items.Rows)
|
|
{
|
|
common_base_unitModel list_model = new common_base_unitModel();
|
|
list_model.id = row["id"].ToString();
|
|
list_model.order_code = row["order_code"].ToString();
|
|
list_model.line_code = row["line_code"].ToString();
|
|
list_model.prod_code = row["prod_code"].ToString();
|
|
list_model.materiel_box_no = row["materiel_box_no"].ToString();
|
|
list_model.est = row["est"].ToString();
|
|
list_model.Quantity = row["Quantity"].ToString();
|
|
list_model.UpQuantity = row["UpQuantity"].ToString();
|
|
list_model.outwarehousequantity = row["outwarehousequantity"].ToString();
|
|
list_model.kzquantity = row["kzquantity"].ToString();
|
|
model.Add(list_model);
|
|
}
|
|
gridBill.ItemsSource = model;
|
|
}
|
|
else
|
|
{
|
|
MessageBox.Show("未查到订单信息!", "提示", MessageBoxButton.OK);
|
|
return;
|
|
}
|
|
}
|
|
catch(Exception ex)
|
|
{
|
|
MessageBox.Show("获取订单错误");
|
|
}
|
|
}
|
|
|
|
private void gridBill_MouseDoubleClick(object sender, MouseButtonEventArgs e)
|
|
{
|
|
try
|
|
{
|
|
if (gridBill.SelectedIndex != -1)
|
|
{
|
|
var unit = this.gridBill.SelectedItem as common_base_unitModel;
|
|
if (unit != null)
|
|
{
|
|
id = unit.id;
|
|
order_code = unit.order_code;
|
|
line_code = unit.line_code;
|
|
prod_code = unit.prod_code;
|
|
materiel_box_no = unit.materiel_box_no;
|
|
this.DialogResult = true;
|
|
this.Close();
|
|
}
|
|
else
|
|
{
|
|
this.Close();
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
this.Close();
|
|
}
|
|
}
|
|
|
|
private void BtnAction_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
try
|
|
{
|
|
common_base_unitModel mySelectedElement = (common_base_unitModel)gridBill.SelectedItem;
|
|
string order_code = mySelectedElement.order_code;
|
|
orderzy order = new orderzy();
|
|
orderzy.order_code = order_code;
|
|
if (order.ShowDialog() == true)
|
|
{
|
|
//查询
|
|
try
|
|
{
|
|
List<common_base_unitModel> model = new List<common_base_unitModel>();
|
|
DBService userDb = new DBService();
|
|
var Items = userDb.GetOrderZYList();
|
|
if (Items != null && Items.Rows.Count > 0)
|
|
{
|
|
foreach (DataRow row in Items.Rows)
|
|
{
|
|
common_base_unitModel list_model = new common_base_unitModel();
|
|
list_model.id = row["id"].ToString();
|
|
list_model.order_code = row["order_code"].ToString();
|
|
list_model.line_code = row["line_code"].ToString();
|
|
list_model.prod_code = row["prod_code"].ToString();
|
|
list_model.materiel_box_no = row["materiel_box_no"].ToString();
|
|
list_model.est = row["est"].ToString();
|
|
list_model.Quantity = row["Quantity"].ToString();
|
|
list_model.UpQuantity = row["UpQuantity"].ToString();
|
|
list_model.outwarehousequantity = row["outwarehousequantity"].ToString();
|
|
list_model.kzquantity = row["kzquantity"].ToString();
|
|
model.Add(list_model);
|
|
}
|
|
gridBill.ItemsSource = model;
|
|
}
|
|
else
|
|
{
|
|
MessageBox.Show("未查到订单信息!", "提示", MessageBoxButton.OK);
|
|
return;
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageBox.Show("获取订单错误");
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
this.Focus();
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|