Exemplo n.º 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);
        }
Exemplo n.º 2
0
        public static DateTime GetDateTimeViewState(StateBag viewState, string fieldName, DateTime defaultValue)
        {
            DateTime?returnValue = WebFormsHelper.GetDateTimeViewState(viewState, fieldName);

            return(returnValue.GetValueOrDefault(defaultValue));
        }
Exemplo n.º 3
0
 protected DateTime GetDateTimeViewState(string fieldName, DateTime defaultValue)
 {
     return(WebFormsHelper.GetDateTimeViewState(this.ViewState, fieldName, defaultValue));
 }
Exemplo n.º 4
0
 protected DateTime?GetDateTimeViewState(string fieldName)
 {
     return(WebFormsHelper.GetDateTimeViewState(this.ViewState, fieldName));
 }