コード例 #1
0
 public string SaveLicense(LicenseFeaturesParams p)
 {
     try
     {
         LicenseService.SaveLicense(p);
         return("Success");
     }
     catch (Exception ex)
     {
         return(string.Format("Error: {0}{1}{2}", ex.Message, Environment.NewLine, ex.InnerException.ToString()));
     }
 }
コード例 #2
0
        private void btnGenerate_Click(object sender, EventArgs e)
        {
            //generate non activated license file
            if (this.currentLicenseId >= 0)
            {
                LicenseFeaturesParams p = licenseService.GetLicenseFeatureParams(this.currentLicenseId);

                LicenseUtility.GenerateLicense(p);
            }
            else
            {
                MessageBox.Show("Please save current license, or load a license before generating a license file.", "Error");
            }
        }
コード例 #3
0
 public string CreateLicense(LicenseFeaturesParams p)
 {
     try
     {
         return(LicenseService.CreateLicense(p).ToString());
     }
     catch (DuplicateKeyException)
     {
         return(string.Format("Error, cannot insert duplicate License Key: {0}", p.LicenseKey));
     }
     catch (Exception ex)
     {
         return(string.Format("Error: {0}", ex.Message));
     }
 }
コード例 #4
0
        private static void loadLicense(LicenseFeaturesParams p, com.licensemanager4web.Activation a)
        {
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ActivationCode"]                     = "";
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["AddNewCollectionAvailable"]          = p.AddNewCollection.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["AddNewReportAvailable"]              = p.AddNewReport.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["AddUsersAvailable"]                  = p.AddUsers.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["AdministratorPassword"]              = p.AdministratorPassword;
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["AdvancedMenuAvailable"]              = p.AdvancedMenuAvailable.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["AMWTAvailable"]                      = p.EnterLogSheetData.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["CloneReportAvailable"]               = p.Clone.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ConfiguratorAvailable"]              = p.ConfiguratorInstalled.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ConfigureDaypartEntryAvailable"]     = p.ConfigureDaypartEntry.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ConfigureDispositionEntryAvailable"] = p.ConfigureDispositionEntry.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ConfigurePrePostEntryAvailable"]     = p.ConfigurePrePostEntry.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ConfigureStationEntryAvailable"]     = p.ConfigureStationEntry.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["CPU_ID"] = "";
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["DaypartEntryAvailable"]        = p.DaypartEntry.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["DefaultUserLevel"]             = p.DefaultUserLevel.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["DispositionEntryAvailable"]    = p.DispositionEntry.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["EnterFinancialsAvailable"]     = p.EnterFinancialsAvailable.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["EnterSWATNotesAvailable"]      = p.EnterSWATNotesAvailable.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ExpirationDate"]               = p.ExpirationDate.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ExpirationWarningsBeginDate"]  = p.ExpirationWarningStartDate.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ExpirationWarningsMode"]       = p.ExpirationWarningsMode.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ExpirationWarningsFrequency"]  = p.ExpirationWarningsFrequency.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ExpirationWarningsUnit"]       = p.ExpirationWarningsUnit;
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["FoodCostAdjustmentsAvailable"] = p.FoodCostAdjustments.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["FoodWasteClassAllowed"]        = p.AllowedWasteClassses.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ImportWasteDataAvailable"]     = p.ImportWasteData.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["LicenseType"] = p.LicenseType.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ManageBaselinesAvailable"]    = p.ManageBaselines.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ManageDETsAvailable"]         = p.ManageDataEntryTemplates.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ManageEventClientsAvailable"] = p.ManageEventClients.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ManageEventOrdersAvailable"]  = p.ManageEventOrders.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ManageLogFormsAvailable"]     = p.ManageLogForms.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ManagePreferencesAvailable"]  = p.ManagePreferences.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ManageReportsAvailable"]      = p.ManageReportsSettingsShortcut.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ManageSitesAvailable"]        = p.ManageSites.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ManageTrackersAvailable"]     = p.ManageTrackers.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ManagerPassword"]             = p.ManagerPassword;
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ManageTypesAvailable"]        = p.ManageTypesAvailable.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["MaxNumberofFoodTypes"]        = p.FoodTypeLimit.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["MaxNumberofLossTypes"]        = p.LossTypeLimit.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["MaxNumberofSites"]            = p.NumberOfSites.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["MaxNumberofTrackers"]         = p.TrackerLimit.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["MaxNumberofUserTypes"]        = p.UserTypeLimit.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["MaxNumberofDETs"]             = p.DetLimits.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["MaxNumberofReports"]          = p.ReportLimits.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["PrePostEntryAvailable"]       = p.PrePostEntry.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ProductType"] = p.Product.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["RecurringTransactionsAvailable"] = p.RecurringTransactionsAvailable.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["RemoveUsersAvailable"]           = p.RemoveUsers.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ShowSupportEmailAddress"]        = p.ShowSupportEmailAddress.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ShowSupportPhoneNumber"]         = p.ShowSupportPhoneNumber.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ShowSupportWebsite"]             = p.ShowSupportWebSiteURL.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["StationEntryAvailable"]          = p.StationEntry.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["SupportEmailAddress"]            = p.SupportEmailAddress;
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["SupportPhoneNumber"]             = p.SupportPhoneNumber;
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["UpdateTrackerAvailable"]         = p.UpdateTracker.ToString();
            ///**************
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ClientID"]           = p.ClientID.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ClientName"]         = p.ClientName;
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["Generatedby"]        = p.GeneratedBy;
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["GeneratedDate"]      = p.GeneratedDate.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["IsActivated"]        = "False";
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["LicenseID"]          = p.LicenseKey;
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["LicenseRecordID"]    = p.LicenseID.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ProductVersionName"] = p.ProductVersionName;
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["SiteID"]             = p.SiteID.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["SiteName"]           = p.SiteName;
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["SupportWebsite"]     = p.SupportWebSiteURL;
            //VWA4Common.Security.LicenseUtility.GetLicenseUtility()["Create/Save New Reports"] = p.AddNewReport.ToString();

            if (a != null)
            {
                VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ActivationCode"] = a.ActivationCode;
                VWA4Common.Security.LicenseUtility.GetLicenseUtility()["IsActivated"]    = a.IsActivated.ToString();
                VWA4Common.Security.LicenseUtility.GetLicenseUtility()["CPU_ID"]         = a.CPUID.ToString();
                VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ExpirationDate"] = p.ExtendedExpirationDate.ToString();
            }
        }
コード例 #5
0
 public static void LoadLicense(LicenseFeaturesParams p, com.licensemanager4web.Activation a)
 {
     LicenseManager.loadLicense(p, a);
 }
コード例 #6
0
 public static void LoadLicense(LicenseFeaturesParams p)
 {
     LicenseManager.loadLicense(p, null);
 }
コード例 #7
0
        private void btnSaveLicenseRecord_Click(object sender, EventArgs e)
        {
            //save license to web service
            LicenseFeaturesParams p = new LicenseFeaturesParams();

            p.LicenseKey = this.txtLicenseSerialNumber.Text;
            p.ClientName = this.ddlClients.Text;
            p.SiteName   = this.ddlSites.Text;
            p.ClientID   = this.ddlClients.SelectedItem != null?Convert.ToInt32((this.ddlClients.SelectedItem as Client).ID) : -1;

            p.SiteID = this.ddlSites.SelectedItem != null?Convert.ToInt32((this.ddlSites.SelectedItem as Site).ID) : -1;

            p.GeneratedBy                 = this.txtGeneratedBy.Text;
            p.GeneratedDate               = DateTime.Now;
            p.LicenseType                 = this.rbCPULic.Checked ? LicenseType.CPU : LicenseType.Site;
            p.ExpirationDate              = this.dtExpirationDate.Value;
            p.ExpirationWarningStartDate  = this.dtExpirationWarningsBeginDate.Value;
            p.ExpirationWarningsMode      = this.getExpirationWarningType();
            p.ExpirationWarningsFrequency = Convert.ToInt32(nmExpirationWarningsFrequency.Value);
            p.ExpirationWarningsUnit      = this.cbExpirationWarningsFrequency.Text;
            p.AllowedWasteClassses        = this.getAllowedWasteClasses();
            p.ProductVersionName          = this.txtProductVersionName.Text;
            p.NumberOfSites               = (int)this.nmNumberOfSites.Value;
            p.DefaultUserLevel            = this.getDefaultUserLevel();
            p.ManagerPassword             = this.txtManagerPassword.Text;
            p.AdministratorPassword       = this.txtAdministratorPassword.Text;
            p.UseConfigurator             = this.chkUseConfiguratorIfInstalled.Checked;
            p.ManageTypesAvailable        = this.chkManageTypesAvailable.Checked;
            p.ManageTrackers              = this.chkManageTrackersAvailable.Checked;
            p.ManageSites                 = this.chkManageSitesAvailable.Checked;
            p.ManageEventTypes            = this.chkManageEventTypes.Checked;
            p.ManageEventClients          = this.chkManageEventClientsAvailable.Checked;
            p.ManageEventOrders           = this.chkManageEventOrdersAvailable.Checked;
            p.ManagePreferences           = this.chkManagePreferencesAvailable.Checked;
            p.ManageBaselines             = this.ChkManageBaselinesAvailable.Checked;
            p.FoodCostAdjustments         = this.chkManageFoodCostAdjustmentsAvailable.Checked;
            p.AddUsers        = this.chkAddUsers.Checked;
            p.RemoveUsers     = this.chkRemoveUsers.Checked;
            p.TrackerLimit    = Convert.ToInt32(this.nmTrackerLimit.Value);
            p.FoodTypeLimit   = Convert.ToInt32(this.nmFoodTypeLimit.Value);
            p.LossTypeLimit   = Convert.ToInt32(this.nmLossTypeLimit.Value);
            p.UserTypeLimit   = Convert.ToInt32(this.nmUserTypeLimit.Value);
            p.UpdateTracker   = this.chkUpdateTrackerAvailable.Checked;
            p.ImportWasteData = this.chkImportDataAvailable.Checked;
            p.RecurringTransactionsAvailable = this.chkManageRecurringTransactionsAvailable.Checked;
            p.ManageDataEntryTemplates       = this.chkIncludeDET.Checked;
            p.ConfigureStationEntry          = this.chkConfigureStationAvailable.Checked;
            p.ConfigureDaypartEntry          = this.chkConfigureDaypartAvailable.Checked;
            p.ConfigureDispositionEntry      = this.chkConfigureDispositionAvailable.Checked;
            p.ConfigurePrePostEntry          = this.chkConfigurePrePostAvailable.Checked;
            p.EnterLogSheetData             = this.chkEnterLogSheetData.Checked;
            p.StationEntry                  = this.chkStationEntryAvailable.Checked;
            p.DaypartEntry                  = this.chkDaypartEntryAvailable.Checked;
            p.DispositionEntry              = this.chkDispositionEntryAvailable.Checked;
            p.PrePostEntry                  = this.chkPrePostEntryAvailable.Checked;
            p.ManageLogForms                = this.chkIncludeManageForms.Checked;
            p.DetLimits                     = Convert.ToInt32(this.nmDETLimit.Value);
            p.AdvancedMenuAvailable         = this.chkAdvancedMenuAvailable.Checked;
            p.EnterFinancialsAvailable      = this.chkEnterMonthlyFinancialsAvailable.Checked;
            p.EnterSWATNotesAvailable       = this.chkEnterSWATNotesAvailable.Checked;
            p.ManageReportsSettingsShortcut = this.chkManageReportSettingsShortcutShown.Checked;
            p.AddNewReport                  = this.chkAddNewReportsAvailable.Checked;
            p.AddNewCollection              = this.chkAddNewReportCollectionAvailable.Checked;
            p.Clone = this.chkCloneReportAvailable.Checked;
            //double "new reports checkbox";
            p.ReportLimits            = Convert.ToInt32(this.nmReportLimits.Value);
            p.ShowSupportEmailAddress = this.chkSupportEmailAddressShown.Checked;
            p.ShowSupportPhoneNumber  = this.chkSupportPhoneNumberShown.Checked;
            p.ShowSupportWebSiteURL   = this.chkSupportWebSiteShown.Checked;
            p.SupportEmailAddress     = this.txtSupportEmailAddress.Text;
            p.SupportPhoneNumber      = this.txtSupportPhoneNumber.Text;
            p.SupportWebSiteURL       = this.txtSupportWebSiteURL.Text;
            p.Product = this.getProduct(cbProduct.SelectedIndex);
            p.ExtendedExpirationDate = p.ExpirationDate;

            string response = string.Empty;

            if (this.currentLicenseId == -1 || this.currentLicenseId == 0)
            {
                string result = licenseService.CreateLicense(p);
                if (Int32.TryParse(result, out this.currentLicenseId))
                {
                    response = "Success";
                }
                else
                {
                    response = result;
                }
            }
            else
            {
                p.LicenseID = this.currentLicenseId;
                response    = licenseService.SaveLicense(p);
            }

            MessageBox.Show(response);
        }
コード例 #8
0
        private void populateForm(bool loadActivations)
        {
            try
            {
                //populate form from selected license id
                LicenseFeaturesParams p = licenseService.GetLicenseFeatureParams(this.currentLicenseId);

                this.ddlClients.Items.Clear();
                this.ddlClients.Items.Add(new Client {
                    ID = p.ClientID, ClientName = p.ClientName
                });
                this.ddlClients.SelectedIndex = 0;

                this.ddlSites.Items.Clear();
                this.ddlSites.Items.Add(new Site {
                    ID = p.SiteID, SiteName = p.SiteName, ClientID = p.ClientID
                });
                this.ddlSites.SelectedIndex = 0;

                this.ulvActivations.Items.Clear();

                this.cbProduct.SelectedIndex = this.setProduct(p.Product);

                if (p.LicenseType.Equals(LicenseType.CPU))
                {
                    rbCPULic.Checked = true;
                }
                else
                {
                    rbSiteLic.Checked = true;
                }
                this.txtGeneratedBy.Text                             = p.GeneratedBy;
                this.lblCreateDate.Text                              = string.Format("{0} {1}", p.GeneratedDate.ToLongDateString(), p.GeneratedDate.ToShortTimeString());
                this.txtLicenseSerialNumber.Text                     = p.LicenseKey;
                this.lblLicenseRecordId.Text                         = p.LicenseID.ToString();
                this.dtExpirationDate.Value                          = p.ExpirationDate;
                this.dtExpirationWarningsBeginDate.Value             = p.ExpirationWarningStartDate;
                this.cbExpirationWarningsMode.SelectedIndex          = (int)p.ExpirationWarningsMode;
                this.nmExpirationWarningsFrequency.Value             = p.ExpirationWarningsFrequency;
                this.cbExpirationWarningsFrequency.SelectedIndex     = this.setFrequency(p.ExpirationWarningsUnit);
                this.cbAllowedWasteClasses.SelectedIndex             = (int)p.AllowedWasteClassses;
                this.txtProductVersionName.Text                      = p.ProductVersionName;
                this.nmNumberOfSites.Value                           = p.NumberOfSites;
                this.cbDefaultUserLevel.SelectedIndex                = (int)p.DefaultUserLevel;
                this.txtManagerPassword.Text                         = p.ManagerPassword;
                this.txtAdministratorPassword.Text                   = p.AdministratorPassword;
                this.chkUseConfiguratorIfInstalled.Checked           = p.UseConfigurator;
                this.chkManageTypesAvailable.Checked                 = p.ManageTypesAvailable;
                this.chkManageTrackersAvailable.Checked              = p.ManageTrackers;
                this.chkManageSitesAvailable.Checked                 = p.ManageSites;
                this.chkManageEventTypes.Checked                     = p.ManageEventTypes;
                this.chkManageEventClientsAvailable.Checked          = p.ManageEventClients;
                this.chkManageEventOrdersAvailable.Checked           = p.ManageEventOrders;
                this.chkManagePreferencesAvailable.Checked           = p.ManagePreferences;
                this.ChkManageBaselinesAvailable.Checked             = p.ManageBaselines;
                this.chkManageFoodCostAdjustmentsAvailable.Checked   = p.FoodCostAdjustments;
                this.chkAddUsers.Checked                             = p.AddUsers;
                this.chkRemoveUsers.Checked                          = p.RemoveUsers;
                this.nmTrackerLimit.Value                            = p.TrackerLimit;
                this.nmFoodTypeLimit.Value                           = p.FoodTypeLimit;
                this.nmLossTypeLimit.Value                           = p.LossTypeLimit;
                this.nmUserTypeLimit.Value                           = p.UserTypeLimit;
                this.chkUpdateTrackerAvailable.Checked               = p.UpdateTracker;
                this.chkImportDataAvailable.Checked                  = p.ImportWasteData;
                this.chkManageRecurringTransactionsAvailable.Checked = p.RecurringTransactionsAvailable;
                this.chkIncludeDET.Checked                           = p.ManageDataEntryTemplates;
                this.chkConfigureStationAvailable.Checked            = p.ConfigureStationEntry;
                this.chkConfigureDaypartAvailable.Checked            = p.ConfigureDaypartEntry;
                this.chkConfigureDispositionAvailable.Checked        = p.ConfigureDispositionEntry;
                this.chkConfigurePrePostAvailable.Checked            = p.ConfigurePrePostEntry;
                this.chkEnterLogSheetData.Checked                    = p.EnterLogSheetData;
                this.chkStationEntryAvailable.Checked                = p.StationEntry;
                this.chkDaypartEntryAvailable.Checked                = p.DaypartEntry;
                this.chkDispositionEntryAvailable.Checked            = p.DispositionEntry;
                this.chkPrePostEntryAvailable.Checked                = p.PrePostEntry;
                this.chkIncludeManageForms.Checked                   = p.ManageLogForms;
                this.nmDETLimit.Value = p.DetLimits;
                this.chkAdvancedMenuAvailable.Checked             = p.AdvancedMenuAvailable;
                this.chkEnterMonthlyFinancialsAvailable.Checked   = p.EnterFinancialsAvailable;
                this.chkEnterSWATNotesAvailable.Checked           = p.EnterSWATNotesAvailable;
                this.chkManageReportSettingsShortcutShown.Checked = p.ManageReportsSettingsShortcut;
                this.chkAddNewReportsAvailable.Checked            = p.AddNewReport;
                this.chkAddNewReportCollectionAvailable.Checked   = p.AddNewCollection;
                this.chkCloneReportAvailable.Checked     = p.Clone;
                this.chkCreateSaveNewReports.Checked     = p.AddNewReport;
                this.nmReportLimits.Value                = p.ReportLimits;
                this.chkSupportEmailAddressShown.Checked = p.ShowSupportEmailAddress;
                this.chkSupportPhoneNumberShown.Checked  = p.ShowSupportPhoneNumber;
                this.chkSupportWebSiteShown.Checked      = p.ShowSupportWebSiteURL;
                this.txtSupportEmailAddress.Text         = p.SupportEmailAddress;
                this.txtSupportPhoneNumber.Text          = p.SupportPhoneNumber;
                this.txtSupportWebSiteURL.Text           = p.SupportWebSiteURL;

                //load activation records
                if (loadActivations)
                {
                    this.populateActivations();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #9
0
ファイル: LicenseUtility.cs プロジェクト: klimkina/CSharp
        private static bool saveLicenseFile(LicenseFeaturesParams p, Activation a)
        {
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ActivationCode"]                     = "";
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["AddNewCollectionAvailable"]          = p.AddNewCollection.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["AddNewReportAvailable"]              = p.AddNewReport.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["AddUsersAvailable"]                  = p.AddUsers.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["AdministratorPassword"]              = p.AdministratorPassword;
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["AdvancedMenuAvailable"]              = p.AdvancedMenuAvailable.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["AMWTAvailable"]                      = p.EnterLogSheetData.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["CloneReportAvailable"]               = p.Clone.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ConfiguratorAvailable"]              = p.UseConfigurator.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ConfigureDaypartEntryAvailable"]     = p.ConfigureDaypartEntry.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ConfigureDispositionEntryAvailable"] = p.ConfigureDispositionEntry.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ConfigurePrePostEntryAvailable"]     = p.ConfigurePrePostEntry.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ConfigureStationEntryAvailable"]     = p.ConfigureStationEntry.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["CPU_ID"] = "";
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["DaypartEntryAvailable"]        = p.DaypartEntry.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["DefaultUserLevel"]             = p.DefaultUserLevel.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["DispositionEntryAvailable"]    = p.DispositionEntry.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["EnterFinancialsAvailable"]     = p.EnterFinancialsAvailable.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["EnterSWATNotesAvailable"]      = p.EnterSWATNotesAvailable.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ExpirationDate"]               = p.ExpirationDate.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ExpirationWarningsBeginDate"]  = p.ExpirationWarningStartDate.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ExpirationWarningsMode"]       = p.ExpirationWarningsMode.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ExpirationWarningsFrequency"]  = p.ExpirationWarningsFrequency.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ExpirationWarningsUnit"]       = p.ExpirationWarningsUnit;
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["FoodCostAdjustmentsAvailable"] = p.FoodCostAdjustments.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["FoodWasteClassAllowed"]        = p.AllowedWasteClassses.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ImportWasteDataAvailable"]     = p.ImportWasteData.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["LicenseType"] = p.LicenseType.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ManageBaselinesAvailable"]    = p.ManageBaselines.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ManageDETsAvailable"]         = p.ManageDataEntryTemplates.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ManageEventClientsAvailable"] = p.ManageEventClients.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ManageEventOrdersAvailable"]  = p.ManageEventOrders.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ManageLogFormsAvailable"]     = p.ManageLogForms.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ManagePreferencesAvailable"]  = p.ManagePreferences.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ManageReportsAvailable"]      = p.ManageReportsSettingsShortcut.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ManageSitesAvailable"]        = p.ManageSites.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ManageTrackersAvailable"]     = p.ManageTrackers.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ManagerPassword"]             = p.ManagerPassword;
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ManageTypesAvailable"]        = p.ManageTypesAvailable.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["MaxNumberofFoodTypes"]        = p.FoodTypeLimit.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["MaxNumberofLossTypes"]        = p.LossTypeLimit.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["MaxNumberofSites"]            = p.NumberOfSites.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["MaxNumberofTrackers"]         = p.TrackerLimit.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["MaxNumberofUserTypes"]        = p.UserTypeLimit.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["MaxNumberofDETs"]             = p.DetLimits.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["MaxNumberofReports"]          = p.ReportLimits.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["PrePostEntryAvailable"]       = p.PrePostEntry.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ProductType"] = p.Product.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["RecurringTransactionsAvailable"] = p.RecurringTransactionsAvailable.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["RemoveUsersAvailable"]           = p.RemoveUsers.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ShowSupportEmailAddress"]        = p.ShowSupportEmailAddress.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ShowSupportPhoneNumber"]         = p.ShowSupportPhoneNumber.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ShowSupportWebsite"]             = p.ShowSupportWebSiteURL.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["StationEntryAvailable"]          = p.StationEntry.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["SupportEmailAddress"]            = p.SupportEmailAddress;
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["SupportPhoneNumber"]             = p.SupportPhoneNumber;
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["UpdateTrackerAvailable"]         = p.UpdateTracker.ToString();
            ///**************
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ClientID"]           = p.ClientID.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ClientName"]         = p.ClientName;
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["Generatedby"]        = p.GeneratedBy;
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["GeneratedDate"]      = p.GeneratedDate.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["IsActivated"]        = "False";
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["LicenseID"]          = p.LicenseKey;
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["LicenseRecordID"]    = p.LicenseID.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ProductVersionName"] = p.ProductVersionName;
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["SiteID"]             = p.SiteID.ToString();
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["SiteName"]           = p.SiteName;
            VWA4Common.Security.LicenseUtility.GetLicenseUtility()["SupportWebsite"]     = p.SupportWebSiteURL;
            //VWA4Common.Security.LicenseUtility.GetLicenseUtility()["Create/Save New Reports"] = p.AddNewReport.ToString();

            if (a != null)
            {
                VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ActivationCode"] = a.ActivationCode;
                VWA4Common.Security.LicenseUtility.GetLicenseUtility()["IsActivated"]    = a.IsActivated.ToString();
                VWA4Common.Security.LicenseUtility.GetLicenseUtility()["CPU_ID"]         = a.CPUID.ToString();
                VWA4Common.Security.LicenseUtility.GetLicenseUtility()["ExpirationDate"] = p.ExtendedExpirationDate.ToString();
            }

            SaveFileDialog dlg = new System.Windows.Forms.SaveFileDialog();

            dlg.InitialDirectory = Application.StartupPath;
            dlg.Filter           = "License files (*.txt)|*.TXT|All files (*.*)|*.*";
            dlg.FileName         = "vw4license.txt";
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                VWA4Common.Security.LicenseUtility.GetLicenseUtility().GenerateLicense(dlg.FileName);
                return(true);
            }
            return(false);
        }
コード例 #10
0
ファイル: LicenseUtility.cs プロジェクト: klimkina/CSharp
 public static bool GenerateLicense(LicenseFeaturesParams p, Activation a)
 {
     return(LicenseUtility.saveLicenseFile(p, a));
 }
コード例 #11
0
ファイル: LicenseUtility.cs プロジェクト: klimkina/CSharp
 public static bool GenerateLicense(LicenseFeaturesParams p)
 {
     return(LicenseUtility.saveLicenseFile(p, null));
 }