Beispiel #1
0
        public TransitBookmark GetBookmarkIfModifiedSinceById(string ticket, int id, DateTime ifModifiedSince)
        {
            TransitBookmark t_instance = WebServiceImpl <TransitBookmark, ManagedBookmark, Bookmark> .GetById(
                ticket, id);

            if (t_instance.Modified <= ifModifiedSince)
            {
                return(null);
            }

            return(t_instance);
        }
 public void save_Click(object sender, EventArgs e)
 {
     TransitBookmark t = new TransitBookmark();
     t.Name = inputName.Text;
     t.Description = inputDescription.Text;
     t.Url = inputUrl.Text;
     t.Id = RequestId;
     if (inputFullBitmap.HasFile) t.FullBitmap = new ThumbnailBitmap(inputFullBitmap.FileContent, new Size(16, 16), 
         ThumbnailBitmap.s_FullSize, ThumbnailBitmap.s_ThumbnailSize).Bitmap;
     if (inputLinkBitmap.HasFile) t.LinkBitmap = new ThumbnailBitmap(inputLinkBitmap.FileContent, new Size(16, 16), 
         ThumbnailBitmap.s_FullSize, ThumbnailBitmap.s_ThumbnailSize).Bitmap;
     SessionManager.CreateOrUpdate<TransitBookmark>(
         t, SessionManager.ObjectService.CreateOrUpdateBookmark);
     Redirect("SystemBookmarksManage.aspx");
 }
Beispiel #3
0
    public override TransitPicture GetPictureWithThumbnail(int id)
    {
        TransitBookmark p = SessionManager.GetInstance <TransitBookmark, int>(
            id, SessionManager.ObjectService.GetBookmarkById);

        if (p == null)
        {
            return(null);
        }

        TransitPicture result = new TransitPicture();

        result.Id       = p.Id;
        result.Bitmap   = p.LinkBitmap;
        result.Created  = p.Created;
        result.Modified = p.Modified;
        result.Name     = p.Name;
        return(result);
    }
Beispiel #4
0
    public override TransitPicture GetPictureWithBitmap(int id, DateTime ifModifiedSince)
    {
        TransitBookmark p = SessionManager.GetInstance <TransitBookmark, int, DateTime>(
            id, ifModifiedSince, SessionManager.ObjectService.GetBookmarkIfModifiedSinceById);

        if (p == null)
        {
            return(null);
        }

        TransitPicture result = new TransitPicture();

        result.Id       = p.Id;
        result.Bitmap   = p.FullBitmap;
        result.Created  = p.Created;
        result.Modified = p.Modified;
        result.Name     = p.Name;
        return(result);
    }
Beispiel #5
0
    public void save_Click(object sender, EventArgs e)
    {
        TransitBookmark t = new TransitBookmark();

        t.Name        = inputName.Text;
        t.Description = inputDescription.Text;
        t.Url         = inputUrl.Text;
        t.Id          = RequestId;
        if (inputFullBitmap.HasFile)
        {
            t.FullBitmap = new ThumbnailBitmap(inputFullBitmap.FileContent, new Size(16, 16),
                                               ThumbnailBitmap.s_FullSize, ThumbnailBitmap.s_ThumbnailSize).Bitmap;
        }
        if (inputLinkBitmap.HasFile)
        {
            t.LinkBitmap = new ThumbnailBitmap(inputLinkBitmap.FileContent, new Size(16, 16),
                                               ThumbnailBitmap.s_FullSize, ThumbnailBitmap.s_ThumbnailSize).Bitmap;
        }
        SessionManager.CreateOrUpdate <TransitBookmark>(
            t, SessionManager.ObjectService.CreateOrUpdateBookmark);
        Redirect("SystemBookmarksManage.aspx");
    }
Beispiel #6
0
    public void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("System Preferences", Request, "SystemPreferencesManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode("Bookmarks", Request, "SystemBookmarksManage.aspx"));

            DomainClass cs = SessionManager.GetDomainClass("Bookmark");
            inputName.MaxLength = cs["Name"].MaxLengthInChars;
            inputUrl.MaxLength  = cs["Url"].MaxLengthInChars;

            if (RequestId > 0)
            {
                TransitBookmark t = SessionManager.ObjectService.GetBookmarkById(
                    SessionManager.Ticket, RequestId);
                inputName.Text           = t.Name;
                inputDescription.Text    = t.Description;
                inputUrl.Text            = t.Url;
                imageFullBitmap.ImageUrl = string.Format("SystemBookmark.aspx?id={0}&CacheDuration=0", t.Id);
                imageFullBitmap.Visible  = t.HasFullBitmap;
                imageLinkBitmap.ImageUrl = string.Format("SystemBookmark.aspx?id={0}&CacheDuration=0&ShowThumbnail=true", t.Id);
                imageLinkBitmap.Visible  = t.HasLinkBitmap;
                sitemapdata.Add(new SiteMapDataAttributeNode(t.Name, Request.Url));
            }
            else
            {
                imageFullBitmap.Visible = false;
                imageLinkBitmap.Visible = false;
                sitemapdata.Add(new SiteMapDataAttributeNode("New Bookmark", Request.Url));
            }
            StackSiteMap(sitemapdata);
        }

        SetDefaultButton(manageAdd);
    }
Beispiel #7
0
 public int CreateOrUpdateBookmark(string ticket, TransitBookmark bookmark)
 {
     return(WebServiceImpl <TransitBookmark, ManagedBookmark, Bookmark> .CreateOrUpdate(
                ticket, bookmark));
 }
Beispiel #8
0
 public int CreateOrUpdateBookmark(string ticket, TransitBookmark bookmark)
 {
     return WebServiceImpl<TransitBookmark, ManagedBookmark, Bookmark>.CreateOrUpdate(
         ticket, bookmark);
 }