I have to implement Holiday logic in the project. Can you suggest, How it can be done? Should implement from the server side say sql server 2008, Does had any options.
or
Should we implement in the Business layer in the project, like wiriting the rules.
MM_MSDN
Member
26 Points
65 Posts
Implementing Holidays in the project
Feb 03, 2013 11:51 AM|LINK
Dear All,
I have to implement Holiday logic in the project. Can you suggest, How it can be done? Should implement from the server side say sql server 2008, Does had any options.
or
Should we implement in the Business layer in the project, like wiriting the rules.
Cynikal
Member
506 Points
117 Posts
Re: Implementing Holidays in the project
Feb 03, 2013 02:18 PM|LINK
Holidays as in...Christmas/Easter? or Holidays as in time off of work (What other countries would call Vacation)?
I would do it server side though.
If the date is between begin date and end date, do the code you want here.
MM_MSDN
Member
26 Points
65 Posts
Re: Implementing Holidays in the project
Feb 04, 2013 06:55 AM|LINK
Thanks for the reply Cynikal.
As you asked, Holidays in the sense Weekends and other festival days like Chirstmas, Easter.
I storing the Festival days list in the table [MM_Holidays], Identifying the weekends [Friday and Saturday] in the .Net in the Business Logic.
Will it be OK to implement?
ramiramilu
All-Star
95245 Points
14072 Posts
Re: Implementing Holidays in the project
Feb 04, 2013 12:10 PM|LINK
i think it is going to be ok....
thanks,
JumpStart
Cynikal
Member
506 Points
117 Posts
Re: Implementing Holidays in the project
Feb 04, 2013 12:17 PM|LINK
You could also do something like this:
protected void Page_Load(object sender, EventArgs e) { if (DateTime.Now.DayOfWeek.ToString() == "Saturday" || DateTime.Now.DayOfWeek.ToString() == "Sunday") { Label1.Text = "Its the weekend!"; } else { Label1.Text = "It's not the weekend. :("; } }That will save you from putting every weekend into a database.