コード例 #1
0
        public IActionResult addvoter(avoter av)
        {
            vtype vt = new vtype();
            //  await rolemanager.CreateAsync(role);
            avoter a = new avoter
            {
                Name     = av.Name,
                password = av.password,
                vtypeId  = av.vtypeId
            };

            ViewData["vtypeId"] = new SelectList(_context.vtype, "vtypeId", "vtypeId", av.vtypeId);
            ia.Add(a);
            return(RedirectToAction("addvoter"));
        }
コード例 #2
0
        public ViewResult GetV(String Name, String password)
        {
            avoter aa = new avoter();

            aa = ia.Getv(Name, password);
            if (aa != null)
            {
                HttpContext.Session.SetString("name", Name);
                ViewBag.Name = Name;
                return(View("givevote"));
            }
            else
            {
                ViewBag.msg = "enter correct credentials";
                return(View("Index"));
            }
        }