Try MySite.GetContent() Catch(Useless Info) Finally Site.Close() End Try

The guide to programming and analyzing SQL, .NET, and SAP
posts - 18, comments - 280, trackbacks - 0

My Links

News

Hello World. I'm Jon Hermiz and am a software engineer here in Michigan. Feel free to look around and leave feedback!

Archives

Post Categories

Monday, December 17, 2007

What If: The Dream Company

What If : The Dream Company
 
Ever wonder what if when it comes to your imaginary corporation where you have an unlimited amount of money to spend on talent?
 
What if...
 
 
 
 
 
 
  • MVJ (Michal Valentine Jones…not sure if that is really his name) he’d be in charge of the final base code. Would be willing to give him a duplicate gate keeper key much like that of Peso’s. He’s the go to guy, the man with an answer to much anything when it comes to SQL. He’d come up with weird functions that handle dates…reusable code…ya the weird stuff that just seems to work!
 
  • Kristen (http://www.sqlteam.com/forums/pop_profile.asp?mode=display&id=10539) the Director of the company.  Ahh he makes the big bucks..but he’s well worth it.  He steers the company in the direction of success…well most of the time.  He’s been known for making programmers happy (which just doesn’t sound right).  He actually made a couple of Mladen’s group laugh!  He writes clean code…but he’s too good for that now.  Sometimes MVJ gets frustrated with code he’s inventing, but putting him in the same office with Kristen and Peso he always comes out with a monster that works. But don’t piss Kristen off or you might become a twit: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=69568
 
  • Jezemine (http://www.sqlteam.com/forums/pop_profile.asp?mode=display&id=24731) he would be the central brain of the entire company. The guy is brilliant IMHO. He’s like the Einstein of today (ok not that much but still he knows his stuff). He’s written some nice database documentation tool called SQLSpec http://www.elsasoft.org/. Of course the company would take ownership of it ;) (just kidding). Along with his brain he’d be in charge of the documentation support of the company. His role is essential to our customer base. Without him our customers are lost and frustrated. Him and Peso seem to find speed as a good topic to discuss when it comes to SQL: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=93911
 
  • Graz…good ol graz…the one that put everyone together in one room. He insisted that it would work out…success comes with patience and hard work he would always say. He’s the heart of the corporation and when the heart stops we’re in for some trouble. Graz also runs many of the presentations and brings in special guests to help our developers and our customers as well!
 
We’d hire some major players as well guys / gals like:
 
 
 
 
 
 
 
We’d be a lot like google minus those colors and the lava lamps. Work environment would include jeans, tshirts, pajamas, and even shorts. Roller blading / biking to work would be an option. We’d all have lunch together … maybe Emerald would cook! We’d all become rich too…our stock options would supersede our pay rates just some day.
 
Maybe just maybe…Of course affording all of you would probably be impossible…but then again it’s just a dream.

posted @ Monday, December 17, 2007 11:07 AM | Feedback (9) | Filed Under [ Other ]

How To Create A Sharepoint Like Calendar In ASP.net

This article relates to a couple of articles that are on the site.  The original article was "Cool Tricks With The ASP.net Calendar".  You can find this here: http://weblogs.sqlteam.com/jhermiz/archive/2007/12/10/Cool-Tricks-With-The-ASP.net-Calendar.aspx.  The other article you might find useful is the "Additional Tip For that Calendar Control In ASP.net" this article can be found here: http://weblogs.sqlteam.com/jhermiz/archive/2007/12/11/Additional-Tip-For-That-Calendar-Control-In-ASP.net.aspx.

Have you ever wanted to create a nice calendar control much like the sharepoint calendar control?  You know the calendar control with hyperlink data directly on each calendar day.  The previous articles shows you how to use the DayRender Calendar control event to add image controls.  But what about adding hyperlink controls as well as setting the NavigateURL property for each hyperlink to take you to another web page.

This process is very similiar to the second article where we added image controls to a calendar control.  Now we want to simply add hyperlink controls.

To do this drag and drop a calendar control on your web page.  Use your SQL knowledge to pull some data (with the date for each row of data) from your database table.  Store this data in a datatable or a dataset.  Then loop through your data and compare the date in your dataset / datatable with the day in the Calendar_DayRender event.  If they are equal instantiate a Hyperlink object.  Set its text property, its navigateurl property and whether or not you want a border.

From our previous examples here's some code to help you out:

 

Protected Sub Calendar13_DayRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles Calendar13.DayRender
        Dim nextDate As DateTime
        Dim hl As HyperLink
        Dim onmouseoverStyle As String = "this.style.backgroundColor='#D4EDFF'"
        Dim onmouseoutStyle As String = "this.style.backgroundColor='@BackColor'"
        Dim rowBackColor As String = String.Empty
        Dim notTouched As Boolean

        notTouched = True
        Try
            If Not CType(Session("dsHolidays"), DataSet) Is Nothing Then
                For Each dr As DataRow In CType(Session("dsHolidays"), DataSet).Tables(0).Rows
                    nextDate = CType(dr("HolidayDate"), DateTime)
                    If nextDate = e.Day.Date Then
                        e.Cell.BackColor = System.Drawing.Color.Pink
                        e.Cell.ForeColor = System.Drawing.ColorTranslator.FromHtml("#24618E")
                        notTouched = False
                    End If
                Next
            End If

            If Not CType(Session("dsRequests2"), DataSet) Is Nothing Then
                For Each dr As DataRow In CType(Session("dsRequests2"), DataSet).Tables(0).Rows
                    nextDate = CType(dr("VacationDate"), DateTime)
                    If nextDate = e.Day.Date Then
                        hl = New HyperLink
                        hl.Text = CType(dr("ToolTip"), String)
                        hl.NavigateUrl = "Entry.aspx?ID=" & CType(dr("VacationID"), String)
                        hl.BorderColor = Color.Gray
                        hl.BorderWidth = 1
                        hl.ToolTip = "Click this item to get more detailed information."
                        hl.Font.Name = "Arial Narrow"
                        hl.Font.Bold = False
                        hl.ForeColor = System.Drawing.ColorTranslator.FromHtml("#24618E")
                        e.Cell.BackColor = Color.Azure
                        e.Cell.Controls.Add(hl) 
                        notTouched = False
                    End If
                Next
            End If

            If notTouched And Not e.Day.IsWeekend Then
                e.Cell.Attributes.Add("onmouseover", onmouseoverStyle)
                e.Cell.Attributes.Add("onmouseout", onmouseoutStyle.Replace("@BackColor", rowBackColor))
            End If
        Catch ex As Exception
            Response.Write("Errors occurred: No RuleID / Hire Date specified for user!  " & "Additional errors include: " & ex.ToString())
        End Try
        
    End Sub

The result:

posted @ Monday, December 17, 2007 9:01 AM | Feedback (16) | Filed Under [ .NET SQL Server ]

Powered by:
Powered By Subtext Powered By ASP.NET