Exemplo n.º 1
0
        // GET: Profile/Committee/{committeeID}/BankAccount/{id}
        public ActionResult BankAccount(char committeeID, byte?id)
        {
            var comm = FindCommittee(committeeID);

            if (comm != null)
            {
                var accounts = comm.BankAccounts;

                // accounts listing
                if (!id.HasValue)
                {
                    return(PartialView(ActionName_BankAccount + "List", accounts.Values.Select(a => ProfileViewModelFactory.BankAccountSummaryFrom(a, committeeID))));
                }

                // account details
                if (accounts != null && accounts.ContainsKey(id.Value))
                {
                    return(PartialView(ProfileViewModelFactory.BankAccountFrom(accounts[id.Value], committeeID)));
                }
            }
            return(HttpNotFound());
        }
Exemplo n.º 2
0
        public SettingsModalViewModel(
            IAppSettings appSettings,
            VpnManager vpnManager,
            ProfileViewModelFactory profileViewModelFactory,
            SplitTunnelingViewModel splitTunnelingViewModel,
            CustomDnsListViewModel customDnsListViewModel,
            IUserStorage userStorage,
            IDialogs dialogs,
            IActiveUrls urls)
        {
            _dialogs                 = dialogs;
            _appSettings             = appSettings;
            _vpnManager              = vpnManager;
            _profileViewModelFactory = profileViewModelFactory;
            _userStorage             = userStorage;
            _urls = urls;

            SplitTunnelingViewModel = splitTunnelingViewModel;
            Ips = customDnsListViewModel;

            ReconnectCommand = new RelayCommand(ReconnectAction);
            UpgradeCommand   = new RelayCommand(UpgradeAction);
        }
Exemplo n.º 3
0
        // GET: Profile/Committee/{committeeID}/CampaignStaff/{id}
        public ActionResult CampaignStaff(char committeeID, byte?id)
        {
            var comm = FindCommittee(committeeID);

            if (comm != null)
            {
                var liaisons = comm.Liaisons;

                // contacts listing
                if (!id.HasValue)
                {
                    return(PartialView(ActionName_CampaignStaff + "List", liaisons.Values.Select(l => ProfileViewModelFactory.CampaignContactSummaryFrom(l, committeeID))));
                }

                // contact details
                if (liaisons != null && liaisons.ContainsKey(id.Value))
                {
                    var contact = ProfileViewModelFactory.CampaignStaffFrom(liaisons[id.Value]);
                    contact.CommitteeID = committeeID;
                    return(PartialView(contact));
                }
            }
            return(HttpNotFound());
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Edit(string id)
        {
            var currentUser = await _profileRepository.GetObject(id);

            return(View(ProfileViewModelFactory.Create(currentUser)));
        }
Exemplo n.º 5
0
 // GET: Profile/Committee/Principal
 public ActionResult Principal()
 {
     return(View(ActionName_Details, ProfileViewModelFactory.CommitteeProfileFrom(CPProfile.AuthorizedCommittees.PrincipalCommittee)));
 }
Exemplo n.º 6
0
 public ActionResult Summary()
 {
     return(PartialView(ProfileViewModelFactory.CandidateProfileFrom(CPProfile.ActiveCandidate)));
 }
Exemplo n.º 7
0
 // GET: Profile/Candidate
 public ActionResult Index()
 {
     return(View(ProfileViewModelFactory.CandidateProfileFrom(CPProfile.ActiveCandidate, CPProfile.AuthorizedCommittees.Committees.Values)));
 }