Beispiel #1
0
        protected void btnCheck_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(txtKey.Text))
            {
                return;
            }
            bool res = false;

            try
            {
                res = PermissionAccsess.ActiveLic(txtKey.Text, SettingsMain.SiteUrl, SettingsMain.ShopName,
                                                  SettingsGeneral.SiteVersion, SettingsGeneral.SiteVersionDev);
            }
            catch (Exception ex)
            {
                Debug.LogError(ex);
            }
            if (res)
            {
                SettingsLic.ActiveLic = true;
                hlGo.Visible          = true;
                SettingsLic.LicKey    = txtKey.Text;
            }
            else
            {
                SettingsLic.ActiveLic = false;
                lblMsg.Text           = @"key is wrong";
            }
        }
        public new bool Validate()
        {
            if (!(Demo.IsDemoEnabled || TrialService.IsTrialEnabled || SaasDataService.IsSaasEnabled))
            {
                try
                {
                    ActiveLic = PermissionAccsess.ActiveLic(txtKey.Text, txtUrl.Text, txtShopName.Text,
                                                            SettingsGeneral.SiteVersion, SettingsGeneral.SiteVersionDev);
                    SettingsLic.ActiveLic = ActiveLic;
                }
                catch (Exception ex)
                {
                    Debug.LogError(ex, "Error at license check at installer");
                }
                if (!ActiveLic)
                {
                    lblError.Text = Resources.Resource.Install_UserContols_ShopinfoView_Err_WrongKey;
                }
            }

            if (fuLogo.HasFile)
            {
                if (!FileHelpers.CheckFileExtension(Path.GetExtension(fuLogo.FileName), FileHelpers.eAdvantShopFileTypes.Image))
                {
                    lblError.Text = Resource.Admin_CommonSettings_InvalidLogoFormat;
                    return(false);
                }
            }

            if (fuFavicon.HasFile)
            {
                if (!FileHelpers.CheckFileExtension(Path.GetExtension(fuFavicon.FileName), FileHelpers.eAdvantShopFileTypes.Favicon))
                {
                    lblError.Text = Resource.Admin_CommonSettings_InvalidFaviconFormat;
                    return(false);
                }
            }


            var validList = new List <ValidElement>
            {
                new ValidElement()
                {
                    Control    = txtShopName,
                    ErrContent = ErrContent,
                    ValidType  = ValidType.Required,
                    Message    = Resources.Resource.Install_UserContols_ShopinfoView_Err_NeedName
                },
                new ValidElement()
                {
                    Control    = txtUrl,
                    ErrContent = ErrContent,
                    ValidType  = ValidType.Required,
                    Message    = Resources.Resource.Install_UserContols_ShopinfoView_Err_NeedUrl
                }
            };

            return(ValidationHelper.Validate(validList));
        }
 protected void btnCheakLic_Click(object sender, EventArgs e)
 {
     try
     {
         SettingsLic.ActiveLic = PermissionAccsess.ActiveLic(txtLicKey.Text, SettingsMain.SiteUrl,
                                                             SettingsMain.ShopName, SettingsGeneral.SiteVersion, SettingsGeneral.SiteVersionDev);
     }
     catch (Exception ex)
     {
         Debug.LogError(ex, "Error at license check at settings");
     }
     SettingsLic.LicKey = txtLicKey.Text;
     LoadData();
 }
Beispiel #4
0
    protected void btnCheck_Click(object sender, EventArgs e)
    {
        if (string.IsNullOrWhiteSpace(txtKey.Text))
        {
            return;
        }
        var res = PermissionAccsess.ActiveLic(txtKey.Text, SettingsMain.SiteUrl, SettingsMain.ShopName, SettingsGeneral.SiteVersion);

        if (res)
        {
            SettingsLic.ActiveLic = true;
            hlGo.Visible          = true;
            SettingsLic.LicKey    = txtKey.Text;
        }
        else
        {
            SettingsLic.ActiveLic = false;
            lblMsg.Text           = @"key is wrong";
        }
    }
Beispiel #5
0
 protected void btnCheakLic_Click(object sender, EventArgs e)
 {
     SettingsLic.ActiveLic = PermissionAccsess.ActiveLic(txtLicKey.Text, SettingsMain.SiteUrl, SettingsMain.ShopName, SettingsGeneral.SiteVersion);
     SettingsLic.LicKey    = txtLicKey.Text;
     LoadData();
 }