private void CreateZone()
        {
            string ZoneName    = base.GetStringProperty(Constants.SOProperties.WorkingHoursConfiguration.ZoneName, true);
            string Description = base.GetStringProperty(Constants.SOProperties.WorkingHoursConfiguration.Description);
            int    GmtOffSet   = base.GetIntProperty(Constants.SOProperties.WorkingHoursConfiguration.GMTOffset, true);
            bool   DefaultZone = base.GetBoolProperty(Constants.SOProperties.WorkingHoursConfiguration.DefaultZone);

            WorkflowManagementServer mngServer = new WorkflowManagementServer();

            using (mngServer.CreateConnection())
            {
                mngServer.Open(BaseAPIConnectionString);

                if (!Helper.SpecialCharactersExist(ZoneName))
                {
                    throw new ApplicationException(Constants.ErrorMessages.SpecialCharactersAreNotAllowed);
                }
                else if (mngServer.ZoneExists(ZoneName))
                {
                    throw new ApplicationException(Constants.ErrorMessages.ZoneExists + ZoneName + ".");
                }
                else if (GmtOffSet > 13 || GmtOffSet < -13)
                {
                    throw new ApplicationException(Constants.ErrorMessages.GMTOffSetValidationFailed);
                }
                else
                {
                    AvailabilityZone aZone = new AvailabilityZone();
                    aZone.ZoneName        = ZoneName;
                    aZone.ID              = Guid.NewGuid();
                    aZone.ZoneDescription = Description;
                    aZone.ZoneGMTOffset   = GmtOffSet;
                    aZone.DefaultZone     = DefaultZone;

                    mngServer.ZoneCreateNew(aZone);
                }
            }
        }
        private void CreateZone()
        {
            string ZoneName = base.GetStringProperty(Constants.SOProperties.WorkingHoursConfiguration.ZoneName, true);
            string Description = base.GetStringProperty(Constants.SOProperties.WorkingHoursConfiguration.Description);
            int GmtOffSet = base.GetIntProperty(Constants.SOProperties.WorkingHoursConfiguration.GMTOffset, true);
            bool DefaultZone = base.GetBoolProperty(Constants.SOProperties.WorkingHoursConfiguration.DefaultZone);

            WorkflowManagementServer mngServer = new WorkflowManagementServer();
            using (mngServer.CreateConnection())
            {
                mngServer.Open(BaseAPIConnectionString);

                if (!Helper.SpecialCharactersExist(ZoneName))
                {
                    throw new ApplicationException(Constants.ErrorMessages.SpecialCharactersAreNotAllowed);
                }
                else if (mngServer.ZoneExists(ZoneName))
                {
                    throw new ApplicationException(Constants.ErrorMessages.ZoneExists + ZoneName + ".");
                }
                else if (GmtOffSet > 13 || GmtOffSet < -13)
                {
                    throw new ApplicationException(Constants.ErrorMessages.GMTOffSetValidationFailed);
                }
                else
                {
                    AvailabilityZone aZone = new AvailabilityZone();
                    aZone.ZoneName = ZoneName;
                    aZone.ID = Guid.NewGuid();
                    aZone.ZoneDescription = Description;
                    aZone.ZoneGMTOffset = GmtOffSet;
                    aZone.DefaultZone = DefaultZone;

                    mngServer.ZoneCreateNew(aZone);
                }
            }
        }