Beispiel #1
0
        public bool ProcessTransactionFail(ISnApi objSn, IParamApi objParam, IFailureApi objFailure)
        {
            var r = false;

            _transId = ProcessTransaction(objSn, objSn.SnDetail.id, false);
            if (_transId > 0)
            {
                var nextcode = objSn.ValidateNextCode();
                if (nextcode != objSn.RouteDetail.next_pass)
                {
                    OnTransactionProceed(objSn.ReturnMsg);
                }
                var performId = ProcessEngageUpdate(objSn, nextcode);
                if (performId > 0)
                {
                    r = true;
                    if (objParam != null)
                    {
                        var pId = ProcessParam(objSn, objParam, performId);
                        if (pId < 0)
                        {
                            r = false;
                        }
                    }
                }
            }
            if (!r)
            {
                RollBackTransaction(objSn, null, objParam, objFailure);
            }
            return(r);
        }
Beispiel #2
0
        public bool ProcessTransaction(ISnApi objSn, ISoApi objSo, IParamApi objParam)
        {
            var r        = false;
            var nextcode = objSn.ValidateNextCode();

            if (nextcode != objSn.RouteDetail.next_pass)
            {
                OnTransactionProceed(objSn.ReturnMsg);
            }
            _engageId = ProcessEngage(objSn, objSo, nextcode);
            if (_engageId > 0)
            {
                _transId = ProcessTransaction(objSn, _engageId, true);
                if (_transId > 0)
                {
                    r = true;
                    if (objParam != null)
                    {
                        _paramId = ProcessParam(objSn, objParam, _engageId);
                        if (_paramId < 0)
                        {
                            r = false;
                        }
                    }
                }
            }
            if (!r)
            {
                RollBackTransaction(objSn, objSo, objParam, null);
            }
            return(r);
        }
Beispiel #3
0
        // Event FinishEvent(sender As Object, e As EventArgs)
        public UcSn(ISnApi objSnApi, IControlBuilder objObjControlBuild) : base(objSnApi.GetFlexObj, objSnApi.GetWsObj, objSnApi.GetMsgObj, objSnApi.FormObject, objSnApi.Operation, objObjControlBuild)
        {
            ObjSnApi = objSnApi;
            InitializeComponent();
            // TxtSn.Text = "sn001" 'TODO : remove this when debug finish
            HookCustomEvent(this, ObjSnApi);

            ChkAutoSubmit.Enabled = ObjSnApi.AllowAutoSubmit();
        }
Beispiel #4
0
        private int ProcessTransaction(ISnApi objSn, int transId, bool transResult)
        {
            var result = objSn.PerformTransaction(new SnPerformVm()
            {
                sn = transId, operation = Operation, start_time = null, stop_time = null, result = transResult, resource_name = "", remark = ""
            }, objSn.UnitSn);

            OnTransactionProceed(ReturnMsg);
            return(result);
        }
Beispiel #5
0
        private int ProcessEngage(ISnApi objSn, ISoApi objSo, string nextcode)
        {
            var result = objSn.EngageTransaction(new SnEngageVm()
            {
                number = objSn.UnitSn, workorder = objSo.ShopOrderName, current_operation = nextcode, category1 = "", category2 = "", routing = null, description = ""
            });

            OnTransactionProceed(ReturnMsg);
            return(result);
        }
Beispiel #6
0
        private int ProcessEngageUpdate(ISnApi objSn, string nextcode)
        {
            var result = objSn.EngageTransactionUpdate(new SnEngageUpdateVm()
            {
                number = objSn.UnitSn, workorder = objSn.ShopOrderName, current_operation = nextcode, category1 = null, category2 = null, routing = null, description = "", last_operation = objSn.SnDetail.last_operation, last_result = true, finished_date = null, wip = true, perform_start_date = null, perform_operation = Operation
            }, objSn.SnDetail.slug);

            OnTransactionProceed(ReturnMsg);
            return(result);
        }
Beispiel #7
0
        private int ProcessFailure(ISnApi objSn, IFailureApi objFailure, int performId)
        {
            //TODO : update failure
            //var paramValue = objFailure.GetParamItemValue(performId);
            //if (!paramValue.Any()) return 0;
            //var result = _objTrans.PerformParametric(paramValue, objSn.UnitSn);
            var result = 0;

            OnTransactionProceed(ReturnMsg);
            return(result);
        }
Beispiel #8
0
        private int ProcessParam(ISnApi objSn, IParamApi objParam, int performId)
        {
            var paramValue = objParam.GetParamItemValue(performId);

            if (!paramValue.Any())
            {
                return(0);
            }
            var result = objParam.PerformParametric(paramValue, objSn.UnitSn);

            OnTransactionProceed(ReturnMsg);
            return(result);
        }
Beispiel #9
0
 private void RollBackTransaction(ISnApi objSn, ISoApi objSo, IParamApi objParam, IFailureApi objFailure)
 {
     if (_paramId != 0)
     {
         RollBackParameter(objParam);
     }
     if (_failureId != 0)
     {
         RollBackFailure(objFailure);
     }
     if (_engageId != 0)
     {
         RollBackEngage(objSn, objSo);
     }
     if (_transId != 0)
     {
         RollBackTransaction(objSn);
     }
 }
Beispiel #10
0
 private void RollBackTransaction(ISnApi objSn)
 {
 }
Beispiel #11
0
 private void RollBackEngage(ISnApi objSn, ISoApi objSo)
 {
 }