Beispiel #1
0
        public static List <CampaignManageView> GetAllCampaignsManageViewForUserBranch(ApplicationDbContext db, IPrincipal user)
        {
            List <CampaignManageView> allCampaignsManageView = new List <CampaignManageView>();

            BranchUser      branchUser = BranchUserHelpers.GetBranchUserCurrentForUser(db, user);
            List <Campaign> allCampaignsForBranchUser = CampaignHelpers.GetAllCampaignsForBranchUser(db, branchUser);

            foreach (Campaign campaignForBranchUser in allCampaignsForBranchUser)
            {
                CampaignManageView campaignManageView = new CampaignManageView()
                {
                    Campaign = campaignForBranchUser
                };

                allCampaignsManageView.Add(campaignManageView);
            }

            return(allCampaignsManageView);
        }
Beispiel #2
0
        public static List <CampaignManageView> GetAllCampaignsManageView(ApplicationDbContext db, IPrincipal user, bool getHistory)
        {
            List <CampaignManageView> allCampaignsManageView = new List <CampaignManageView>();

            AppUser         appUser             = AppUserHelpers.GetAppUser(db, user);
            List <Campaign> allCampaignsForUser = CampaignHelpers.GetAllManageListingFilteredCampaigns(db, appUser.AppUserId, getHistory);

            foreach (Campaign campaignForBranchUser in allCampaignsForUser)
            {
                CampaignManageView campaignManageView = new CampaignManageView()
                {
                    Campaign = campaignForBranchUser
                };

                allCampaignsManageView.Add(campaignManageView);
            }

            return(allCampaignsManageView);
        }