private string SaveResponseSuccess(string message, string kindOfMessage) { string sbeln = RESPONSE.PCK.FirstOrDefault(e => !string.IsNullOrEmpty(e.SBELN)).SBELN; TPCKDao tpckDao = new TPCKDao(); Embarque embarque = new EmbarqueDao().FindBySbeln(sbeln, kindOfMessage); IDictionary <string, TPCK> dictionaryTcpkByXblnr = tpckDao.DictionaryByXblnr(embarque.ID); IList <Status> listStatus = new List <Status>(); foreach (var itemTpck in RESPONSE.PCK) { string newDesc = ""; if (dictionaryTcpkByXblnr.ContainsKey(itemTpck.XBLNR)) { dictionaryTcpkByXblnr[itemTpck.XBLNR].STATU = itemTpck.STATU; newDesc = MessagesOfReturn.DescriptionUpdateXblnrSuccess(itemTpck.XBLNR, RESPONSE.STATUS.DESC); } else { newDesc = MessagesOfReturn.DescriptionUpdateXblnrNotFound(itemTpck.XBLNR, RESPONSE.STATUS.DESC); } listStatus.Add(RESPONSE.STATUS.BuildsStatusWithNewDesc(newDesc)); } tpckDao.Update(); foreach (var itemStatus in listStatus) { ConfigStatus.SaveStatus(itemStatus, embarque); } return(MessagesOfReturn.ProcessMessageSuccess(message, embarque.SBELN)); }
private string SaveResponseSuccess(string message, string kindOfMessage) { Embarque embarque = new EmbarqueDao().FindBySbeln(RESPONSE.MAIN.SBELN, kindOfMessage); MainDAO dao = new MainDAO(); IList <MAIN> mainsSaved = dao.FindByIdEmbarqueLazy(embarque.ID); if (mainsSaved.Count > 0) { dao.DeleteAll(mainsSaved); } ConfigStatus.SaveStatus(RESPONSE.STATUS, embarque); RESPONSE.MAIN.Embarque = embarque; RESPONSE.MAIN.BUK = RESPONSE.BUK; RESPONSE.MAIN.PAR = RESPONSE.PAR; RESPONSE.MAIN.PARS = RESPONSE.PARS; RESPONSE.MAIN.DAT = RESPONSE.DAT; RESPONSE.MAIN.DI = RESPONSE.DI; RESPONSE.MAIN.BL = RESPONSE.BL; RESPONSE.MAIN.SHP = RESPONSE.SHP; RESPONSE.MAIN.SHP_TEXT_Main = RESPONSE.SHP_TEXT_Main; dao.Save(RESPONSE.MAIN); return(MessagesOfReturn.ProcessMessageSuccess(message, embarque.SBELN)); }
private string SaveResponseSuccess(string message, string kindOfMessage) { Embarque embarque = new EmbarqueDao().FindBySbeln(RESPONSE.TGTESHK_N.SBELN, kindOfMessage); ConfigStatus.SaveStatus(RESPONSE.STATUS, embarque); TGTESHK_NDao dao = new TGTESHK_NDao(); IList <TGTESHK_N> list = dao.FindByIdEmbarqueLazy(embarque.ID); if (list.Count > 0) { dao.DeleteAll(list); } RESPONSE.TGTESHK_N.TGTESHP_N = RESPONSE.TGTESHP_N; RESPONSE.TGTESHK_N.TGTERES = RESPONSE.TGTERES; RESPONSE.TGTESHK_N.TGTEPRD = RESPONSE.TGTEPRD; RESPONSE.TGTESHK_N.SHP_TEXT = RESPONSE.SHP_TEXT; RESPONSE.TGTESHK_N.TGTEDUEK = RESPONSE.TGTEDUEK; RESPONSE.TGTESHK_N.TGTEDUEP = RESPONSE.TGTEDUEP; RESPONSE.TGTESHK_N.Embarque = embarque; RESPONSE.TGTESHK_N.TGTESHP_N.ForEach(t => t.Embarque = embarque); RESPONSE.TGTESHK_N.TGTERES.ForEach(t => t.Embarque = embarque); RESPONSE.TGTESHK_N.TGTEPRD.ForEach(t => t.Embarque = embarque); RESPONSE.TGTESHK_N.SHP_TEXT.ForEach(t => t.Embarque = embarque); RESPONSE.TGTESHK_N.TGTEDUEK.ForEach(t => t.Embarque = embarque); RESPONSE.TGTESHK_N.TGTEDUEP.ForEach(t => t.Embarque = embarque); dao.Save(RESPONSE.TGTESHK_N); return(MessagesOfReturn.ProcessMessageSuccess(message, embarque.SBELN)); }
private string SaveResponseError(string xmlResponse, string identifier) { ResponseFatalError returnError = new DeserializeXml <ResponseFatalError>().deserializeXmlForDB(xmlResponse); Status status = new Status(returnError.RESPONSE); ConfigStatus.ConfigureStatus(status, _contentFile.NumberOfMessage, _contentFile.KindOfMessage, identifier); ConfigStatus.SaveStatus(status); return(MessagesOfReturn.AlertResponseWebServiceError(_contentFile.Message, identifier, _contentFile.NumberOfMessage)); }
public string SaveDataBase(string identifier, string message, string kindOfMessage) { NumberOfMessage numberOfMessage = NumberOfMessage.Four; ConfigStatus.ConfigureStatus(RESPONSE.STATUS, numberOfMessage, kindOfMessage, identifier); if (RESPONSE.STATUS.ERRORS != null && RESPONSE.STATUS.ERRORS.Count > 0) { return(SaveResponseAlerta(RESPONSE.STATUS, message, numberOfMessage)); } else { return(SaveResponseSuccess(RESPONSE.STATUS, message, identifier)); } }
public string SaveDataBase(string identifier, string message, string kindOfMessage) { string msgReturn = ""; NumberOfMessage numberOfMessage = NumberOfMessage.Two; ConfigStatus.ConfigureStatus(RESPONSE.STATUS, numberOfMessage, kindOfMessage, identifier); if (RESPONSE.MAIN != null && !string.IsNullOrEmpty(RESPONSE.MAIN.SBELN)) { msgReturn = SaveResponseSuccess(message, kindOfMessage); } else { msgReturn = SaveResponseAlerta(RESPONSE.STATUS, message, numberOfMessage); } return(msgReturn); }
public string SaveDataBase(string idBroker, string message, string kindOfMessage) { NumberOfMessage numberOfMessage = NumberOfMessage.One; ConfigStatus.ConfigureStatus(RESPONSE.STATUS, numberOfMessage, kindOfMessage); AlimentaIdDadosBroker(int.Parse(idBroker)); if (RESPONSE.ListaEmbarque != null && RESPONSE.ListaEmbarque.Embarques.Count > 0) { return(SaveResponseSuccess(message, kindOfMessage)); } else if (RESPONSE.STATUS != null) { return(SaveResponseAlerta(message, numberOfMessage)); } else // Se não recebeu nenhum Embarque do WebService { return(MessagesOfReturn.AlertResponseWebServiceError(message, idBroker, numberOfMessage)); } }
private string SaveResponseSuccess(Status retornoWebService, string message, string sbeln) { ConfigStatus.SaveStatus(retornoWebService); return(MessagesOfReturn.ProcessMessageSuccess(message, sbeln)); }
private string SaveResponseAlerta(Status status, string message, NumberOfMessage numberOfMessage) { ConfigStatus.SaveStatus(status); return(MessagesOfReturn.AlertResponseWebServiceError(message, RESPONSE.STATUS.SBELN, numberOfMessage)); }
private string SaveResponseAlerta(string message, NumberOfMessage numberOfMessage) { ConfigStatus.SaveStatus(RESPONSE.STATUS); return(MessagesOfReturn.AlertResponseWebServiceError(message, RESPONSE.STATUS.idBroker.ToString(), numberOfMessage)); }
private string SaveResponseSuccess(string identifier, string message) { ConfigStatus.SaveStatus(RESPONSE.STATUS); return(MessagesOfReturn.ProcessMessageSuccess(message, identifier)); }
private string SaveResponseAlerta(string identifier, string message, NumberOfMessage numberOfMessage) { ConfigStatus.SaveStatus(RESPONSE.STATUS); return(MessagesOfReturn.AlertResponseWebServiceError(message, identifier, numberOfMessage)); }