Click here to Skip to main content
11,705,617 members (54,371 online)
Click here to Skip to main content
Articles » Web Development » Ajax » Atlas » Downloads
Add your own
alternative version

Build a Google IG like AJAX Start Page in 7 days using ASP.NET AJAX and .NET 3.0

, 10 Mar 2010 CPOL 1.2M 7.6K 1.1K
Build a Start Page similar to Google IG in 7 nights using ASP.NET AJAX, .NET 3.0, LINQ, DLinq, and XLinq.
dashboard.zip
src
bin
AjaxControlToolkit.dll
CustomDragDrop
Dashboard
App_Code
App_Data
App_Themes
Default
google.gif
HeaderBack.PNG
Logo.png
max_blue.gif
max_blue_highlight.gif
min_blue.gif
min_blue_highlight.gif
x_blue.gif
x_blue_highlight.gif
Bin
AjaxControlToolkit.dll
CSharp3CodeDomProvider.dll
Global.asax
indicator.gif
vwd.webinfo
Widgets
FlickrIcon.gif
rss.gif
DashboardBusiness
Activities
CreateDeafultWidgetsOnPageActivity.rules
DashboardBusiness.csproj.user
NewUserSetupWorkflow.rules
Properties
UserVisitWorkflow.rules
DashboardData
Properties
Dashboard.bak
using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
using System.Workflow.ComponentModel.Compiler;
using System.Workflow.ComponentModel.Serialization;
using System.Workflow.Runtime;
using System.Workflow.Activities;
using System.Workflow.Activities.Rules;

using System.Data.DLinq;
using System.Query;

using DashboardDataAccess;

namespace DashboardBusiness.Activities
{
    public partial class GetUserSettingActivity : System.Workflow.ComponentModel.Activity
	{
		public GetUserSettingActivity()
		{
			InitializeComponent();
		}

        private static DependencyProperty UserGuidProperty = DependencyProperty.Register("UserGuid", typeof(Guid), typeof(GetUserSettingActivity));
        public Guid UserGuid
        {
            get { return (Guid)base.GetValue(UserGuidProperty); }
            set { base.SetValue(UserGuidProperty, value); }
        }

        
        private static DependencyProperty UserSettingProperty = DependencyProperty.Register("UserSetting", typeof(UserSetting), typeof(GetUserSettingActivity));
        public UserSetting UserSetting
        {
            get { return (UserSetting)base.GetValue(UserSettingProperty); }
            set { base.SetValue(UserSettingProperty, value); }
        }

        private static DependencyProperty CurrentPageProperty = DependencyProperty.Register("CurrentPage", typeof(Page), typeof(GetUserSettingActivity));
        public Page CurrentPage
        {
            get { return (Page)base.GetValue(CurrentPageProperty); }
            set { base.SetValue(CurrentPageProperty, value); }
        }

        protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
        {
            using( new TimedLog(UserGuid.ToString(), "Activity: Get User Setting") )
            {
                DashboardData db = DatabaseHelper.GetDashboardData();
                
                //this.UserSetting = db.UserSettings.Single( u => u.UserId == UserGuid );
                var query = from u in db.UserSettings
                             where u.UserId == UserGuid
                             select u;
                
                IEnumerator<UserSetting> e = query.GetEnumerator();

                if( e.MoveNext() )
                {
                    this.UserSetting = e.Current;
                }
                else
                {
                    // No setting saved before. Create default setting
                    UserSetting newSetting = new UserSetting();
                    newSetting.UserId = UserGuid;
                    newSetting.CurrentPageId = (from page in db.Pages 
                                                where page.UserId == UserGuid 
                                                select page.ID).First();

                    db.UserSettings.Add(newSetting);
                    db.SubmitChanges();

                    this.UserSetting = newSetting;
                }

                this.CurrentPage = db.Pages.Single(page => page.ID == this.UserSetting.CurrentPageId);

                return ActivityExecutionStatus.Closed;
            }
        }

	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Omar Al Zabir
Architect BT, UK (ex British Telecom)
United Kingdom United Kingdom

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150819.1 | Last Updated 10 Mar 2010
Article Copyright 2007 by Omar Al Zabir
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid