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.
|
|
using System; using System.Collections; using System.Collections.Generic; using ICSSoft.Frame.Data.Entity; using System.Linq; using System.Data.Linq; using System.Xml.Linq; using ICSSoft.Base.Config.AppConfig; using ICSSoft.Frame.DataCollect; using ICSSoft.Frame.Helper; using System.Windows.Forms;
namespace ICSSoft.Frame.DataConnect.Action { /// <summary>
/// ���������ɼ�
/// </summary>
public class ActionTS : IActionWithStatus { private FramDataContext _domainDataProvider = null;
// public ActionTS()
// {
// //
// // TODO: �ڴ˴����ӹ��캯����
// //
// }
public ActionTS(FramDataContext domainDataProvider) { this._domainDataProvider = domainDataProvider; }
public FramDataContext DataProvider { get { return _domainDataProvider; } }
/// <summary>
/// ����Ʒ�ɼ�
/// </summary>
/// <param name="domainDataProvider"></param>
/// <param name="iD"></param>
/// <param name="actionType"></param>
/// <param name="resourceCode"></param>
/// <param name="userCode"></param>
/// <param name="product"></param>
/// <param name="datas1"></param>
/// <param name="datas2"></param>
/// <returns></returns>
public Messages Execute(ActionEventArgs actionEventArgs) { Messages messages = new Messages(); Messages msgAutoGoMO = new Messages(); try {
// �Զ���Undo
messages.AddMessages((new ActionUndoNG(this.DataProvider)).UndoNG(actionEventArgs)); // Added end
ActionOnLineHelper dataCollect = new ActionOnLineHelper(this.DataProvider); //��дSIMULATION ���鹤����ID��;�̡�����
messages.AddMessages(dataCollect.CheckID(actionEventArgs)); if (messages.IsSuccess()) { //����SIMULATION ������Ϣ
actionEventArgs.ProductInfo.NowSimulation.PRODUCTSTATUS = ProductStatus.NG; actionEventArgs.ProductInfo.NowSimulation.NGTIMES = actionEventArgs.ProductInfo.NowSimulation.NGTIMES + 1;
messages.AddMessages(dataCollect.Execute(actionEventArgs)); if (messages.IsSuccess()) {
//��ȡErrorGroup2ErrorCode
if (actionEventArgs.ActionType == ActionType.DataCollectAction_NG) { actionEventArgs.ProductInfo.ECG2ErrCodes = ParseECG2Errs(((TSActionEventArgs)actionEventArgs).ErrorCodes, actionEventArgs.ActionType); } else { actionEventArgs.ProductInfo.ECG2ErrCodes = ParseECG2Errs(((TSActionEventArgs)actionEventArgs).ErrorInfor, actionEventArgs.ActionType); }
ReportHelper reportCollect = new ReportHelper(this.DataProvider); messages.AddMessages(reportCollect.ReportLineQuanMaster(this.DataProvider, actionEventArgs.ActionType, actionEventArgs.ProductInfo));
} } } catch (Exception e) { messages.Add(new Message(e)); } //return messages;
if (msgAutoGoMO.Count() < 1 || (msgAutoGoMO.IsSuccess() == true && messages.IsSuccess() == false)) return messages; else { msgAutoGoMO.IgnoreError(); msgAutoGoMO.AddMessages(messages); return msgAutoGoMO; } } //��ȡ���������顢��������
public static string ParseECG2Errs(object[] errorInfo, string actType) { string strReturn = String.Empty; if (errorInfo == null) { return strReturn; } for (int i = 0; i < errorInfo.Length; i++) { if (actType == ActionType.DataCollectAction_NG || actType == ActionType.DataCollectAction_OutLineNG) { ICSECG2EC tsLoc = ((ICSECG2EC)errorInfo[i]); strReturn += tsLoc.ECGCODE + ":" + tsLoc.ECODE + ";"; } }
return strReturn; } /// <summary>
/// ����Ʒ�ɼ�
/// </summary>
/// <param name="domainDataProvider"></param>
/// <param name="iD"></param>
/// <param name="actionType"></param>
/// <param name="resourceCode"></param>
/// <param name="userCode"></param>
/// <param name="product"></param>
/// <param name="datas1"></param>
/// <param name="datas2"></param>
/// <returns></returns>
public Messages Execute(ActionEventArgs actionEventArgs, ActionCheckStatus actionCheckStatus) { Messages messages = new Messages(); Messages msgAutoGoMO = new Messages(); try { ActionOnLineHelper dataCollect = new ActionOnLineHelper(this.DataProvider);
//��дSIMULATION ���鹤����ID��;�̡�����
messages.AddMessages(dataCollect.CheckID(actionEventArgs, actionCheckStatus)); if (messages.IsSuccess()) { //����SIMULATION ������Ϣ
actionEventArgs.ProductInfo.NowSimulation.PRODUCTSTATUS = ProductStatus.NG; actionEventArgs.ProductInfo.NowSimulation.NGTIMES = actionEventArgs.ProductInfo.NowSimulation.NGTIMES + 1;
if (actionCheckStatus.NeedUpdateSimulation) { //�������β��ŵ�ICSONWIP.DUTYDEPARTMENT��λ
if (actionCheckStatus.DutyDepartment.ToString() != string.Empty) { actionEventArgs.DutyDepartment = actionCheckStatus.DutyDepartment; }
if (actionCheckStatus.TroubleStage.ToString() != string.Empty) { actionEventArgs.TroubleStage = actionCheckStatus.TroubleStage; } //End
messages.AddMessages(dataCollect.Execute(actionEventArgs)); } else { messages.AddMessages(dataCollect.Execute(actionEventArgs, actionCheckStatus)); }
if (messages.IsSuccess()) { //Laws Lu,2005/12/19,���� ��ȡErrorGroup2ErrorCode
if (actionEventArgs.ActionType == ActionType.DataCollectAction_NG) { actionEventArgs.ProductInfo.ECG2ErrCodes = ParseECG2Errs(((TSActionEventArgs)actionEventArgs).ErrorCodes, actionEventArgs.ActionType); } else { actionEventArgs.ProductInfo.ECG2ErrCodes = ParseECG2Errs(((TSActionEventArgs)actionEventArgs).ErrorInfor, actionEventArgs.ActionType); }
//����ErrorCode,ErrorGroup�Ƿ���ȷ TODO
//����CS��ȷ��ErrorCode,ErrorGroup����ȷ�ģ��˴�������ȥ��
messages.AddMessages(dataCollect.CollectErrorInformation(actionEventArgs.ActionType, actionEventArgs.ProductInfo, ((TSActionEventArgs)actionEventArgs).ErrorCodes, ((TSActionEventArgs)actionEventArgs).Memo));
ReportHelper reportCollect = new ReportHelper(this.DataProvider); messages.AddMessages(reportCollect.ReportLineQuanMaster(this.DataProvider, actionEventArgs.ActionType, actionEventArgs.ProductInfo));
} else { return messages; } } } catch (Exception e) { messages.Add(new Message(e)); } if (msgAutoGoMO.Count() < 1 || (msgAutoGoMO.IsSuccess() == true && messages.IsSuccess() == false)) return messages; else { msgAutoGoMO.IgnoreError(); msgAutoGoMO.AddMessages(messages); return msgAutoGoMO; } } } }
|