You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
99 lines
3.9 KiB
99 lines
3.9 KiB
using System;
|
|
using System.Windows;
|
|
using System.Data;
|
|
using SSWMS.Common;
|
|
using System.Collections.Generic;
|
|
using System.Windows.Forms;
|
|
|
|
namespace SSWMS.Client
|
|
{
|
|
public partial class MANAGE_OUT_STATION : AvalonDock.DocumentContent
|
|
{
|
|
public MANAGE_OUT_STATION()
|
|
{
|
|
InitializeComponent();
|
|
DocumentContent_Loaded(null, null);
|
|
}
|
|
|
|
private void DocumentContent_Loaded(object sender, RoutedEventArgs e)
|
|
{
|
|
try
|
|
{
|
|
this.ucStorage.dgData.U_WindowName = "COMMON";
|
|
this.ucStorage.dgData.U_XmlTableName = "V_STORAGE_LIST_OUT";
|
|
this.ucStorage.dgData.U_TableName = "V_STORAGE_LIST_STATION_OUT";
|
|
this.ucStorage.dgData.U_OrderField = "GOODS_CLASS,STORAGE_ID,STORAGE_LIST_ID";
|
|
//this.ucStorage.dgData.U_TotalColumnName = "STORAGE_LIST_QUANTITY";
|
|
this.ucStorage.dgData.U_AllowOperatData = false;
|
|
this.ucStorage.dgData.U_AllowChecked = true;
|
|
this.ucStorage.U_InitControl();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageDialog.ShowException(ex);
|
|
}
|
|
}
|
|
|
|
private void bOutStation_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
try
|
|
{
|
|
DataRowView[] drvChecked = this.ucStorage.dgData.U_GetCheckDataRow();
|
|
if (drvChecked == null || drvChecked.Length == 0)
|
|
{
|
|
MessageDialog.ShowException("请选择库存");
|
|
return;
|
|
}
|
|
List<STORAGE_LIST> lStorageList = new List<STORAGE_LIST>();
|
|
Dictionary<int, string> dStorageStockBarcode = new Dictionary<int, string>();
|
|
foreach (DataRowView drv in drvChecked)
|
|
{
|
|
if (drv.IsEdit)
|
|
{
|
|
MessageDialog.ShowException($"请输入出库数量 托盘条码 {drv["STOCK_BARCODE"]}");
|
|
return;
|
|
}
|
|
//decimal dQuantity = Convert.ToDecimal(drv["MANAGE_LIST_QUANTITY"]);
|
|
int dQuantity = Convert.ToInt32(drv["MANAGE_LIST_QUANTITY"]);
|
|
if (dQuantity <= 0)
|
|
{
|
|
MessageDialog.ShowException($"请输入出库数量 托盘条码 {drv["STOCK_BARCODE"]}");
|
|
return;
|
|
}
|
|
int iStorageID = Convert.ToInt32(drv["STORAGE_ID"]);
|
|
string sStockBarcode = drv["STOCK_BARCODE"].ToString();
|
|
lStorageList.Add(new STORAGE_LIST()
|
|
{
|
|
STORAGE_ID = iStorageID,
|
|
STORAGE_LIST_ID = Convert.ToInt32(drv["STORAGE_LIST_ID"]),
|
|
STORAGE_LIST_QUANTITY = dQuantity
|
|
});
|
|
if (!dStorageStockBarcode.ContainsKey(iStorageID))
|
|
{
|
|
dStorageStockBarcode.Add(iStorageID, sStockBarcode);
|
|
}
|
|
}
|
|
if (MessageDialog.ShowDialog("确认执行暂存出库"))
|
|
{
|
|
string sResult = string.Empty;
|
|
bool bResult = WCFChannel._I_ManageService.ManageOutStationMulti(
|
|
dStorageStockBarcode, lStorageList, 0, MainApp._USER.USER_NAME, out sResult);
|
|
if (bResult)
|
|
{
|
|
this.ucStorage.U_InitControlData(true);
|
|
}
|
|
MessageDialog.ShowResult(bResult, sResult);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageDialog.ShowException(ex);
|
|
}
|
|
}
|
|
|
|
private void bRefresh_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
this.ucStorage.U_InitControl();
|
|
}
|
|
}
|
|
}
|