public static string DemoUri(string passphrase)
        {
            var path = "/demos/login?passphrase=" + passphrase;

            return(Parameters.Service.AbsoluteUri != null
                ? Parameters.Service.AbsoluteUri + path
                : Url.AbsoluteUri().Replace(Url.AbsolutePath(), Get(path)));
        }
Exemple #2
0
        private void Notice(SiteSettings ss, string type)
        {
            var title = WikiUtilities.TitleDisplayValue(ss, this);
            var url   = Url.AbsoluteUri().Replace(
                Url.AbsolutePath(), Locations.ItemEdit(WikiId));

            ss.Notifications.Where(o => o.Enabled).ForEach(notification =>
            {
                if (notification.HasRelatedUsers())
                {
                    var users = new List <long>();
                    Rds.ExecuteTable(statements: Rds.SelectWikis(
                                         tableType: Sqls.TableTypes.All,
                                         distinct: true,
                                         column: Rds.WikisColumn()
                                         .Creator()
                                         .Updator(),
                                         where : Rds.WikisWhere().WikiId(WikiId)))
                    .AsEnumerable()
                    .ForEach(dataRow =>
                    {
                        users.Add(dataRow["Creator"].ToLong());
                        users.Add(dataRow["Updator"].ToLong());
                    });
                    notification.ReplaceRelatedUsers(users);
                }
                switch (type)
                {
                case "Created":
                    notification.Send(
                        Displays.Created(title).ToString(),
                        url,
                        NoticeBody(ss, notification));
                    break;

                case "Updated":
                    var body = NoticeBody(ss, notification, update: true);
                    if (body.Length > 0)
                    {
                        notification.Send(
                            Displays.Updated(title).ToString(),
                            url,
                            body);
                    }
                    break;

                case "Deleted":
                    notification.Send(
                        Displays.Deleted(title).ToString(),
                        url,
                        NoticeBody(ss, notification));
                    break;
                }
            });
        }
 public static string ItemEditAbsoluteUri(long id)
 {
     return(Parameters.Service.AbsoluteUri != null
         ? Parameters.Service.AbsoluteUri + "/items/" + id
         : Url.AbsoluteUri().Replace(Url.AbsolutePath(), ItemEdit(id)));
 }
        /// <summary>
        /// Fixed:
        /// </summary>
        private static string Location()
        {
            var location = Url.AbsoluteUri().ToLower();

            return(location.Substring(0, location.IndexOf("/outgoingmails")));
        }