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.
126 lines
5.2 KiB
126 lines
5.2 KiB
using System;
|
|
using System.Windows;
|
|
using System.Data;
|
|
using SSWMS.Common;
|
|
using System.Collections.Generic;
|
|
|
|
namespace SSWMS.Client
|
|
{
|
|
public partial class STORAGE_UPDATE : AvalonDock.DocumentContent
|
|
{
|
|
public STORAGE_UPDATE()
|
|
{
|
|
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_UPDATE";
|
|
this.ucStorage.dgData.U_TableName = "V_STORAGE_LIST";
|
|
this.ucStorage.dgData.U_OrderField = "GOODS_CLASS,STORAGE_ID,STORAGE_LIST_ID";
|
|
this.ucStorage.dgData.U_AllowOperatData = false;
|
|
this.ucStorage.dgData.U_AllowChecked = true;
|
|
this.ucStorage.U_InitControl();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageDialog.ShowException(ex);
|
|
}
|
|
}
|
|
|
|
private void bStorageUpdateERP_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
try
|
|
{
|
|
DataRowView[] drvArray = this.ucStorage.dgData.U_GetCheckDataRow();
|
|
if (drvArray.Length == 0)
|
|
{
|
|
MessageDialog.ShowException("请选择库存");
|
|
return;
|
|
}
|
|
if (MessageDialog.ShowDialog("确认执行库存更新"))
|
|
{
|
|
List<string> lGoodsBarcode = new List<string>();
|
|
foreach (DataRowView drv in drvArray)
|
|
{
|
|
string sGoodsBarcode = drv["GOODS_BARCODE"].ToString();
|
|
if (!lGoodsBarcode.Contains(sGoodsBarcode))
|
|
{
|
|
lGoodsBarcode.Add(sGoodsBarcode);
|
|
}
|
|
}
|
|
string sResult = string.Empty;
|
|
bool bResult = WCFChannel._I_StorageService.StorageUpdateERP(lGoodsBarcode, out sResult);
|
|
if (bResult)
|
|
{
|
|
this.ucStorage.U_InitControlData();
|
|
}
|
|
MessageDialog.ShowResult(bResult, sResult);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageDialog.ShowException(ex);
|
|
}
|
|
}
|
|
|
|
private void bStorageUpdate_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
try
|
|
{
|
|
DataRowView[] drvArray = this.ucStorage.dgData.U_GetCheckDataRow();
|
|
if (drvArray.Length == 0)
|
|
{
|
|
MessageDialog.ShowException("请选择库存");
|
|
return;
|
|
}
|
|
if (MessageDialog.ShowDialog("确认执行库存更新"))
|
|
{
|
|
List<STORAGE_LIST> lStorageList = new List<STORAGE_LIST>();
|
|
foreach (DataRowView drv in drvArray)
|
|
{
|
|
lStorageList.Add(new STORAGE_LIST()
|
|
{
|
|
STORAGE_LIST_ID = Convert.ToInt32(drv["STORAGE_LIST_ID"]),
|
|
BOX_BARCODE = drv["BOX_BARCODE"].ToString(),
|
|
GOODS_BARCODE = drv["GOODS_BARCODE"].ToString(),
|
|
STORAGE_PROPERTY_01 = drv["STORAGE_PROPERTY_01"].ToString(),
|
|
STORAGE_PROPERTY_02 = drv["STORAGE_PROPERTY_02"].ToString(),
|
|
STORAGE_PROPERTY_03 = drv["STORAGE_PROPERTY_03"].ToString(),
|
|
STORAGE_PROPERTY_04 = drv["STORAGE_PROPERTY_04"].ToString(),
|
|
STORAGE_PROPERTY_05 = drv["STORAGE_PROPERTY_05"].ToString(),
|
|
STORAGE_PROPERTY_06 = drv["STORAGE_PROPERTY_06"].ToString(),
|
|
STORAGE_PROPERTY_07 = drv["STORAGE_PROPERTY_07"].ToString(),
|
|
STORAGE_PROPERTY_08 = drv["STORAGE_PROPERTY_08"].ToString(),
|
|
STORAGE_PROPERTY_09 = drv["STORAGE_PROPERTY_09"].ToString(),
|
|
STORAGE_PROPERTY_10 = drv["STORAGE_PROPERTY_10"].ToString(),
|
|
STORAGE_PROPERTY_11 = drv["STORAGE_PROPERTY_11"].ToString(),
|
|
STORAGE_PROPERTY_12 = drv["STORAGE_PROPERTY_12"].ToString(),
|
|
STORAGE_LIST_QUANTITY = Convert.ToDecimal(drv["STORAGE_LIST_QUANTITY"])
|
|
});
|
|
}
|
|
string sResult = string.Empty;
|
|
bool bResult = WCFChannel._I_StorageService.StorageUpdate(lStorageList, MainApp._USER.USER_NAME, out sResult);
|
|
if (bResult)
|
|
{
|
|
this.ucStorage.U_InitControlData();
|
|
}
|
|
MessageDialog.ShowResult(bResult, sResult);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageDialog.ShowException(ex);
|
|
}
|
|
}
|
|
|
|
private void bRefresh_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
this.ucStorage.U_InitControl();
|
|
}
|
|
}
|
|
}
|