code

Asp.Net MVC Calendar Helper

What it looks like

MVC3 Calendar

Recently while working on a project with Asp.Net MVC 3 there was a need for a small calendar similar to the asp.net calendar control. After some searching I decided that the easiest method to get this done would be to write a Html Helper. Below is the code that seems to work nicely. This works even if the browser does not support javascript. For added functionality you could add an extra parameter to show highlighted dates or extend it to fill a page and add content to the cells.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;
 
namespace AntiYes.Helpers
{
    public static class CalendarExtensions
    {
        public static IHtmlString Calendar(this HtmlHelper helper, DateTime dateToShow)
        {
            DateTimeFormatInfo cinfo = DateTimeFormatInfo.CurrentInfo;
            StringBuilder sb = new StringBuilder();
            DateTime date = new DateTime(dateToShow.Year, dateToShow.Month, 1);
            int emptyCells = ((int)date.DayOfWeek + 7 - (int)cinfo.FirstDayOfWeek) % 7;
            int days = DateTime.DaysInMonth(dateToShow.Year, dateToShow.Month);
            sb.Append("<table class='cal'><tr><th colspan='7'>" + cinfo.MonthNames[date.Month - 1] + " " + dateToShow.Year + "</th></tr>");
            for (int i = 0; i < ((days + emptyCells) > 35 ? 42 : 35); i++)
            {
                if (i % 7 == 0)
                {
                    if (i > 0) sb.Append("</tr>");
                    sb.Append("<tr>");
                }
 
                if (i < emptyCells || i >= emptyCells + days)
                {
                    sb.Append("<td class='cal-empty'>&nbsp;</td>");
                }
                else
                {
                    sb.Append("<td class='cal-day'>" + date.Day + "</td>");
                    date = date.AddDays(1);
                }
            }
            sb.Append("</tr></table>");
            return helper.Raw(sb.ToString());
        }
    }
}

Code PaLOUsa

When: 
Friday, March 4, 2011 (All day) - Saturday, March 5, 2011 (All day)

http://www.codepalousa.com/

What is Code PaLOUsa

 

Code PaLOUsa is a two-day, eight track software development conference to be held March 4 and 5, 2011 at the historic Seelbach Hilton Hotel in downtown Louisville, KY.  The conference is designed to to cover all aspects of software development regardless of technology stack.  We will have sessions revolvoing around Microsoft, Java, and other development platforms; along with session on higher levels that are platform agnostic.  The conference schedule will feature presentations from well-known professionals in the software development community.  We are planning on conducting sixty seventy-minute-long technical presentations and panel discussions, plus a keynote speech during the first evening of the event.

Along with the planned sessions, there will be space reserved for an exhibition hall where attendees will be able to interact with the leading companies in the software development realm.

Close form after 10 seconds

In response to http://stackoverflow.com/questions/4506033/close-form-after-10-seconds

1
2
3
4
5
6
7
8
Public Class Form1
 
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim frm2 As New Form2()
        frm2.ShowDialog()
    End Sub
 
End Class
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Imports System.Timers
 
Public Class Form2
 
    Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
        MyBase.OnLoad(e)
        Dim tmr As New System.Timers.Timer()
        tmr.Interval = 5000
        tmr.Enabled = True
        tmr.Start()
        AddHandler tmr.Elapsed, AddressOf OnTimedEvent
    End Sub
 
    Private Delegate Sub CloseFormCallback()
 
    Private Sub CloseForm()
        If InvokeRequired Then
            Dim d As New CloseFormCallback(AddressOf CloseForm)
            Invoke(d, Nothing)
        Else
            Close()
        End If
    End Sub
 
    Private Sub OnTimedEvent(ByVal sender As Object, ByVal e As ElapsedEventArgs)
        CloseForm()
    End Sub
 
End Class

MSDN Events Present: Azure 2 Day Bootcamp

When: 
Tuesday, February 8, 2011 - 8:30am - Wednesday, February 9, 2011 - 5:00pm

MSDN Events Present: Azure 2 Day Bootcamp

https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032468995&E...

Event ID: 1032468995

Ohio State, Longaberger Alumni Center
Sanders Grand Lounge
2200 Olentangy River Rd
Columbus Ohio 43210-1035
United States

Tuesday, February 08, 2011 8:30 AM
Wednesday, February 09, 2011 5:00 PM
Eastern Time (US & Canada)
Welcome Time: 8:00 AM

 
 
Register by Phone: 1-877-MSEVENT (673-8368)
 
Meal: Yes
Language(s): English.
Product(s): Windows Azure.
Audience(s): Pro Dev/Programmer.
 

Event Overview

This is a 2-day deep dive program to help prepare you to deliver solutions on the Windows Azure Platform. We have worked to bring the region’s best Azure experts together to teach you how to work in the cloud. Each day will be filled with training, discussion, reviewing real scenarios, and hands on labs. Snacks and drinks will be provided, however we advise you to make your own lunch arrangements prior to the event. You will need to bring a computer loaded with the software listed below.

 

AGENDA

1.       Intro to Cloud Computing and Azure

2.       Web Roles

3.       Messages and Queues

4.       Using Azure Tables

5.       Using BLOB Storage

6.       Worker Roles

7.       Diagnostics and Service Management

8.       SQL Azure

9.       Connecting with AppFabric

10.   Cloud Computing Scenarios

11.   Available Resources

 

What do I need to bring:

During the boot camp you will have opportunities to practice what you learn with labs. Having all of your software ready will make it easier to dive into the yummy goodness of exploring the labs. The lab files package will be given to you during the event .If you want to have everything loaded into a virtual PC that would be even better

 

In order to run these labs you will need to bring:

·         Power strip or extension cord

·         A computer or laptop:

o    Operating Systems Supported: Windows 7; Windows Server 2008; Windows Server 2008 R2; Windows Vista Service Pack 1; Windows Vista Service Pack 2

o    Microsoft Visual Studio 2010

o    SQL Server 2005 Express Edition (or above)

o    Install the SDK and Tools

Dogfood 2010

When: 
Thursday, November 4, 2010 - 8:00am - Friday, November 5, 2010 - 4:00pm

http://www.dogfoodcon.com/dogfood/index.html

What

This is a local conference by community IT professionals showcasing Microsoft technologies. There will speakers will be from MS Gold Certified Partners, MS MVPs, IT authors, community leads, and MS Corp subject matter experts.
 

When

November 4th & 5th, 2010
 

Where

The Microsoft Building at Polaris.

8800 Lyra Dr, Columbus, OH 43240