예제 #1
0
        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 }));
                }
            }
        }
예제 #2
0
 public ActionResult News()
 {
     using (var db = new AbcContext())
     {
         return(View(db.TbNews.ToList()));
     }
 }
예제 #3
0
 // 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;
 }
예제 #5
0
 public EmployeeController(AbcContext abcContext)
 {
     db = abcContext;
 }