宜昌华友成品库管理软件
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.

207 lines
7.3 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;
namespace SiaSun.LMS.WPFClient.MANAGE
{
/// <summary>
/// MANAGE_MOVE.xaml 的交互逻辑
/// </summary>
public partial class MANAGE_UP : AvalonDock.DocumentContent
{
Model.MANAGE_TYPE mMANAGE_TYPE = null;
/// <summary>
/// 构造函数
/// </summary>
public MANAGE_UP(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;
}
/// <summary>
/// 窗体加载
/// </summary>
private void DocumentContent_Loaded(object sender, RoutedEventArgs e)
{
this.InitManagePosotion();
this.ucManagePosition.U_StockBarcodeKeyDown += new UC.ucManagePosition.U_StockBarcodeKeyDownHandler(ucManagePosition_U_StockBarcodeKeyDown);
}
void ucManagePosition_U_StockBarcodeKeyDown()
{
//校验托盘条码是否合法
if (!SiaSun.LMS.Common.RegexValid.GetCodeCheck(this.ucManagePosition.U_STOCK_BARCODE, "StockCodeCheck"))
{
MainApp._MessageDialog.Show(Enum.MessageConverter.CheckStockBarCode, this.ucManagePosition.U_STOCK_BARCODE);
return;
}
//显示库存
StorageListBind();
}
/// <summary>
/// 初始化输送位置控件
/// </summary>
private void InitManagePosotion()
{
//设置输送任务控件参数
this.ucManagePosition.U_AllowAutoEndPostion = true;
this.ucManagePosition.U_AllowAutoStartPostion = false;
//初始化
this.ucManagePosition.U_InitControl(mMANAGE_TYPE.MANAGE_TYPE_ID);
}
/// <summary>
/// 库存明细绑定
/// </summary>
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'", 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();
}
/// <summary>
/// 点击按钮确认
/// </summary>
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;
}
}
}
/// <summary>
/// 创建输送任务
/// </summary>
private void CreateTask()
{
bool bResult = false;
string strResult = string.Empty;
try
{
//校验托盘条码是否合法
if (!SiaSun.LMS.Common.RegexValid.GetCodeCheck(this.ucManagePosition.U_STOCK_BARCODE, "StockCodeCheck"))
{
MainApp._MessageDialog.Show(Enum.MessageConverter.CheckStockBarCode);
return;
}
//校验填写仓库信息是否合法
if (!this.ucManagePosition.U_CHECK_WAREHOUSE())
return;
if (this.gridStorageList.U_DataSource == null || this.gridStorageList.U_DataSource.Rows.Count == 0)
{
MainApp._MessageDialog.Show(string.Format("{0}未找到库存",this.ucManagePosition.U_STOCK_BARCODE));
return ;
}
//提示确认
if (MainApp._MessageDialog.ShowDialog(Enum.MessageConverter.ConfirmAssembly, this.ucManagePosition.U_STOCK_BARCODE) == Sid.Windows.Controls.TaskDialogResult.Ok)
{
SiaSun.LMS.Model.MANAGE_MAIN mMANAGE_MAIN = new Model.MANAGE_MAIN();
mMANAGE_MAIN.MANAGE_TYPE_CODE = mMANAGE_TYPE.MANAGE_TYPE_CODE.TrimEnd();
mMANAGE_MAIN.STOCK_BARCODE = this.ucManagePosition.U_STOCK_BARCODE;
mMANAGE_MAIN.CELL_MODEL = this.ucManagePosition.U_CELL_MODEL;
mMANAGE_MAIN.START_CELL_ID = this.ucManagePosition.U_START_POSITION_ID;
mMANAGE_MAIN.END_CELL_ID = this.ucManagePosition.U_END_POSITION_ID;
mMANAGE_MAIN.MANAGE_OPERATOR = MainApp._USER.USER_NAME;
mMANAGE_MAIN.MANAGE_BEGIN_TIME = SiaSun.LMS.Common.StringUtil.GetDateTime();
mMANAGE_MAIN.MANAGE_STATUS = SiaSun.LMS.Enum.MANAGE_STATUS.WaitingSend.ToString();
mMANAGE_MAIN.MANAGE_LEVEL = string.Empty;
mMANAGE_MAIN.MANAGE_REMARK = string.Empty;
bResult = MainApp._I_BaseService.Invoke(mMANAGE_TYPE.MANAGE_TYPE_CLASS.TrimEnd(),
"ManageCreate",
new object[] {mMANAGE_MAIN,
true,
this.ucManagePosition.U_AutoDownloadControlTask,
this.ucManagePosition.U_AutoCompleteTask },
out strResult);
//检验执行结果
if (bResult)
{
this.gridStorageList.U_Update();
}
MainApp._MessageDialog.ShowResult(bResult, strResult);
}
}
catch (Exception ex)
{
MainApp._MessageDialog.ShowException(ex);
}
}
/// <summary>
/// 刷新
/// </summary>
private void Refresh()
{
this.gridStorageList.U_DataSource = null;
this.ucManagePosition.U_Update();
}
}
}