Exemplo n.º 1
0
        public static ApplicationUser UserLogin(string userName, string password)
        {
            SinaicspDataModelContainer _context = new SinaicspDataModelContainer();
            ApplicationUser            _item    = _context.ApplicationUsers.ToList().FirstOrDefault(a => a.UserName == userName && a.Password == password && a.IsDeleted == false);

            return(_item);
        }
Exemplo n.º 2
0
        public static void Init()
        {
            SinaicspDataModelContainer _context = new SinaicspDataModelContainer();

            if (_context.ApplicationUsers.ToList().Count == 0)
            {
                AddNew("admin", "admin", "admin", E_Role.Admin);
            }
        }
Exemplo n.º 3
0
        public static void Delete(int id)
        {
            SinaicspDataModelContainer _context = new SinaicspDataModelContainer();
            Service _service = _context.Services.FirstOrDefault(a => a.Id == id);
            List <StudentService> _studentServices = _service.StudentServices.ToList();

            foreach (StudentService item in _studentServices)
            {
                item.IsDeleted = true;
            }
            _service.IsDeleted = true;
            _context.SaveChanges();
        }
Exemplo n.º 4
0
        public static Service GetById(int id)
        {
            SinaicspDataModelContainer _context = new SinaicspDataModelContainer();

            return(_context.Services.FirstOrDefault(a => a.Id == id));
        }