public static SelectList ExternalSearchLevelEnumsDropDown(ExternalSearchLevelEnum level)
        {
            var enumList = (from ExternalSearchLevelEnum bt in Enum.GetValues(typeof(ExternalSearchLevelEnum))
                            select new
            {
                Id = bt,
                Name = EnumHelpers.GetDescription((ExternalSearchLevelEnum)bt)
            });

            return(new SelectList(enumList, "Id", "Name", level));
        }
Example #2
0
        public static AppUserSettings CreateAppUserSettings(Guid appUserId,
                                                            int?campaignDashboardMaxDistance,
                                                            double?campaignDashboardMaxAge,
                                                            int?requiredListingDashboardMaxDistance,
                                                            double?requiredListingDashboardMaxAge,
                                                            int?availableListingDashboardMaxDistance,
                                                            double?availableListingDashboardMaxAge,
                                                            ExternalSearchLevelEnum campaignDashboardExternalSelectionLevel,
                                                            ExternalSearchLevelEnum requiredListingDashboardtExternalSelectionLevel,
                                                            ExternalSearchLevelEnum availableListingDashboardExternalSelectionLevel,
                                                            bool campaignGeneralInfoDisplayMyUserListings,
                                                            bool campaignGeneralInfoDisplayMyBranchListings,
                                                            bool campaignGeneralInfoDisplayMyCompanyListings,
                                                            bool campaignGeneralInfoDisplayBlockedListings,
                                                            int?campaignGeneralInfoMaxDistance,
                                                            bool requiredListingGeneralInfoDisplayMyUserListings,
                                                            bool requiredListingGeneralInfoDisplayMyBranchListings,
                                                            bool requiredListingGeneralInfoDisplayMyCompanyListings,
                                                            bool requiredListingGeneralInfoDisplayBlockedListings,
                                                            int?requiredListingGeneralInfoMaxDistance,
                                                            bool availableListingGeneralInfoDisplayMyUserListings,
                                                            bool availableListingGeneralInfoDisplayMyBranchListings,
                                                            bool availableListingGeneralInfoDisplayMyCompanyListings,
                                                            bool availableListingGeneralInfoDisplayBlockedListings,
                                                            int?availableListingGeneralInfoMaxDistance,
                                                            ExternalSearchLevelEnum campaignGeneralInfoExternalSelectionLevel,
                                                            ExternalSearchLevelEnum requiredListingGeneralInfoExternalSelectionLevel,
                                                            ExternalSearchLevelEnum availableListingGeneralInfoExternalSelectionLevel,
                                                            InternalSearchLevelEnum campaignManageViewInternalSelectionLevel,
                                                            InternalSearchLevelEnum requiredListingManageViewInternalSelectionLevel,
                                                            InternalSearchLevelEnum availableListingManageViewInternalSelectionLevel,
                                                            InternalSearchLevelEnum offersManageViewInternalSelectionLevel,
                                                            InternalSearchLevelEnum offersAcceptedAuthorisationManageViewLevel,
                                                            InternalSearchLevelEnum offersRejectedAuthorisationManageViewLevel,
                                                            InternalSearchLevelEnum offersReturnedAuthorisationManageViewLevel,
                                                            InternalSearchLevelEnum ordersManageViewInternalSelectionLevel,
                                                            InternalSearchLevelEnum ordersDespatchedAuthorisationManageViewLevel,
                                                            InternalSearchLevelEnum ordersDeliveredAuthorisationManageViewLevel,
                                                            InternalSearchLevelEnum ordersReceivedAuthorisationManageViewLevel,
                                                            InternalSearchLevelEnum ordersCollectedAuthorisationManageViewLevel,
                                                            InternalSearchLevelEnum ordersClosedAuthorisationManageViewLevel)
        {
            ApplicationDbContext db = new ApplicationDbContext();
            AppUserSettings      appUserSettings = CreateAppUserSettings(db,
                                                                         appUserId,
                                                                         campaignDashboardMaxDistance,
                                                                         campaignDashboardMaxAge,
                                                                         requiredListingDashboardMaxDistance,
                                                                         requiredListingDashboardMaxAge,
                                                                         availableListingDashboardMaxDistance,
                                                                         availableListingDashboardMaxAge,
                                                                         campaignDashboardExternalSelectionLevel,
                                                                         requiredListingDashboardtExternalSelectionLevel,
                                                                         availableListingDashboardExternalSelectionLevel,
                                                                         campaignGeneralInfoDisplayMyUserListings,
                                                                         campaignGeneralInfoDisplayMyBranchListings,
                                                                         campaignGeneralInfoDisplayMyCompanyListings,
                                                                         campaignGeneralInfoDisplayBlockedListings,
                                                                         campaignGeneralInfoMaxDistance,
                                                                         requiredListingGeneralInfoDisplayMyUserListings,
                                                                         requiredListingGeneralInfoDisplayMyBranchListings,
                                                                         requiredListingGeneralInfoDisplayMyCompanyListings,
                                                                         requiredListingGeneralInfoDisplayBlockedListings,
                                                                         requiredListingGeneralInfoMaxDistance,
                                                                         availableListingGeneralInfoDisplayMyUserListings,
                                                                         availableListingGeneralInfoDisplayMyBranchListings,
                                                                         availableListingGeneralInfoDisplayMyCompanyListings,
                                                                         availableListingGeneralInfoDisplayBlockedListings,
                                                                         availableListingGeneralInfoMaxDistance,
                                                                         campaignGeneralInfoExternalSelectionLevel,
                                                                         requiredListingGeneralInfoExternalSelectionLevel,
                                                                         availableListingGeneralInfoExternalSelectionLevel,
                                                                         campaignManageViewInternalSelectionLevel,
                                                                         requiredListingManageViewInternalSelectionLevel,
                                                                         availableListingManageViewInternalSelectionLevel,
                                                                         offersManageViewInternalSelectionLevel,
                                                                         offersAcceptedAuthorisationManageViewLevel,
                                                                         offersRejectedAuthorisationManageViewLevel,
                                                                         offersReturnedAuthorisationManageViewLevel,
                                                                         ordersManageViewInternalSelectionLevel,
                                                                         ordersDespatchedAuthorisationManageViewLevel,
                                                                         ordersDeliveredAuthorisationManageViewLevel,
                                                                         ordersReceivedAuthorisationManageViewLevel,
                                                                         ordersCollectedAuthorisationManageViewLevel,
                                                                         ordersClosedAuthorisationManageViewLevel);

            db.Dispose();
            return(appUserSettings);
        }
Example #3
0
        public static AppUserSettings CreateAppUserSettings(ApplicationDbContext db, Guid appUserId,
                                                            int?campaignDashboardMaxDistance,
                                                            double?campaignDashboardMaxAge,
                                                            int?requiredListingDashboardMaxDistance,
                                                            double?requiredListingDashboardMaxAge,
                                                            int?availableListingDashboardMaxDistance,
                                                            double?availableListingDashboardMaxAge,
                                                            ExternalSearchLevelEnum campaignDashboardExternalSelectionLevel,
                                                            ExternalSearchLevelEnum requiredListingDashboardExternalSelectionLevel,
                                                            ExternalSearchLevelEnum availableListingDashboardExternalSelectionLevel,
                                                            bool campaignGeneralInfoDisplayMyUserListings,
                                                            bool campaignGeneralInfoDisplayMyBranchListings,
                                                            bool campaignGeneralInfoDisplayMyCompanyListings,
                                                            bool campaignGeneralInfoDisplayBlockedListings,
                                                            int?campaignGeneralInfoMaxDistance,
                                                            bool requiredListingGeneralInfoDisplayMyUserListings,
                                                            bool requiredListingGeneralInfoDisplayMyBranchListings,
                                                            bool requiredListingGeneralInfoDisplayMyCompanyListings,
                                                            bool requiredListingGeneralInfoDisplayBlockedListings,
                                                            int?requiredListingGeneralInfoMaxDistance,
                                                            bool availableListingGeneralInfoDisplayMyUserListings,
                                                            bool availableListingGeneralInfoDisplayMyBranchListings,
                                                            bool availableListingGeneralInfoDisplayMyCompanyListings,
                                                            bool availableListingGeneralInfoDisplayBlockedListings,
                                                            int?availableListingGeneralInfoMaxDistance,
                                                            ExternalSearchLevelEnum campaignGeneralInfoExternalSelectionLevel,
                                                            ExternalSearchLevelEnum requiredListingGeneralInfoExternalSelectionLevel,
                                                            ExternalSearchLevelEnum availableListingGeneralInfoExternalSelectionLevel,
                                                            InternalSearchLevelEnum campaignManageViewInternalSelectionLevel,
                                                            InternalSearchLevelEnum requiredListingManageViewInternalSelectionLevel,
                                                            InternalSearchLevelEnum availableListingManageViewInternalSelectionLevel,
                                                            InternalSearchLevelEnum offersManageViewInternalSelectionLevel,
                                                            InternalSearchLevelEnum offersAcceptedAuthorisationManageViewLevel,
                                                            InternalSearchLevelEnum offersRejectedAuthorisationManageViewLevel,
                                                            InternalSearchLevelEnum offersReturnedAuthorisationManageViewLevel,
                                                            InternalSearchLevelEnum ordersManageViewInternalSelectionLevel,
                                                            InternalSearchLevelEnum ordersDespatchedAuthorisationManageViewLevel,
                                                            InternalSearchLevelEnum ordersDeliveredAuthorisationManageViewLevel,
                                                            InternalSearchLevelEnum ordersReceivedAuthorisationManageViewLevel,
                                                            InternalSearchLevelEnum ordersCollectedAuthorisationManageViewLevel,
                                                            InternalSearchLevelEnum ordersClosedAuthorisationManageViewLevel)
        {
            AppUserSettings appUserSettings = new AppUserSettings()
            {
                AppUserSettingsId                                   = Guid.NewGuid(),
                AppUserId                                           = appUserId,
                CampaignDashboardMaxDistance                        = campaignDashboardMaxDistance,
                CampaignDashboardMaxAge                             = campaignDashboardMaxAge,
                RequiredListingDashboardMaxDistance                 = requiredListingDashboardMaxDistance,
                RequiredListingDashboardMaxAge                      = requiredListingDashboardMaxAge,
                AvailableListingDashboardMaxDistance                = availableListingDashboardMaxDistance,
                AvailableListingDashboardMaxAge                     = availableListingDashboardMaxAge,
                CampaignDashboardExternalSelectionLevel             = campaignDashboardExternalSelectionLevel,
                RequiredListingDashboardExternalSelectionLevel      = requiredListingDashboardExternalSelectionLevel,
                AvailableListingDashboardExternalSelectionLevel     = availableListingDashboardExternalSelectionLevel,
                CampaignGeneralInfoDisplayMyUserListings            = campaignGeneralInfoDisplayMyUserListings,
                CampaignGeneralInfoDisplayMyBranchListings          = campaignGeneralInfoDisplayMyBranchListings,
                CampaignGeneralInfoDisplayMyCompanyListings         = campaignGeneralInfoDisplayMyCompanyListings,
                CampaignGeneralInfoDisplayBlockedListings           = campaignGeneralInfoDisplayBlockedListings,
                CampaignGeneralInfoMaxDistance                      = campaignGeneralInfoMaxDistance,
                RequiredListingGeneralInfoDisplayMyUserListings     = requiredListingGeneralInfoDisplayMyUserListings,
                RequiredListingGeneralInfoDisplayMyBranchListings   = requiredListingGeneralInfoDisplayMyBranchListings,
                RequiredListingGeneralInfoDisplayMyCompanyListings  = requiredListingGeneralInfoDisplayMyCompanyListings,
                RequiredListingGeneralInfoDisplayBlockedListings    = requiredListingGeneralInfoDisplayBlockedListings,
                RequiredListingGeneralInfoMaxDistance               = requiredListingGeneralInfoMaxDistance,
                AvailableListingGeneralInfoDisplayMyUserListings    = availableListingGeneralInfoDisplayMyUserListings,
                AvailableListingGeneralInfoDisplayMyBranchListings  = availableListingGeneralInfoDisplayMyBranchListings,
                AvailableListingGeneralInfoDisplayMyCompanyListings = availableListingGeneralInfoDisplayMyCompanyListings,
                AvailableListingGeneralInfoDisplayBlockedListings   = availableListingGeneralInfoDisplayBlockedListings,
                AvailableListingGeneralInfoMaxDistance              = availableListingGeneralInfoMaxDistance,
                CampaignGeneralInfoExternalSelectionLevel           = campaignGeneralInfoExternalSelectionLevel,
                RequiredListingGeneralInfoExternalSelectionLevel    = requiredListingGeneralInfoExternalSelectionLevel,
                AvailableListingGeneralInfoExternalSelectionLevel   = availableListingGeneralInfoExternalSelectionLevel,
                CampaignManageViewInternalSelectionLevel            = campaignManageViewInternalSelectionLevel,
                RequiredListingManageViewInternalSelectionLevel     = requiredListingManageViewInternalSelectionLevel,
                AvailableListingManageViewInternalSelectionLevel    = availableListingManageViewInternalSelectionLevel,
                OffersManageViewInternalSelectionLevel              = offersManageViewInternalSelectionLevel,
                OffersAcceptedAuthorisationManageViewLevel          = offersAcceptedAuthorisationManageViewLevel,
                OffersRejectedAuthorisationManageViewLevel          = offersRejectedAuthorisationManageViewLevel,
                OffersReturnedAuthorisationManageViewLevel          = offersReturnedAuthorisationManageViewLevel,
                OrdersManageViewInternalSelectionLevel              = ordersManageViewInternalSelectionLevel,
                OrdersDespatchedAuthorisationManageViewLevel        = ordersDespatchedAuthorisationManageViewLevel,
                OrdersDeliveredAuthorisationManageViewLevel         = ordersDeliveredAuthorisationManageViewLevel,
                OrdersReceivedAuthorisationManageViewLevel          = ordersReceivedAuthorisationManageViewLevel,
                OrdersCollectedAuthorisationManageViewLevel         = ordersCollectedAuthorisationManageViewLevel,
                OrdersClosedAuthorisationManageViewLevel            = ordersClosedAuthorisationManageViewLevel
            };

            db.AppUserSettings.Add(appUserSettings);
            db.SaveChanges();

            return(appUserSettings);
        }