Esempio n. 1
0
        public async Task <IActionResult> OnPostAsync()
        {
            string Username = Request.Form["Username"];
            string Password = Request.Form["Password"];

            Debug.WriteLine(Username);
            if (Username == string.Empty && Password == string.Empty)
            {
                return(Page());
            }


            Login = await _context.Login
                    .FirstOrDefaultAsync(m => string.Equals(m.Username, Username));

            if (Login == null)
            {
                return(Page());
            }
            if (!Login.Password.Equals(Password))
            {
                return(Page());
            }
            ViewData["Employee_EmployeeID"] = new SelectList(_context.Set <Employee>(), "EmployeeID", "EmployeeID");
            Debug.WriteLine(Login.Employee_EmployeeID);
            datalogin data = new datalogin();

            data.EmployeeID = Login.Employee_EmployeeID;


            Debug.WriteLine(data.EmployeeID + "555555555555555555555555555555555555555555555555555555555555555555555555");

            return(RedirectToPage("./Home/Home", new { id = Login.Employee_EmployeeID }));
        }
Esempio n. 2
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Login = await _context.Login
                    .Include(l => l.Employee).FirstOrDefaultAsync(m => m.LoginID == id);

            if (Login == null)
            {
                return(NotFound());
            }
            ViewData["Employee_EmployeeID"] = new SelectList(_context.Set <Employee>(), "EmployeeID", "EmployeeID");
            return(Page());
        }
Esempio n. 3
0
 public IActionResult OnGet()
 {
     ViewData["Employee_EmployeeID"] = new SelectList(_context.Set <Employee>(), "EmployeeID", "EmployeeID");
     return(Page());
 }