示例#1
0
        private void RenderUcFailure()
        {
            var objSn      = (ISnApi)_objCb.FindControlHasInterfaceInList <ISnApi>(_listOfObj);
            var objFailure = new FailureApi(_objWs, _objMsg, _objFlex, _objCb)
            {
                FormObject = objSn.FormObject
            };

            if (_mType == EnumOperationType.TROUBLESHOOTING)
            {
                objFailure.ReworkOperation = true;
            }
            var objUcFailure = new UcFailure(objFailure, _objCb);

            objUcFailure.FinishEvent += UcFailure_Finish;
            _listOfUc.Add(objUcFailure);
            _listOfObj.Add(objFailure);
        }
        private void RenderModule(IPassFailApi objApi)
        {
            var objSn = (ISnApi)_objCb.FindControlHasInterfaceInList <ISnApi>(_listOfObj);

            switch (objApi.Result)
            {
            case EnumResult.ButtonPass:
                if (objApi.Result != EnumResult.ButtonSubmit)
                {
                    return;
                }
                var objParam = (IParamApi)_objCb.FindControlHasInterfaceInList <IParamApi>(_listOfObjSnBase);
                var result   = _objTrans.ProcessTransactionPass(objSn, objParam);
                if (result)
                {
                    CancelSn(true);
                }
                break;

            case EnumResult.ButtonFail:
                var objFailure = new FailureApi(_objWs, _objMsg, _objFlex, _objCb)
                {
                    FormObject = objSn.FormObject, UnitSn = objSn.UnitSn
                };
                if (_mType == EnumOperationType.INSPECTION)
                {
                    objFailure.ReworkOperation = true;     // TODO: need condition to show rework group or not
                }
                var objUcFailure = new UcFailure(objFailure, _objCb);
                objUcFailure.FinishEvent += UcFailure_Finish;
                var lt = new List <UserControl> {
                    objUcFailure
                };
                _objCb.RenderTabForm(lt, objFailure.GetType().Name, "Unit Failure", _tabControl, true);
                _listOfObjSnBase.Add(objFailure);
                break;

            case EnumResult.ButtonSubmitFail: break;
            }
        }