Esempio n. 1
0
        public async Task <IActionResult> ChangeInfo(int vtype = 0)
        {
            var model = await _accountService.GetInformation(CurrentUser.Id);

            var accountProvider = await _accountService.GetAccountProviderByAccount(CurrentUser.Id, AccountProviderNames.Facebook);

            ViewBag.Categories = await _sharedService.GetCategories();

            model.FacebookProfile = accountProvider.FbProfileLink;

            try {
                DateTime birthday = DateTime.ParseExact(model.Birthday, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture);
                if (birthday != null)
                {
                    if ((DateTime.Now.Year - birthday.Year) < 18)
                    {
                        //TempData["MessageWarning"] = "Bạn chưa đủ 18 tuổi!";
                    }
                }
                model.Birthday = birthday.ToString("dd/MM/yyyy");
            }
            catch { }

            if (vtype == 1)
            {
                return(View("AuthChangeInfo", model));
            }

            return(View(model));
        }
Esempio n. 2
0
        public async Task <IActionResult> ChangeInfo()
        {
            var model = await _accountService.GetInformation(CurrentUser.Id);

            ViewBag.Categories = await _sharedService.GetCategories();

            return(View(model));
        }
        public async Task <IActionResult> Details(int id)
        {
            var model = await _campaignService.GetCampaignDetailsByAccount(CurrentUser.Id, id);

            if (model == null)
            {
                return(NotFound());
            }
            var campaignAccount = await _campaignService.GetCampaignAccountByAccount(CurrentUser.Id, model.Id);

            if (campaignAccount == null)
            {
                return(NotFound());
            }
            ViewBag.CampaignAccount = campaignAccount;
            ViewBag.FacebookId      = await _accountService.GetProviderIdByAccount(CurrentUser.Id, AccountProviderNames.Facebook);

            ViewBag.Categories = await _sharedService.GetCategories();

            ViewBag.CampaignTypeCharges = await _campaignService.GetCampaignTypeCharges();

            ViewBag.Cities = await _sharedService.GetCities();

            return(View(model));
        }
Esempio n. 4
0
        private async Task ViewbagData()
        {
            ViewBag.Categories = await _sharedService.GetCategories();

            ViewBag.CampaignTypeCharges = await _campaignService.GetCampaignTypeCharges();

            ViewBag.Cities = await _sharedService.GetCities();
        }