public IHttpActionResult GetDoctors()
        {
            var doctors           = new List <Peers>();
            var allowPeersControl = SharePointRepository.GetConfigValueByKey("AllowPeerChatControl").ToUpper() == "TRUE"
          ? true
          : false;

            if (allowPeersControl)
            {
                doctors = SharePointRepository.GetDoctorsByDepartment("HealthCare");
            }

            return(Ok(doctors));
        }
Пример #2
0
        /// <summary>
        /// Gets the configuration value by key.
        /// </summary>
        /// <param name="key">The key.</param>
        /// <returns>returns configuration key.</returns>
        public static string GetConfigurationValueByKey(string key)
        {
            string returnValue = null;

            try
            {
                returnValue = SharePointRepository.GetConfigValueByKey(key);
            }
            catch (Exception)
            {
                throw;
            }

            return(returnValue);
        }
        public IHttpActionResult CheckTimeOfJoiningMeeting(string itemId, int offsetTime)
        {
            var IsRestrictTimeOfJoiningEnabled = SharePointRepository.GetConfigValueByKey("TimeOfJoiningCall");

            if (IsRestrictTimeOfJoiningEnabled.ToUpper() == "TRUE")
            {
                var dtStart = SharePointRepository.GetStartDateOfMeeting(itemId);
                var span    = dtStart - DateTime.UtcNow.AddHours(8).AddMinutes(-offsetTime);
                if (span.TotalMinutes > 30)
                {
                    return(Ok(false));;
                }
            }

            return(Ok(true));;
        }