本文整理汇总了C#中Data.getDayOfWeek方法的典型用法代码示例。如果您正苦于以下问题:C# Data.getDayOfWeek方法的具体用法?C# Data.getDayOfWeek怎么用?C# Data.getDayOfWeek使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Data
的用法示例。
在下文中一共展示了Data.getDayOfWeek方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Search
//.........这里部分代码省略.........
state = " AND [email protected] ";
stateVen = " AND [email protected] ";
stateParam = StateTextBox.Text;
resultsStr += " in " + StateTextBox.Text;
}
else
{
goOn = false;
message = "You must at the very least include a zip code or State and City.";
}
}
}
if (goOn)
{
string date = "";
string dateVen = "";
HttpCookie timeCookie = Request.Cookies["SetTime"];
string test = "All%20Future%20Events";
if(timeCookie != null)
test = timeCookie.Value;
if (test.Trim() == "")
test = "All%20Future%20Events";
if (test != "")
{
string theDate = "";
int subtraction = 0;
string startDate = "";
string endDate = "";
//Variables for Locale regular events
string dayOfWeek = dat.getDayOfWeek(itBeNow.DayOfWeek);
int dayOfWeekInt = int.Parse(dayOfWeek);
switch (test)
{
case "Today":
dateVen = " AND Days LIKE '%" + dayOfWeek + "%'";
resultsStr += " Today ";
theDate = isn.ToShortDateString();
date = " AND (CONVERT(NVARCHAR,MONTH(EO.DateTimeStart)) + '/' + CONVERT(NVARCHAR,DAY(EO.DateTimeStart)) + '/' + CONVERT(NVARCHAR,YEAR(EO.DateTimeStart)) " +
" = CONVERT(DATETIME, '" + theDate + "') OR (CONVERT(NVARCHAR,MONTH(EO.DateTimeStart)) + '/' + "+
"CONVERT(NVARCHAR,DAY(EO.DateTimeStart)) + '/' + CONVERT(NVARCHAR,YEAR(EO.DateTimeStart)) < "+
"CONVERT(DATETIME, '" + theDate + "') AND CONVERT(NVARCHAR,MONTH(EO.DateTimeEnd)) + '/' + CONVERT(NVARCHAR,DAY(EO.DateTimeEnd)) + '/' + CONVERT(NVARCHAR,YEAR(EO.DateTimeEnd)) > CONVERT(DATETIME, '" + theDate + "'))) ";
break;
case "Tomorrow":
dayOfWeekInt++;
if (dayOfWeekInt > 7)
dayOfWeekInt = 1;
dateVen = " AND Days LIKE '%" + dayOfWeekInt.ToString() + "%'";
resultsStr += " Tomorrow ";
theDate = isn.AddDays(1.00).ToShortDateString();
date = " AND (CONVERT(NVARCHAR,MONTH(EO.DateTimeStart)) + '/' + CONVERT(NVARCHAR,DAY(EO.DateTimeStart)) + '/' + CONVERT(NVARCHAR,YEAR(EO.DateTimeStart)) " +
" = CONVERT(DATETIME, '" + theDate + "') OR (CONVERT(NVARCHAR,MONTH(EO.DateTimeStart)) + '/' + " +
"CONVERT(NVARCHAR,DAY(EO.DateTimeStart)) + '/' + CONVERT(NVARCHAR,YEAR(EO.DateTimeStart)) < " +
"CONVERT(DATETIME, '" + theDate + "') AND CONVERT(NVARCHAR,MONTH(EO.DateTimeEnd)) + '/' + CONVERT(NVARCHAR,DAY(EO.DateTimeEnd)) + '/' + CONVERT(NVARCHAR,YEAR(EO.DateTimeEnd)) > CONVERT(DATETIME, '" + theDate + "')))";
break;
case "This%20Weekend":
dateVen = " AND (Days LIKE '%5%' OR Days LIKE '%6%' OR Days LIKE '%7%') ";
resultsStr += " This Weekend ";
switch (isn.DayOfWeek)
{
case DayOfWeek.Friday:
subtraction = 0;
示例2: GetEvents
//.........这里部分代码省略.........
{
if (city != "")
{
types[0] = SqlDbType.NVarChar;
data[0] = city;
city = " AND [email protected] ";
}
}
ds = dat.GetDataWithParemeters("SELECT DISTINCT TOP " + totalCount.ToString() + " " +
"E.Header, E.Featured, EO.DateTimeStart AS StartTime, EO.DateTimeEnd AS EndTime, E.DaysFeatured, E.PostedOn, E.Content, EO.EventID, 'E' AS Type FROM Events E, Event_Occurance EO WHERE " +
"E.LIVE='True' AND E.ID=EO.EventID " + country + state + city + timeframe + highestPrice +
" ORDER BY E.Featured, E.PostedOn, EO.DateTimeStart", types, data);
}
//totalCount = totalCount - ds.Tables[0].Rows.Count;
#endregion
if (totalCount > 0)
{
#region Get Trips
string theDate = "";
subtraction = 0;
startDate = "";
endDate = "";
string dayToday = itBeNow.Day.ToString();
string monthTody = itBeNow.Month.ToString();
string yearToday = itBeNow.Year.ToString();
string dateToday = monthTody + "/" + dayToday + "/" + yearToday;
string dayOfWeek = dat.getDayOfWeek(itBeNow.DayOfWeek);
string timeNow = itBeNow.TimeOfDay.ToString();
string dayStart = "";
string dayEnd = "";
string startMonth = "";
string endMonth = "";
string startYear = "";
string endYear = "";
string dateStart = "";
string dateEnd = "";
string startDayOfWeek = "";
string endDayOfWeek = "";
string resultsStr = "";
string date = "";
string highestP = "";
if (theEnum == TimeFrame.HighestPrice)
{
highestP = " AND ((E.MaxPrice <= " + HighestPriceInput.Value.Replace("$", "") +
") OR (E.MaxPrice >= " + HighestPriceInput.Value.Replace("$", "") + " AND E.MinPrice <= " +
HighestPriceInput.Value.Replace("$", "") + ")" +
"OR (E.MaxPrice IS NULL AND E.MinPrice IS NULL)) ";
}
switch (theEnum)
{
case TimeFrame.Beginning:
StartDate = itBeNow;
示例3: Search
//.........这里部分代码省略.........
}
}
}
if (goOn)
{
string date = "";
HttpCookie timeCookie = Request.Cookies["SetTime"];
string test = "All%20Future%20Events";
if (timeCookie != null)
test = timeCookie.Value;
if (test.Trim() == "")
test = "All%20Future%20Events";
if (test != "")
{
string theDate = "";
int subtraction = 0;
string startDate = "";
string endDate = "";
DateTime StartDate = new DateTime();
DateTime EndDate = new DateTime();
string dayToday = isNow.Day.ToString();
string monthTody = isNow.Month.ToString();
string yearToday = isNow.Year.ToString();
string dateToday = monthTody + "/" + dayToday + "/" + yearToday;
string dayOfWeek = dat.getDayOfWeek(isNow.DayOfWeek);
string timeNow = isNow.TimeOfDay.ToString();
string dayStart = "";
string dayEnd = "";
string startMonth = "";
string endMonth = "";
string startYear = "";
string endYear = "";
string dateStart = "";
string dateEnd = "";
string startDayOfWeek = "";
string endDayOfWeek = "";
switch (test)
{
case "Today":
resultsStr += " Today ";
date = " (CONVERT(DATETIME,CONVERT(NVARCHAR,TM.MonthStart)+'/'+CONVERT(NVARCHAR,TM.DayStart)+'/'+'" + yearToday +
"') <= CONVERT(DATETIME, '" + dateToday + "') AND CONVERT(DATETIME,CONVERT(NVARCHAR,TM.MonthEnd) +" +
"'/'+CONVERT(NVARCHAR,TM.DayEnd)+'/'+'" + yearToday +
"') >= CONVERT(DATETIME, '" + dateToday + "') AND TDS.Days LIKE '%" + dayOfWeek +
"%' AND CONVERT(DATETIME, TDS.StartTime) <= CONVERT(DATETIME, '" + timeNow +
"') AND CONVERT(DATETIME, TDS.EndTime) >= CONVERT(DATETIME, '" + timeNow + "') )";
break;
case "Tomorrow":
isNow = isNow.AddDays(1);
dayToday = isNow.Day.ToString();
monthTody = isNow.Month.ToString();
yearToday = isNow.Year.ToString();