示例#1
0
        /// <summary>
        /// Get instance of CapacityService Object
        /// </summary>
        /// <returns></returns>
        public static ICapacityService GetService()
        {
            if (!RightNowConfigService.IsConfigured())
            {
                return(null);
            }
            CapacityService service = null;

            try
            {
                string endPointUrl = RightNowConfigService.GetConfigValue(RightNowConfigKeyNames.ToaCapacityServiceUrl);
                service = new CapacityService();
                service._toaCapacityInterface = new toa_capacity_interface(endPointUrl);
                service._log = ToaLogService.GetLog();
            }
            catch (Exception e)
            {
                service = null;
                service._log.Error("Unable to create CapacityService Object");
                service._log.Error("Exception: " + e.StackTrace);
                MessageBox.Show(ToaExceptionMessages.CapacityServiceNotInitialized, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            return(service);
        }
        /// <summary>
        /// Get instance of CapacityService Object
        /// </summary>
        /// <returns></returns>
        public static ICapacityService GetService()
        {
            if (!RightNowConfigService.IsConfigured())
            {
                return null;
            }
            CapacityService service = null;
            try
            {
                string endPointUrl = RightNowConfigService.GetConfigValue(RightNowConfigKeyNames.ToaCapacityServiceUrl);
                service = new CapacityService();
                service._toaCapacityInterface = new toa_capacity_interface(endPointUrl);
                service._log = ToaLogService.GetLog();
            }
            catch (Exception e)
            {
                service = null;
                service._log.Error("Unable to create CapacityService Object");
                service._log.Error("Exception: " + e.StackTrace);
                MessageBox.Show(ToaExceptionMessages.CapacityServiceNotInitialized, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            return service;
        }