public IActionResult LoginUser(Employee employee) { using (var db = new AbcContext()) { if (!db.Employees.Any()) { return(Json(new { UserExist = false, LoginSuccess = false })); } var Employee = db.Employees.FirstOrDefault(a => a.Email == employee.Email); if (Employee == null) { return(Json(new { UserExist = false, LoginSuccess = false })); } if (Employee.Password == employee.Password) { return(Json(new { LoginSuccess = true, UserExist = true })); } else { return(Json(new { LoginSuccess = false, UserExist = true })); } } }
public ActionResult News() { using (var db = new AbcContext()) { return(View(db.TbNews.ToList())); } }
// GET: Home public ActionResult Index() { using (var db = new AbcContext()) { return(View(db.TbCat.ToList())); } }
public HomeController(ILogger <HomeController> logger, AbcContext context) { _logger = logger; db = context; }
public EmployeeController(AbcContext abcContext) { db = abcContext; }