Inheritance: ActionRequest
        public ProgressState ToProgressObject(ActionRequest request, string update)
        {
            State state = StringToState(update);

            var prg = new ProgressState(request)
            {
                RequestID        = request.RequestID,
                Description      = request.Description,
                SiteTemplateName = request.SiteTemplateName,
                TenantName       = request.TenantName,
                Url             = request.Url,
                User            = request.User,
                Name            = request.Name,
                StringTimeStamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                StateString     = update,
                State           = state
            };

            return(prg);
        }
        public NotificationEntity(ProgressState request)
            : base(request.StringTimeStamp, request.SiteTemplateName)
        {
            State state = request.State;
            switch (state)
            {
                case State.Created:
                    ProvisioningState = "Created";
                    break;
                case State.Provisioning:
                    ProvisioningState = "Provisioning";
                    break;
                case State.Failed:
                    ProvisioningState = "Failed";
                    break;
                case State.Queued:
                    ProvisioningState = "Queued";
                    break;
                case State.Waiting:
                    ProvisioningState = "Waiting";
                    break;
                default:
                    throw new ArgumentOutOfRangeException(nameof(state), state, null);
            }
            RequestID = request.RequestID;
            CreatedSiteName = request.Name;
            ByUser = request.User;
            if (request.IsSiteCollection)
                CreatedSiteUrl = $"https://{request.TenantName}.sharepoint.com/{request.SiteCollectionRequest.ManagedPath}/{request.Name}";
            else
                CreatedSiteUrl = request.Url + "/" + request.Name;

            UsedTemplate = request.SiteTemplateName;
            Description = request.Description;
            StringTimeStamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
        }
        public void AddNotificationToTable(ProgressState request)
        {
            var ne = new NotificationEntity(request);

            TableOperation insertOperation = TableOperation.InsertOrReplace(ne);
            TableResult result = Table.Execute(insertOperation);
        }
        public ProgressState ToProgressObject(ActionRequest request, string update)
        {
            State state = StringToState(update);

            var prg = new ProgressState(request)
            {
                RequestID = request.RequestID,
                Description = request.Description,
                SiteTemplateName = request.SiteTemplateName,
                TenantName = request.TenantName,
                Url = request.Url,
                User = request.User,
                Name = request.Name,
                StringTimeStamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                StateString = update,
                State = state
            };

            return prg;
        }
 public void SendNotification(ProgressState request)
 {
     var notifications = new NotificationTable();
     notifications.AddNotificationToTable(request);
 }
Example #6
0
 public void sendProgressUpdate(ProgressState ps)
 {
     _context.Clients.All.updateProgress(ps);
 }