/// <summary>
        ///
        /// </summary>
        /// <param name="oHostSecurityToken"></param>
        /// <param name="collectionRequest"></param>
        /// <param name="criteria"></param>
        /// <returns></returns>
        public CourtTypeReturnValue CourtTypeSearch(HostSecurityToken oHostSecurityToken, CollectionRequest collectionRequest,
                                                    CourtTypeSearchCriteria criteria)
        {
            CourtTypeReturnValue returnValue = null;

            if (Functions.ValidateIWSToken(oHostSecurityToken))
            {
                oTimeService = new TimeService();
                returnValue  = oTimeService.CourtTypeSearch(Functions.GetLogonIdFromToken(oHostSecurityToken), collectionRequest, criteria);
            }
            else
            {
                returnValue         = new CourtTypeReturnValue();
                returnValue.Success = false;
                returnValue.Message = "Invalid Token";
            }
            return(returnValue);
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="oHostSecurityToken"></param>
 /// <param name="collectionRequest"></param>
 /// <param name="criteria"></param>
 /// <returns></returns>
 public CourtTypeReturnValue CourtTypeSearch(HostSecurityToken oHostSecurityToken, CollectionRequest collectionRequest,
                                             CourtTypeSearchCriteria criteria)
 {
     CourtTypeReturnValue returnValue = null;
     if (Functions.ValidateIWSToken(oHostSecurityToken))
     {
         oTimeService = new TimeService();
         returnValue = oTimeService.CourtTypeSearch(Functions.GetLogonIdFromToken(oHostSecurityToken), collectionRequest, criteria);
     }
     else
     {
         returnValue = new CourtTypeReturnValue();
         returnValue.Success = false;
         returnValue.Message = "Invalid Token";
     }
     return returnValue;
 }
        /// <summary>
        /// Gets the court types.
        /// </summary>
        private void GetCourtTypes()
        {
            TimeServiceClient timeService = null;
            try
            {
                timeService = new TimeServiceClient();
                CollectionRequest collectionRequest = new CollectionRequest();
                CourtTypeSearchCriteria searchCriteria = new CourtTypeSearchCriteria();
                searchCriteria.IncludeArchived = false;
                CourtTypeReturnValue returnValue = timeService.CourtTypeSearch(_logonSettings.LogonId, collectionRequest
                                                                                    , searchCriteria);

                if (returnValue.Success)
                {
                    _ddlCourtType.DataSource = returnValue.CourtTypes.Rows;
                    _ddlCourtType.DataTextField = "Description";
                    _ddlCourtType.DataValueField = "Id";
                    _ddlCourtType.DataBind();
                }
                else
                {
                    throw new Exception(returnValue.Message);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (timeService != null)
                {
                    if (timeService.State != System.ServiceModel.CommunicationState.Faulted)
                        timeService.Close();
                }
            }
        }