添加项目文件。
This commit is contained in:
45
WPFWCSDemo/Services/ManualOperation/DeleteTask.cs
Normal file
45
WPFWCSDemo/Services/ManualOperation/DeleteTask.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WPFWCSDemo.Models;
|
||||
using WPFWCSDemo.Models.Tables;
|
||||
using WPFWCSDemo.StateCode;
|
||||
using WPFWCSDemo.Utilities;
|
||||
|
||||
namespace WPFWCSDemo.Services.ManualOperation
|
||||
{
|
||||
public class DeleteTask :IDeleteTask
|
||||
{
|
||||
/// <summary>
|
||||
/// 移除指定任务记录
|
||||
/// </summary>
|
||||
/// <param name="taskHistory">任务历史记录</param>
|
||||
public void Delete(TaskHistory taskHistory)
|
||||
{
|
||||
SqlHelper.ExecuteNonQuery("UPDATE TASK_HISTORY SET TASKSTATE=@TaskState,FINISHTIME=@FinishTime WHERE TASKID=@TaskId",
|
||||
new SqlParameter("@TaskId", taskHistory.TaskId),
|
||||
new SqlParameter("@FinishTime", taskHistory.FinishTime),
|
||||
new SqlParameter("@TaskState", TaskStateCode.Task_Finish_Cancel));
|
||||
|
||||
|
||||
|
||||
//SqlHelper.ExecuteNonQuery("INSERT INTO TASK_HISTORY " +
|
||||
// "SELECT * FROM TASK WHERE (TaskId=@TaskId)",
|
||||
// new SqlParameter("@TaskId", taskHistory.TaskId),
|
||||
// new SqlParameter("@TaskState", taskHistory.TaskStateCode));
|
||||
|
||||
////2--------------在历史表中响应任务数据中修改其【taskstate】值
|
||||
//SqlHelper.ExecuteNonQuery("UPDATE TASK_HISTORY SET TASKSTATE=@TaskState,FINISHTIME=@FinishTime WHERE TASKID=@TaskId",
|
||||
// new SqlParameter("@TaskId", taskHistory.TaskId),
|
||||
// new SqlParameter("@FinishTime", taskHistory.FinishTime),
|
||||
// new SqlParameter("@TaskState", taskHistory.TaskStateCode));
|
||||
|
||||
////3--------------移除【调度管理】表数据
|
||||
//SqlHelper.ExecuteNonQuery("DELETE FROM TASK WHERE TaskId=@TaskId",
|
||||
// new SqlParameter("@TaskId", taskHistory.TaskId));
|
||||
}
|
||||
}
|
||||
}
|
||||
15
WPFWCSDemo/Services/ManualOperation/IDeleteTask.cs
Normal file
15
WPFWCSDemo/Services/ManualOperation/IDeleteTask.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WPFWCSDemo.Models;
|
||||
using WPFWCSDemo.Models.Tables;
|
||||
|
||||
namespace WPFWCSDemo.Services.ManualOperation
|
||||
{
|
||||
public interface IDeleteTask
|
||||
{
|
||||
void Delete(TaskHistory taskHistory);
|
||||
}
|
||||
}
|
||||
15
WPFWCSDemo/Services/ManualOperation/IInsertTask.cs
Normal file
15
WPFWCSDemo/Services/ManualOperation/IInsertTask.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WPFWCSDemo.Models;
|
||||
using WPFWCSDemo.Models.Tables;
|
||||
|
||||
namespace WPFWCSDemo.Services.ManualOperation
|
||||
{
|
||||
public interface IInsertTask
|
||||
{
|
||||
void Insert(TaskRT taskRT);
|
||||
}
|
||||
}
|
||||
13
WPFWCSDemo/Services/ManualOperation/IUpdateTask.cs
Normal file
13
WPFWCSDemo/Services/ManualOperation/IUpdateTask.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WPFWCSDemo.Services.ManualOperation
|
||||
{
|
||||
public interface IUpdateTask
|
||||
{
|
||||
void Update();
|
||||
}
|
||||
}
|
||||
32
WPFWCSDemo/Services/ManualOperation/InsertTask.cs
Normal file
32
WPFWCSDemo/Services/ManualOperation/InsertTask.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WPFWCSDemo.Models;
|
||||
using WPFWCSDemo.Models.Tables;
|
||||
using WPFWCSDemo.StateCode;
|
||||
using WPFWCSDemo.Utilities;
|
||||
|
||||
namespace WPFWCSDemo.Services.ManualOperation
|
||||
{
|
||||
public class InsertTask : IInsertTask
|
||||
{
|
||||
/// <summary>
|
||||
/// 新插入一条记录
|
||||
/// </summary>
|
||||
/// <param name="taskRT">任务参数模型</param>
|
||||
public void Insert(TaskRT taskRT)
|
||||
{
|
||||
SqlHelper.ExecuteNonQuery(
|
||||
"INSERT INTO TASK TASKID,PalletId,TASKTYPE,SourceLocation,TARGETLOCATION,CREATETIME " +
|
||||
"VALUES(@TaskId,@PalletId,@TaskType,@SourceLocation,@TargetLocation,@CreateTime)",
|
||||
new System.Data.SqlClient.SqlParameter("@TaskId", taskRT.TaskId),
|
||||
new System.Data.SqlClient.SqlParameter("@PalletId", taskRT.PalletId),
|
||||
new System.Data.SqlClient.SqlParameter("@TaskType", taskRT.TaskType),
|
||||
new System.Data.SqlClient.SqlParameter("@SourceLocation", taskRT.SourceLocation),
|
||||
new System.Data.SqlClient.SqlParameter("@TargetLocation", taskRT.TargetLocation),
|
||||
new System.Data.SqlClient.SqlParameter("@CreateTime", DateTime.Now.ToString(TimeFormat.stringFormatfff)));
|
||||
}
|
||||
}
|
||||
}
|
||||
16
WPFWCSDemo/Services/ManualOperation/UpdateTask.cs
Normal file
16
WPFWCSDemo/Services/ManualOperation/UpdateTask.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WPFWCSDemo.Services.ManualOperation
|
||||
{
|
||||
public class UpdateTask : IUpdateTask
|
||||
{
|
||||
public void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user