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.
168 lines
6.1 KiB
C#
168 lines
6.1 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;
|
|
|
|
namespace CSWMS.UControl
|
|
{
|
|
/// <summary>
|
|
/// UserAdd.xaml 的交互逻辑
|
|
/// </summary>
|
|
public partial class product_order : 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_order()
|
|
{
|
|
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.GetUnitList_new();
|
|
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_desc"].ToString();
|
|
list_model.materiel_box_no = row["materiel_box_no"].ToString();
|
|
list_model.est = Convert.ToDateTime(row["est"].ToString()).ToString("yyyy-MM-dd");
|
|
list_model.Quantity = row["Quantity"].ToString();
|
|
list_model.UpQuantity = row["UpQuantity"].ToString();
|
|
list_model.production_sequence = row["production_sequence"].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 Button_ChaXun(object sender, RoutedEventArgs e)
|
|
{
|
|
//查询
|
|
try
|
|
{
|
|
string lineCode = "";
|
|
if (this.line_name.Text.Trim() == "A线")
|
|
{
|
|
lineCode = "D3";
|
|
}
|
|
else if (this.line_name.Text.Trim() == "B线")
|
|
{
|
|
lineCode = "TV";
|
|
}
|
|
else if (this.line_name.Text.Trim() == "C线")
|
|
{
|
|
lineCode = "TQ";
|
|
}
|
|
else if(this.line_name.Text.Trim() == "F线")
|
|
{
|
|
lineCode = "W8";
|
|
}
|
|
List<common_base_unitModel> model = new List<common_base_unitModel>();
|
|
DBService userDb = new DBService();
|
|
var Items = userDb.GetUnitList_line(lineCode);
|
|
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_desc"].ToString();
|
|
list_model.materiel_box_no = row["materiel_box_no"].ToString();
|
|
list_model.est = Convert.ToDateTime(row["est"].ToString()).ToString("yyyy-MM-dd");
|
|
list_model.Quantity = row["Quantity"].ToString();
|
|
list_model.UpQuantity = row["UpQuantity"].ToString();
|
|
list_model.production_sequence = row["production_sequence"].ToString();
|
|
model.Add(list_model);
|
|
}
|
|
gridBill.ItemsSource = model;
|
|
}
|
|
else
|
|
{
|
|
MessageBox.Show("未查到订单信息!", "提示", MessageBoxButton.OK);
|
|
return;
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageBox.Show("获取订单错误");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 显示序号事件
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void dgData_LoadingRow(object sender, DataGridRowEventArgs e)
|
|
{ e.Row.Header = e.Row.GetIndex() + 1; }
|
|
}
|
|
|
|
}
|