示例#1
0
        public static DateTime GetRequiredDateTimeViewState(StateBag viewState, string fieldName)
        {
            DateTime?returnValue = WebFormsHelper.GetDateTimeViewState(viewState, fieldName);

            if (!returnValue.HasValue)
            {
                throw new Exception(string.Format("Missing required ViewState DateTime value \"{0}\"", fieldName));
            }
            return(returnValue.Value);
        }
示例#2
0
        public static DateTime GetDateTimeViewState(StateBag viewState, string fieldName, DateTime defaultValue)
        {
            DateTime?returnValue = WebFormsHelper.GetDateTimeViewState(viewState, fieldName);

            return(returnValue.GetValueOrDefault(defaultValue));
        }
示例#3
0
 protected DateTime GetDateTimeViewState(string fieldName, DateTime defaultValue)
 {
     return(WebFormsHelper.GetDateTimeViewState(this.ViewState, fieldName, defaultValue));
 }
示例#4
0
 protected DateTime?GetDateTimeViewState(string fieldName)
 {
     return(WebFormsHelper.GetDateTimeViewState(this.ViewState, fieldName));
 }