/// <summary> /// Remove asunto from Queue /// </summary> /// <param name="asuntoToUnqueue"></param> private void RemovePending(Entidades.Asunto asuntoToUnqueue) { // Save date of asunto assignment asuntoToUnqueue.AssignmentDate = DateTime.Now; // Save pending information to list DeliverAsuntoList.Remove(asuntoToUnqueue); // Removemos el asunto de la base de respaldo SQL.Asunto.RemoveFromQueueAndSaveHistoricData(asuntoToUnqueue); // Sent update request to logged backoffice SentBalanceRefreshOnBackoffice(asuntoToUnqueue); // Stop sending pending asuntos StopSendAsuntosPending(); }
/// <summary> /// Add pending asunto to qeue /// </summary> /// <param name="asuntoToEnqueue"></param> private void AddPending(Entidades.Asunto asuntoToEnqueue) { // Add the asunto to distribution list DeliverAsuntoList.Add(asuntoToEnqueue); // Add to SQL Qeue SQL.Asunto.AddToQueue(asuntoToEnqueue); // Check if deliver pending asunto is in the list of asuntos without assignation. if (!asuntoToEnqueue.isCreatedByBackoffice) { lstAsuntoFromServiceUnassigned.RemoveAll(asunto => asunto.Numero == asuntoToEnqueue.Numero); } // When adds concludes, start deilvering task StartSendAsuntosPending(); }
/// <summary> /// Remove list of asunto from queue /// </summary> /// <param name="listAsuntoToUnqueue"></param> private void RemovePending(List <Entidades.Asunto> listAsuntoToUnqueue) { // Set up the assignation date to the exact moment who run the method DateTime assignationTime = DateTime.Now; listAsuntoToUnqueue.ForEach(asunto => asunto.AssignmentDate = assignationTime); // Save pending information to list DeliverAsuntoList.Remove(listAsuntoToUnqueue); // Update on Service Database confirmation asuntos SQL.Asunto.RemoveFromQueueAndSaveHistoricData(listAsuntoToUnqueue); // Sent balance refresh to backoffice instance SentBalanceRefreshOnBackoffice(listAsuntoToUnqueue); // Stop sending pending asuntos StopSendAsuntosPending(); }
/// <summary> /// Add a list of asunto to queue /// </summary> /// <param name="listAsuntoToEnqueue"></param> private void AddPending(List <Entidades.Asunto> listAsuntoToEnqueue) { // Add asunto to distribution list DeliverAsuntoList.Add(listAsuntoToEnqueue); // Process add on database first SQL.Asunto.AddToQueue(listAsuntoToEnqueue); // Iterates over all asuntos gived for remove unassigned asunto listAsuntoToEnqueue.ForEach(asuntoQueued => { if (!asuntoQueued.isCreatedByBackoffice) { lstAsuntoFromServiceUnassigned.RemoveAll(asuntoWithoutAssign => asuntoQueued.Numero == asuntoWithoutAssign.Numero); } }); // When adds concludes, start deilvering task StartSendAsuntosPending(); }