当前位置: 首页>>代码示例>>C#>>正文


C# Date.GetFullYear方法代码示例

本文整理汇总了C#中System.Date.GetFullYear方法的典型用法代码示例。如果您正苦于以下问题:C# Date.GetFullYear方法的具体用法?C# Date.GetFullYear怎么用?C# Date.GetFullYear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Date的用法示例。


在下文中一共展示了Date.GetFullYear方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: add_View_Connect_LoggedOut_NoFacebook_SignUp2Panel

		Element add_View_Connect_LoggedOut_NoFacebook_SignUp2Panel()
		{
			#region LoggedOut_NoFacebook_SignUp2Panel
			string s = @"
<div id=""{ClientID}Connect_LoggedOut_NoFacebook_SignUp2Panel"" class=""LoginPanel"" style=""display:none;"">
	<div class=""LoginPanelInner"">
		<p class=""LoginPanelTitle"">
			Enter your details...
		</p>
		<p style=""position:relative; height:25px; line-height:25px;"">
			Real name:
			<input id=""{ClientID}Connect_LoggedOut_NoFacebook_SignUp2_FirstNameTextbox"" type=""text"" style=""padding-left:5px; height:20px; left:140px; top:0px; position:absolute; width:100px; height:25px; line-height:25px;"" />
			<input id=""{ClientID}Connect_LoggedOut_NoFacebook_SignUp2_LastNameTextbox"" type=""text"" style=""padding-left:5px; height:20px; left:250px; top:0px; position:absolute; width:100px; height:25px; line-height:25px;"" />
		</p>
		<p style=""position:relative; height:25px; line-height:25px;"">
			Nickname:
			<input id=""{ClientID}Connect_LoggedOut_NoFacebook_SignUp2_NicknameTextbox"" type=""text"" style=""padding-left:5px; height:20px; left:140px; top:0px; position:absolute; width:210px; height:25px; line-height:25px;"" />
		</p>
		<p style=""position:relative; height:25px; line-height:25px;"">
			Date of birth:
			<span style=""left:140px; top:0px; position:absolute;"">
				<select id=""{ClientID}Connect_LoggedOut_NoFacebook_SignUp2_DateOfBirthDayDropDown"" class=""xui-state-default ui-corner-all"" style=""padding-left:5px; height:25px; line-height:25px;""></select>
				<select id=""{ClientID}Connect_LoggedOut_NoFacebook_SignUp2_DateOfBirthMonthDropDown"" class=""xui-state-default ui-corner-all"" style=""padding-left:5px; height:25px; line-height:25px;""></select>
				<select id=""{ClientID}Connect_LoggedOut_NoFacebook_SignUp2_DateOfBirthYearDropDown"" class=""xui-state-default ui-corner-all"" style=""padding-left:5px; height:25px; line-height:25px;""></select>
			</span>
		</p>
		<p style=""position:relative; height:25px; line-height:25px;"">
			Sex:
			<span style=""left:140px; top:0px; position:absolute;"">
				<input id=""{ClientID}Connect_LoggedOut_NoFacebook_SignUp2_SexMaleRadio"" type=""radio"" name=""{ClientID}Connect_LoggedOut_NoFacebook_SignUp1_Sex"" />
				<label for=""{ClientID}Connect_LoggedOut_NoFacebook_SignUp2_SexMaleRadio""> Male</label>
				<input id=""{ClientID}Connect_LoggedOut_NoFacebook_SignUp2_SexFemaleRadio"" type=""radio"" name=""{ClientID}Connect_LoggedOut_NoFacebook_SignUp1_Sex"" />
				<label for=""{ClientID}Connect_LoggedOut_NoFacebook_SignUp2_SexFemaleRadio""> Female</label>
			</span>
		</p>
		<p style=""position:relative; height:25px; line-height:25px;"">
			<button id=""{ClientID}Connect_LoggedOut_NoFacebook_SignUp2_SaveButton"" class=""ui-state-default ui-corner-all Pointer BigButton"" style=""left:140px; top:0px; position:absolute; width:50px;"">Save</button>
			<span id=""{ClientID}Connect_LoggedOut_NoFacebook_SignUp2_ErrorLabel"" class=""ForegroundAttentionRed"" style=""left:200px; position:absolute; font-weight:bold; top:7px;""></span>
		</p>
	</div>
	<p style=""position:relative;"">
		<button id=""{ClientID}Connect_LoggedOut_NoFacebook_SignUp2_BackButton"" class=""ui-state-default ui-corner-all Pointer SmallButton"" style=""float:left; position:absolute; left:0px;"">Back</button>

		<button id=""{ClientID}Connect_LoggedOut_NoFacebook_SignUp2_CancelButton"" class=""ui-state-default ui-corner-all Pointer SmallButton"" style=""float:right;"">Cancel</button>
	</p>
</div>
";
			addChild(s);
			#endregion

			jQuery.FromElement(View.Connect_LoggedOut_NoFacebook_SignUp2_FirstNameTextbox).Keyup(new jQueryEventHandler(noFacebookSignup2NameKeyUp));
			jQuery.FromElement(View.Connect_LoggedOut_NoFacebook_SignUp2_LastNameTextbox).Keyup(new jQueryEventHandler(noFacebookSignup2NameKeyUp));
			jQuery.FromElement(View.Connect_LoggedOut_NoFacebook_SignUp2_NicknameTextbox).Keyup(new jQueryEventHandler(noFacebookSignup2NicknameKeyUp));
			jQuery.FromElement(View.Connect_LoggedOut_NoFacebook_SignUp2_CancelButton).Click(new jQueryEventHandler(cancelButtonClick));
			jQuery.FromElement(View.Connect_LoggedOut_NoFacebook_SignUp2_BackButton).Click(new jQueryEventHandler(noFacebookSignup2BackClick));
			jQuery.FromElement(View.Connect_LoggedOut_NoFacebook_SignUp2_SaveButton).Click(new jQueryEventHandler(noFacebookSignup2SaveClick));

			#region add date dropdown options
			if (View.Connect_LoggedOut_NoFacebook_SignUp2_DateOfBirthDayDropDown.Options.Length == 0)
			{
				addOption("-1", "", View.Connect_LoggedOut_NoFacebook_SignUp2_DateOfBirthDayDropDown);
				for (int i = 1; i <= 31; i++)
					addOption(i.ToString(), i.ToString(), View.Connect_LoggedOut_NoFacebook_SignUp2_DateOfBirthDayDropDown);
			}

			if (View.Connect_LoggedOut_NoFacebook_SignUp2_DateOfBirthMonthDropDown.Options.Length == 0)
			{
				addOption("-1", "", View.Connect_LoggedOut_NoFacebook_SignUp2_DateOfBirthMonthDropDown);
				string[] months = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
				for (int i = 0; i < months.Length; i++)
					addOption(i.ToString(), months[i], View.Connect_LoggedOut_NoFacebook_SignUp2_DateOfBirthMonthDropDown);
			}

			if (View.Connect_LoggedOut_NoFacebook_SignUp2_DateOfBirthYearDropDown.Options.Length == 0)
			{
				addOption("-1", "", View.Connect_LoggedOut_NoFacebook_SignUp2_DateOfBirthYearDropDown);
				Date t = new Date();
				int year = t.GetFullYear();
				for (int i = year; i > year - 100; i--)
					addOption(i.ToString(), i.ToString(), View.Connect_LoggedOut_NoFacebook_SignUp2_DateOfBirthYearDropDown);
			}
			#endregion

			defaultButton(View.Connect_LoggedOut_NoFacebook_SignUp2_FirstNameTextbox, View.Connect_LoggedOut_NoFacebook_SignUp2_SaveButton);
			defaultButton(View.Connect_LoggedOut_NoFacebook_SignUp2_LastNameTextbox, View.Connect_LoggedOut_NoFacebook_SignUp2_SaveButton);
			defaultButton(View.Connect_LoggedOut_NoFacebook_SignUp2_NicknameTextbox, View.Connect_LoggedOut_NoFacebook_SignUp2_SaveButton);

			return View.Connect_LoggedOut_NoFacebook_SignUp2Panel;
		}
开发者ID:davelondon,项目名称:dontstayin,代码行数:89,代码来源:Login.Controller.cs

示例2: 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");
//.........这里部分代码省略.........
开发者ID:davelondon,项目名称:dontstayin,代码行数:101,代码来源:Login.Controller.cs

示例3: UpdateClock

        public static void UpdateClock()
        {
            if (syncToClock)
            {
                Date justNow = Date.Now;

                if (timeRate != 1.0)
                {
                    int ts = justNow.GetTime() - last.GetTime();
                    int ticks = (int)(ts * timeRate);
                    offset += ticks;
                }
                last = justNow;
                try
                {
                    //now = new Date(justNow.GetTime());
                    now = new Date(justNow.GetTime() + offset);

                }
                catch
                {
                    now = new Date(1, 12, 25, 23, 59, 59);
                    offset = now - Date.Now;
                }

                if (now.GetFullYear() > 4000)
                {
                    now = new Date(4000, 12, 31, 23, 59, 59);
                    offset = now - Date.Now;
                }

                if (now.GetFullYear() < 1)
                {
                    now = new Date(0, 12, 25, 23, 59, 59);
                    offset = now - Date.Now;
                }

            }
        }
开发者ID:spamarti,项目名称:wwt-web-client,代码行数:39,代码来源:SpaceTimeController.cs


注:本文中的System.Date.GetFullYear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。