public ApiDocument getDocInfoByEvent(Event e) { GetDocInfoRequest req = null; GetDocInfoResponse resp = null; GetContentResponse content = null; try { req = new GetDocInfoRequest(authToken, e.document_id); resp = (GetDocInfoResponse)Http2.post <GetDocInfoResponse>("https://api-service.edi.su/Api/Dixy/TimeLine/GetDocData", req); if (resp.intCode == 200) { content = getDocumentContent(e); resp.document.file_body = content.body; resp.document.sign_body = content.sign; return(resp.document); } return(null); } catch (Exception ex) { Logger.log("error while processing [" + e.document_id + "]"); Logger.log(resp.varMessage); Logger.log(ex.Message); return(null); } }
protected override void ExecuteParticular(MainModel model) { logger.Info("begin"); model.TabShow = _tab; GetDocInfoRequest request = new GetDocInfoRequest(); request.UserInfo = NavigationHandler.CurrentUser; request.IdTrasm = _idTrasm; request.IdEvento = _idEvento; request.IdDoc = _idDoc; request.IdGruppo = NavigationHandler.RuoloInfo.IdGruppo; request.IdCorrGlobali = NavigationHandler.RuoloInfo.Id; if (NavigationHandler.DeleganteInfo != null) //Abbiamo una delega in esercizio { request.UserInfo.DelegatoInfo = NavigationHandler.LoggedInfo; } GetDocInfoResponse response = WSStub.getDocInfo(request); logger.Info("responseCode: " + response.Code); if (response.Code == GetDocInfoResponseCode.OK) { DettaglioDFTrasmModel tabModel = new DettaglioDFTrasmModel(); tabModel.IdTrasm = _idTrasm; tabModel.IdEvento = _idEvento;; tabModel.DocInfo = response.DocInfo; tabModel.Allegati = response.Allegati; tabModel.TrasmInfo = response.TrasmInfo; if (tabModel.TrasmInfo != null && !tabModel.TrasmInfo.HasWorkflow && ConfigurationHandler.RemoveTrasmInTDL) { //NavigationHandler.ToDoListMemento = null; } model.TabModel = tabModel; } else { logger.Info("add system error"); addSystemError(model); } logger.Info("end"); }
protected override void ExecuteParticular(MainModel model) { model.TabShow = Tab.TRASMISSIONE; ListaModelliTrasmRequest req = new ListaModelliTrasmRequest(); req.UserInfo = NavigationHandler.CurrentUser; if (NavigationHandler.DeleganteInfo != null) //Abbiamo una delega in esercizio { req.UserInfo.DelegatoInfo = NavigationHandler.LoggedInfo; } req.IdCorrGlobali = NavigationHandler.RuoloInfo.Id; if (_isFascicolo) { req.TrasmFasc = true; } ListaModelliTrasmResponse resp = WSStub.getListaModelliTrasm(req); if (resp.Code == ListaModelliTrasmResponseCode.OK) { TrasmissioneModel tabModel = new TrasmissioneModel(); tabModel.IdTrasmPerAcc = this._idTrasmPerAcc; if (typeof(DettaglioDFTrasmModel) == NavigationHandler.Model.TabModel.GetType()) { logger.Debug("ricavo info fasc/doc da dettaglio"); DettaglioDFTrasmModel dett = (DettaglioDFTrasmModel)NavigationHandler.Model.TabModel; tabModel.DocInfo = dett.DocInfo; tabModel.FascInfo = dett.FascInfo; } else { if (_isFascicolo) { logger.Debug("ricavo info fasc"); GetFascInfoRequest request = new GetFascInfoRequest(); request.UserInfo = NavigationHandler.CurrentUser; if (NavigationHandler.DeleganteInfo != null) //Abbiamo una delega in esercizio { request.UserInfo.DelegatoInfo = NavigationHandler.LoggedInfo; } request.IdFasc = _idDocFasc; request.IdGruppo = NavigationHandler.RuoloInfo.IdGruppo; request.IdCorrGlobali = NavigationHandler.RuoloInfo.Id; GetFascInfoResponse response = WSStub.getFascInfo(request); tabModel.FascInfo = response.FascInfo; } else { logger.Debug("ricavo info doc"); GetDocInfoRequest request = new GetDocInfoRequest(); request.UserInfo = NavigationHandler.CurrentUser; if (NavigationHandler.DeleganteInfo != null) //Abbiamo una delega in esercizio { request.UserInfo.DelegatoInfo = NavigationHandler.LoggedInfo; } request.IdDoc = _idDocFasc; request.IdGruppo = NavigationHandler.RuoloInfo.IdGruppo; request.IdCorrGlobali = NavigationHandler.RuoloInfo.Id; GetDocInfoResponse response = WSStub.getDocInfo(request); tabModel.DocInfo = response.DocInfo; } } //sto trasemttendo dopo l' accettazione imposto cantrasmit a true if (!String.IsNullOrEmpty(this._idTrasmPerAcc)) { if (tabModel.DocInfo != null) { tabModel.DocInfo.CanTransmit = true; } if (tabModel.FascInfo != null) { tabModel.FascInfo.CanTransmit = true; } } tabModel.ModelliTrasm = resp.Modelli; model.TabModel = tabModel; } else { addSystemError(model); } }