|
|
|
@ -7,6 +7,7 @@ using CommunityToolkit.Mvvm.Messaging;
|
|
|
|
|
using log4net;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Numerics;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows;
|
|
|
|
|
|
|
|
|
@ -96,7 +97,7 @@ namespace Aucma.Core.BoxFoam.ViewModels
|
|
|
|
|
/// 保存数据
|
|
|
|
|
/// </summary>
|
|
|
|
|
[RelayCommand]
|
|
|
|
|
private void AddPlanInfo()
|
|
|
|
|
private async void AddPlanInfo()
|
|
|
|
|
{
|
|
|
|
|
var productPlanInfo = _planInfo;
|
|
|
|
|
if (_planInfo != null)
|
|
|
|
@ -106,33 +107,44 @@ namespace Aucma.Core.BoxFoam.ViewModels
|
|
|
|
|
{
|
|
|
|
|
task.MaterialCode = _planInfo.MaterialCode;
|
|
|
|
|
task.MaterialName = _planInfo.MaterialName;
|
|
|
|
|
task.OrderCode = _planInfo.OrderCode;
|
|
|
|
|
task.PlanAmount = Convert.ToInt32(TransmitAmount);
|
|
|
|
|
task.ProductLineCode = "CX_02";
|
|
|
|
|
task.StationCode = "1005";
|
|
|
|
|
task.UpdateTime = DateTime.Now;
|
|
|
|
|
task.ShiftType = 1;
|
|
|
|
|
var result = _boxFoamPlanServices.UpdateAsync(task).Result;
|
|
|
|
|
if (result)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("任务添加成功!", "系统提醒");
|
|
|
|
|
MessageBox.Show("任务修改成功!", "系统提醒");
|
|
|
|
|
WeakReferenceMessenger.Default.Send<string>("RefreshTask");//刷新任务界面
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("任务添加失败!", "系统提醒");
|
|
|
|
|
MessageBox.Show("任务修改失败!", "系统提醒");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//task.MaterialCode = _planInfo.MaterialCode;
|
|
|
|
|
//task.MaterialName = _planInfo.MaterialName;
|
|
|
|
|
//task.PlanAmount = Convert.ToInt32(TransmitAmount);
|
|
|
|
|
//var plan = _boxFoamPlanServices.AddAsync(task).Result;
|
|
|
|
|
//if (plan)
|
|
|
|
|
//{
|
|
|
|
|
// MessageBox.Show("任务添加成功!", "系统提醒");
|
|
|
|
|
// WeakReferenceMessenger.Default.Send<string>("RefreshTask");//刷新任务界面
|
|
|
|
|
//}
|
|
|
|
|
//else
|
|
|
|
|
//{
|
|
|
|
|
// MessageBox.Show("任务添加失败!", "系统提醒");
|
|
|
|
|
//}
|
|
|
|
|
task = new BoxFoamPlan();
|
|
|
|
|
task.MaterialCode = _planInfo.MaterialCode;
|
|
|
|
|
task.MaterialName = _planInfo.MaterialName;
|
|
|
|
|
task.OrderCode = _planInfo.OrderCode;
|
|
|
|
|
task.PlanAmount = Convert.ToInt32(TransmitAmount);
|
|
|
|
|
task.ProductLineCode = "CX_02";
|
|
|
|
|
task.StationCode = "1005";
|
|
|
|
|
task.CreateTime = DateTime.Now;
|
|
|
|
|
task.ShiftType = 1;
|
|
|
|
|
int plan = await _boxFoamPlanServices.AddAsync(task);
|
|
|
|
|
if (plan > 0 )
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("任务添加成功!", "系统提醒");
|
|
|
|
|
WeakReferenceMessenger.Default.Send<string>("RefreshTask");//刷新任务界面
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("任务添加失败!", "系统提醒");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
@ -140,7 +152,13 @@ namespace Aucma.Core.BoxFoam.ViewModels
|
|
|
|
|
BoxFoamPlan plan = new BoxFoamPlan();
|
|
|
|
|
plan.MaterialCode = _planInfo.MaterialCode;
|
|
|
|
|
plan.MaterialName = _planInfo.MaterialName;
|
|
|
|
|
plan.OrderCode = _planInfo.OrderCode;
|
|
|
|
|
plan.PlanAmount = Convert.ToInt32(TransmitAmount);
|
|
|
|
|
|
|
|
|
|
plan.ProductLineCode = "CX_02";
|
|
|
|
|
plan.StationCode = "1005";
|
|
|
|
|
plan.CreateTime = DateTime.Now;
|
|
|
|
|
plan.ShiftType = 1;
|
|
|
|
|
var result = _boxFoamPlanServices.AddAsync(plan).Result;
|
|
|
|
|
if (result > 0)
|
|
|
|
|
{
|
|
|
|
|