大连融科 WMS
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.
 
 
 

163 lines
5.8 KiB

using System;
using System.Collections.Generic;
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 System.Data;
namespace SiaSun.LMS.WPFClient.TASK
{
public partial class ManageUp : AvalonDock.DocumentContent
{
Model.MANAGE_TYPE mMANAGE_TYPE = null;
#region 构造函数
public ManageUp(string MANAGE_TYPE_CODE)
{
InitializeComponent();
this.mMANAGE_TYPE = (Model.MANAGE_TYPE)MainApp._I_BaseService.GetModel("MANAGE_TYPE_SELECT_BY_MANAGE_TYPE_CODE", MANAGE_TYPE_CODE).RequestObject;
}
#endregion
#region 系统方法
private void DocumentContent_Loaded(object sender, RoutedEventArgs e)
{
this.InitManagePosotion();
this.ucManagePosition.U_StockBarcodeKeyDown += new UC.ucManagePosition.U_StockBarcodeKeyDownHandler(ucManagePosition_U_StockBarcodeKeyDown);
}
#endregion
#region 自定义方法
private void InitManagePosotion()
{
//设置输送任务控件参数
this.ucManagePosition.U_AllowAutoEndPostion = false;
this.ucManagePosition.U_AllowAutoStartPostion = true;
//初始化
this.ucManagePosition.U_InitControl(mMANAGE_TYPE.MANAGE_TYPE_ID);
}
void ucManagePosition_U_StockBarcodeKeyDown()
{
//显示库存
StorageListBind();
}
private void StorageListBind()
{
this.gridStorageList.U_WindowName = this.GetType().Name;
this.gridStorageList.U_TableName = "V_STORAGE_LIST";
this.gridStorageList.U_XmlTableName = "V_STORAGE_LIST";
this.gridStorageList.U_TotalColumnName = "STORAGE_LIST_QUANTITY";
this.gridStorageList.U_OrderField = "STORAGE_LIST_ID";
this.gridStorageList.U_Where = string.Format(" STOCK_BARCODE='{0}' AND AREA_TYPE= 'XuNiKu'", string.IsNullOrEmpty(this.ucManagePosition.U_STOCK_BARCODE) ? "*" : this.ucManagePosition.U_STOCK_BARCODE);
this.gridStorageList.U_AllowOperatData = false;
this.gridStorageList.U_AllowChecked = false;
this.gridStorageList.U_AllowShowPage = false;
//拆分列属性
this.gridStorageList.U_SplitPropertyType = "GOODS_TYPE";
this.gridStorageList.U_SplitGroupColumn = "GOODS_TYPE_ID";
this.gridStorageList.U_SplitGroupHeader = "GOODS_TYPE.GOODS_TYPE_NAME";
this.gridStorageList.U_SplitPropertyColumn = "GOODS_PROPERTY";
this.gridStorageList.U_InitControl();
}
#endregion
#region 按钮事件
private void WrapPanel_Click(object sender, RoutedEventArgs e)
{
Button btn = e.OriginalSource as Button;
if (btn != null)
{
switch (btn.Name)
{
case "btnConfirm":
this.CreateTask();
break;
case "btnRefresh":
this.Refresh();
break;
}
}
}
private void CreateTask()
{
bool bResult = false;
string sResult = string.Empty;
try
{
//校验填写仓库信息是否合法
if (!this.ucManagePosition.U_CHECK_WAREHOUSE())
return;
if (this.gridStorageList.U_DataSource == null || this.gridStorageList.U_DataSource.Rows.Count == 0)
{
MainApp._MessageDialog.Show(false,string.Format("[{0}]未配盘",this.ucManagePosition.U_STOCK_BARCODE));
return ;
}
//提示确认
if (MainApp._MessageDialog.ShowDialog(string.Format("确认创建[{0}]上架任务", this.ucManagePosition.U_STOCK_BARCODE)) == Sid.Windows.Controls.TaskDialogResult.Ok)
{
bResult = MainApp._I_BaseService.Invoke(mMANAGE_TYPE.MANAGE_TYPE_CLASS.TrimEnd(),
"ManageCreate",
new object[] {this.ucManagePosition.U_STOCK_BARCODE.ToUpper(),
this.ucManagePosition.U_START_POSITION_ID,
this.ucManagePosition.U_END_POSITION_ID,
this.ucManagePosition.U_CELL_MODEL,
this.cbControl.IsChecked,
true,
MainApp._USER.USER_NAME},
out sResult);
//检验执行结果
if (bResult)
{
this.Refresh();
}
MainApp._MessageDialog.Show(bResult, sResult);
}
}
catch (Exception ex)
{
MainApp._MessageDialog.ShowException(ex);
}
}
private void Refresh()
{
this.ucManagePosition.U_Refresh();
this.cbControl.IsChecked = true;
this.StorageListBind();
}
#endregion
}
}