TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
NAVANEETHAN KRISHNAN
NA
2
0
Date time weekly date
Feb 27 2009 2:56 AM
private void GetDates()
{
COLTools.DB.DataBaseType = COLTools.DataBaseType.SqlServer;
COLTools.DB.ConnectionString = ConfigurationSettings.AppSettings["Astro"].ToString();
DataSet ds = COLTools.DB.RunQuerySql("select top 1 Weeklydate from Tarotpre ");
switch (System.DateTime.Today.DayOfWeek)
{
// Label1.Text = COLTools.Time.IST.getLocalTime().AddDays(0).ToShortDateString();
case DayOfWeek.Monday :
Label1.Text = COLTools.Time.IST.getLocalTime().AddDays(0).ToShortDateString();
Label2.Text = COLTools.Time.IST.getLocalTime().AddDays(7).ToShortDateString();
break;
case DayOfWeek.Tuesday :
Label1.Text = COLTools.Time.IST.getLocalTime().AddDays(-1).ToShortDateString();
Label2.Text = COLTools.Time.IST.getLocalTime().AddDays(6).ToShortDateString();
break;
case DayOfWeek.Wednesday :
Label1.Text = COLTools.Time.IST.getLocalTime().AddDays(-2).ToShortDateString();
Label2.Text = COLTools.Time.IST.getLocalTime().AddDays(5).ToShortDateString();
break;
case DayOfWeek.Thursday:
Label1.Text = COLTools.Time.IST.getLocalTime().AddDays(-3).ToShortDateString();
Label2.Text = COLTools.Time.IST.getLocalTime().AddDays(4).ToShortDateString();
break;
case DayOfWeek.Friday:
Label1.Text = COLTools.Time.IST.getLocalTime().AddDays(-4).ToShortDateString();
Label2.Text = COLTools.Time.IST.getLocalTime().AddDays(3).ToShortDateString();
break;
case DayOfWeek.Saturday:
Label1.Text = COLTools.Time.IST.getLocalTime().AddDays(-5).ToShortDateString();
Label2.Text = COLTools.Time.IST.getLocalTime().AddDays(2).ToShortDateString();
break;
case DayOfWeek.Sunday:
Label1.Text = COLTools.Time.IST.getLocalTime().AddDays(-6).ToShortDateString();
Label2.Text = COLTools.Time.IST.getLocalTime().AddDays(1).ToShortDateString();
break;
default:
Label1.Text = COLTools.Time.IST.getLocalTime().AddDays(0).ToShortDateString();
break;
}
}
Reply
Answers (
1
)
How to split a DataTable?
Navigating in functions - returns back before navigating is done.