Exemple #1
0
        public String AddWalletToUserApi(Guid id)
        {
            User      u  = DataAccessAction.user.GetUserById(id);
            UserModel us = new UserModel
            {
                Id       = u.Id,
                Username = u.Username
            };
            List <WalletModel> wallets = new List <WalletModel>();

            foreach (var item in DataAccessAction.wallet.GetWalletNotInUserScope(id))
            {
                wallets.Add(new WalletModel
                {
                    Id      = item.Id,
                    Service = item.Service
                });
            }

            AddWalletToUserContentModel acm = new AddWalletToUserContentModel
            {
                User    = us,
                Wallets = wallets
            };

            return(JsonConvert.SerializeObject(acm));
        }
Exemple #2
0
        public ActionResult AddWalletToUserExtend(Guid id)
        {
            User      u  = DataAccessAction.user.GetUserById(id);
            UserModel us = new UserModel
            {
                Id       = u.Id,
                Username = u.Username
            };
            List <WalletModel> wallets = new List <WalletModel>();

            foreach (var item in DataAccessAction.wallet.GetWalletNotInUserScope(id))
            {
                wallets.Add(new WalletModel
                {
                    Id      = item.Id,
                    Service = item.Service
                });
            }

            AddWalletToUserContentModel acm = new AddWalletToUserContentModel
            {
                User    = us,
                Wallets = wallets
            };

            return(View(acm));
        }