Exemplo n.º 1
0
        public async Task <List <NotificationResultEN> > SendNotification(CampaignEN pCampaign)
        {
            List <NotificationResultEN> camapignResult = new List <NotificationResultEN>();

            try
            {
                int resultInsert = campaignDAL.InsertCampaign(pCampaign);
                if (resultInsert > 0)
                {
                    bool inserted = campaignDAL.InsertUsersNotifications(pCampaign.CountryISO2Code, resultInsert);
                    if (inserted)
                    {
                        //Send notification
                        camapignResult = await handler.HandleContent(pCampaign);
                    }
                }
            }
            catch (Exception ex)
            {
                camapignResult = null;
                Console.WriteLine(ex.InnerException);
                EventViewerLoggerBL.LogError("CampaignBL " + ex.Message);
            }

            return(camapignResult);
        }