コード例 #1
0
        //
        // GET: /Document/

        public ActionResult Index()
        {
            CandidateWebServiceReference.Candidate c = null;
            using (var service = new CandidateWebServiceReference.CandidatesService())
            {
                c = service.GetCandidateByLogin(this.GetLogin());
            }

            return(View(c));
        }
コード例 #2
0
        public ActionResult Documents()
        {
            HttpCookie authCookie            = Request.Cookies[FormsAuthentication.FormsCookieName];
            FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(authCookie.Value);

            CandidateWebServiceReference.Candidate candidate = null;
            using (var service = new CandidateWebServiceReference.CandidatesService())
            {
                candidate = service.GetCandidateByLogin(ticket.Name);
            }

            if (candidate == null)
            {
                ModelState.AddModelError("", "Error in documents!");
                return(RedirectToAction("Index", "Home"));
            }

            return(View(candidate));
        }