1
Answer

Date time weekly date

 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;
        }
        
    }
Answers (1)