Example #1
0
        // GET: Account/Details/5


        public ActionResult myAccount()
        {
            ViewBag.Error = false;


            var loginUser = cookiemanagement.GetCoockieAustetication();

            if (loginUser == "")
            {
                return(RedirectToAction("Login"));
            }

            else
            {
                ViewBag.Compentence = cm.getAllForAccount(loginUser);
                return(View(am.GetAccountForUsername(cookiemanagement.GetCoockieAustetication())));
            }
        }
        // GET: Admin/Edit/5
        public ActionResult Edit(string username)
        {
            var usernLogin = username;
            var utente     = am.GetAccountForUsername(usernLogin);

            IList <CompetenceModel> allCompetence = new List <CompetenceModel>();

            allCompetence = cm.getAll();

            IList <CompetenceModel> userCompetence = new List <CompetenceModel>();

            userCompetence = cm.getAllForAccount(usernLogin);


            foreach (var item in allCompetence)
            {
                if (userCompetence.Any(x => x.CompetenceID == item.CompetenceID))
                {
                    item.Selected = true;
                }
            }

            ViewBag.ListCompetence = allCompetence;


            if (usernLogin != "")
            {
                ViewBag.NotLogin = false;
            }

            else
            {
                ViewBag.NotLogin = true;
            }


            return(View(utente));
        }