Beispiel #1
0
        /// <summary>
        /// Valid first step (Company info and module)
        /// </summary>
        /// <returns>Empty string if valid, otherwise the appropriate error message</returns>
        private string ValidPnlInfo()
        {
            // Company Name Validation
            ThirdPartyCompanyName = txtCompanyName.Text.Trim();
            if (string.IsNullOrEmpty(ThirdPartyCompanyName))
            {
                return(Resources.CompanyNameInvalid);
            }

            // Module ID Validation
            ThirdPartyApplicationId = txtApplicationID.Text.Trim().ToUpper();
            if (string.IsNullOrEmpty(ThirdPartyApplicationId) || ThirdPartyApplicationId.Contains(" "))
            {
                return(Resources.ModuleIdInvalid);
            }

            // Namespace Validation
            CompanyNamespace = txtNamespace.Text.Trim();
            if (string.IsNullOrEmpty(CompanyNamespace) || CompanyNamespace.Contains(" "))
            {
                return(Resources.NamespaceInvalid);
            }

            return(string.Empty);
        }
        /// <summary> Valid Settings </summary>
        /// <returns>True if settings are valid otherwise false</returns>
        private bool ValidSettings()
        {
            // Company Name Validation
            ThirdPartyCompanyName = txtCompanyName.Text.Trim();
            if (string.IsNullOrEmpty(ThirdPartyCompanyName))
            {
                DisplayMessage(Resources.CompanyNameInvalid, MessageBoxIcon.Error);
                return(false);
            }

            // Module ID Validation
            ThirdPartyApplicationId = txtApplicationID.Text.Trim().ToUpper();
            if (string.IsNullOrEmpty(ThirdPartyApplicationId) || ThirdPartyApplicationId.Contains(" "))
            {
                DisplayMessage(Resources.ModuleIdInvalid, MessageBoxIcon.Error);
                return(false);
            }

            // Namespace Validation
            CompanyNamespace = txtNamespace.Text.Trim();
            if (string.IsNullOrEmpty(CompanyNamespace) || CompanyNamespace.Contains(" "))
            {
                DisplayMessage(Resources.NamespaceInvalid, MessageBoxIcon.Error);
                return(false);
            }

            // Kendo License Validation
            KendoFolder = txtKendoFolder.Text.Trim();
            if (!chkKendoLicense.Checked)
            {
                DisplayMessage(Resources.KendoLicenseInvalid, MessageBoxIcon.Error);
                return(false);
            }

            // Kendo Folder Validation
            if (string.IsNullOrEmpty(KendoFolder))
            {
                DisplayMessage(Resources.KendoFolderInvalid, MessageBoxIcon.Error);
                return(false);
            }

            // Valid
            return(true);
        }