本文整理匯總了C#中System.Date.SetFullYear方法的典型用法代碼示例。如果您正苦於以下問題:C# Date.SetFullYear方法的具體用法?C# Date.SetFullYear怎麽用?C# Date.SetFullYear使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Date
的用法示例。
在下文中一共展示了Date.SetFullYear方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: noFacebookSignup2SaveClick
void noFacebookSignup2SaveClick(jQueryEvent e)
{
e.PreventDefault();
if (AsyncInProgress)
return;
View.Connect_LoggedOut_NoFacebook_SignUp2_ErrorLabel.InnerHTML = "";
#region Check name
if (View.Connect_LoggedOut_NoFacebook_SignUp2_FirstNameTextbox.Value.Length == 0)
{
View.Connect_LoggedOut_NoFacebook_SignUp2_ErrorLabel.InnerHTML = "Enter your first name";
return;
}
if (View.Connect_LoggedOut_NoFacebook_SignUp2_LastNameTextbox.Value.Length == 0)
{
View.Connect_LoggedOut_NoFacebook_SignUp2_ErrorLabel.InnerHTML = "Enter your last name";
return;
}
if (View.Connect_LoggedOut_NoFacebook_SignUp2_FirstNameTextbox.Value.Length > 20)
{
View.Connect_LoggedOut_NoFacebook_SignUp2_ErrorLabel.InnerHTML = "First name is too long";
return;
}
if (View.Connect_LoggedOut_NoFacebook_SignUp2_LastNameTextbox.Value.Length > 20)
{
View.Connect_LoggedOut_NoFacebook_SignUp2_ErrorLabel.InnerHTML = "Last name is too long";
return;
}
#endregion
#region Check nickname
if (View.Connect_LoggedOut_NoFacebook_SignUp2_NicknameTextbox.Value.Length == 0)
{
View.Connect_LoggedOut_NoFacebook_SignUp2_ErrorLabel.InnerHTML = "Enter a nickname";
return;
}
if (View.Connect_LoggedOut_NoFacebook_SignUp2_NicknameTextbox.Value.Length < 2)
{
View.Connect_LoggedOut_NoFacebook_SignUp2_ErrorLabel.InnerHTML = "Nickname must be longer";
return;
}
if (View.Connect_LoggedOut_NoFacebook_SignUp2_NicknameTextbox.Value.Length > 20)
{
View.Connect_LoggedOut_NoFacebook_SignUp2_ErrorLabel.InnerHTML = "Nickname is too long";
return;
}
#endregion
#region Check date of birth
if (int.Parse(View.Connect_LoggedOut_NoFacebook_SignUp2_DateOfBirthYearDropDown.Value) < 0 ||
int.Parse(View.Connect_LoggedOut_NoFacebook_SignUp2_DateOfBirthMonthDropDown.Value) < 0 ||
int.Parse(View.Connect_LoggedOut_NoFacebook_SignUp2_DateOfBirthDayDropDown.Value) < 0)
{
View.Connect_LoggedOut_NoFacebook_SignUp2_ErrorLabel.InnerHTML = "Enter your date of birth";
return;
}
Date d = new Date();
d.SetFullYear(int.Parse(View.Connect_LoggedOut_NoFacebook_SignUp2_DateOfBirthYearDropDown.Value));
d.SetMonth(int.Parse(View.Connect_LoggedOut_NoFacebook_SignUp2_DateOfBirthMonthDropDown.Value));
d.SetDate(int.Parse(View.Connect_LoggedOut_NoFacebook_SignUp2_DateOfBirthDayDropDown.Value));
if (d.GetFullYear() != int.Parse(View.Connect_LoggedOut_NoFacebook_SignUp2_DateOfBirthYearDropDown.Value) ||
d.GetMonth() != int.Parse(View.Connect_LoggedOut_NoFacebook_SignUp2_DateOfBirthMonthDropDown.Value) ||
d.GetDate() != int.Parse(View.Connect_LoggedOut_NoFacebook_SignUp2_DateOfBirthDayDropDown.Value))
{
View.Connect_LoggedOut_NoFacebook_SignUp2_ErrorLabel.InnerHTML = "Check your date of birth";
return;
}
#endregion
#region Check sex
if (!View.Connect_LoggedOut_NoFacebook_SignUp2_SexMaleRadio.Checked && !View.Connect_LoggedOut_NoFacebook_SignUp2_SexFemaleRadio.Checked)
{
View.Connect_LoggedOut_NoFacebook_SignUp2_ErrorLabel.InnerHTML = "Enter your sex";
return;
}
#endregion
#region Check nickname
int thisAsyncOperation = RegisterStartAsync("Checking nickname...");
Server.GetUniqueNickName(
View.Connect_LoggedOut_NoFacebook_SignUp2_NicknameTextbox.Value,
NoFacebookSignUp2PanelLoginUsrK,
new Response(
delegate(Dictionary<object, object> response)
{
if (RegisterEndAsync(thisAsyncOperation))
return;
if (U.isTrue(response, "Exception"))
{
showError(7, "Internal server error");
//.........這裏部分代碼省略.........