LatestEdits.ascx.cs :  » Content-Management-Systems-CMS » umbraco » dashboardUtilities » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » Content Management Systems CMS » umbraco 
umbraco » dashboardUtilities » LatestEdits.ascx.cs
namespace dashboardUtilities{
  using System;
  using System.Data;
  using System.Drawing;
  using System.Web;
  using System.Web.UI.WebControls;
  using System.Web.UI.HtmlControls;

  /// <summary>
  ///    Summary description for LatestEdits.
  /// </summary>
  public partial class LatestEdits : System.Web.UI.UserControl
  {

    // Find current user
    public umbraco.BasePages.UmbracoEnsuredPage bp = new umbraco.BasePages.UmbracoEnsuredPage();
    private System.Collections.ArrayList printedIds = new System.Collections.ArrayList();
    private int count = 0;
    private int maxRecords = 5;

    protected void Page_Load(object sender, System.EventArgs e)
    {

      // Put user code to initialize the page here
      Repeater1.DataSource = umbraco.BusinessLogic.Log.GetLogReader(bp.getUser(), umbraco.BusinessLogic.LogTypes.Save, DateTime.Now.Subtract(new System.TimeSpan(7,0,0,0,0)));
      Repeater1.DataBind();
    }

    public string PrintNodeName(object NodeId, object Date) 
    {
      if (!printedIds.Contains(NodeId) && count < maxRecords) 
      {
        printedIds.Add(NodeId);
        try 
        {
          umbraco.cms.businesslogic.web.Document d = new umbraco.cms.businesslogic.web.Document(int.Parse(NodeId.ToString()));
          string parent = "";
          try 
          {
            if (d.Parent != null)
              parent = " (" + d.Parent.Text + ")";
          } 
          catch {}
          count++;
          return 
            "<a href=\"editContent.aspx?id=" + NodeId.ToString() + "\" style=\"text-decoration: none\"><img src=\"" + umbraco.GlobalSettings.Path + "/images/forward.png\" align=\"absmiddle\" border=\"0\"/> " + d.Text + parent + "</a>. " + umbraco.ui.Text("general", "edited", bp.getUser()) + " " + umbraco.library.ShortDateWithTimeAndGlobal(DateTime.Parse(Date.ToString()).ToString(), umbraco.ui.Culture(bp.getUser())) + "<br/>";
        }
        catch {
          return "";
        }
        
      } else
        return "";
    }

    #region Web Form Designer generated code
    override protected void OnInit(EventArgs e)
    {
      //
      // CODEGEN: This call is required by the ASP.NET Web Form Designer.
      //
      InitializeComponent();
      base.OnInit(e);
    }
    
    /// <summary>
    ///    Required method for Designer support - do not modify
    ///    the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    {

    }
    #endregion
  }
}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.