Exemplo n.º 1
0
        private bool NeedNotify(TaskScheduling task, int processedFailed, int processedSuccessFully)
        {
            bool flag;

            if (!task.get_SendReport())
            {
                flag = false;
            }
            else if ((!task.get_SendOnFailure() ? false : processedFailed > 0))
            {
                flag = true;
            }
            else if ((!task.get_SendOnSuccess() ? true : processedSuccessFully <= 0))
            {
                flag = ((!task.get_SendOnUpdate() ? true : processedSuccessFully <= 0) ? false : true);
            }
            else
            {
                flag = true;
            }
            return(flag);
        }
Exemplo n.º 2
0
        private bool SendNotification(ServicesGroupServiceClient groupClient, TaskScheduling task, List <Group> groups, int processedFailed, int processedSuccessFully, string clientID = "")
        {
            bool flag;

            if (this.NeedNotify(task, processedFailed, processedSuccessFully))
            {
                try
                {
                    List <Group> compressedList = Helper.PrepareCompressedData(groups);
                    Console.WriteLine(string.Concat(Environment.NewLine, "SENDING NOTIFICATION THROUGH GROUP CLIENT FOR CLIENT ", clientID, Environment.NewLine));
                    groupClient.SendUpdateNotification(task.get_IdentityStoreId(), compressedList, task.get_SendToSpecified(), task.get_SendToOwner(), task.get_SendOnUpdate(), clientID);
                    flag = true;
                }
                catch (Exception exception)
                {
                    this.logger.Error("Error occurred while sending smart group update notifications. ", exception);
                    flag = false;
                }
            }
            else
            {
                flag = true;
            }
            return(flag);
        }