/// <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> /// 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(); }