private void createRolesandUsers() { skiworldContext context = new skiworldContext(); var roleManager = new RoleManager <IdentityRole>(new RoleStore <IdentityRole>(context)); var UserManager = new UserManager <user>(new UserStore <user>(context)); // In Startup iam creating first Admin Role and creating a default Admin User if (!roleManager.RoleExists("Admin")) { // first we create Admin role var role = new Microsoft.AspNet.Identity.EntityFramework.IdentityRole(); role.Name = "Admin"; roleManager.Create(role); //Here we create a Admin super user who will maintain the website } // creating Creating Manager role if (!roleManager.RoleExists("Client")) { var role = new Microsoft.AspNet.Identity.EntityFramework.IdentityRole(); role.Name = "Client"; roleManager.Create(role); } // creating Creating Employee role if (!roleManager.RoleExists("Agent")) { var role = new Microsoft.AspNet.Identity.EntityFramework.IdentityRole(); role.Name = "Agent"; roleManager.Create(role); } }
public ActionResult Tablesresto(int id) { skiworldContext sc = new skiworldContext(); var query = from c in sc.restotable.Where(c => c.restaurant_idRestaurant == id) select c; return(View(query)); }
public ActionResult Menustable(int id) { skiworldContext sc = new skiworldContext(); var query = from c in sc.menu.Where(c => c.idRestaurant == id) select c; return(View(query)); }
public List <user> getUsers(int id) { RoomService rs = new RoomService(); List <user> users = new List <user>(); IEnumerable <room> roms = new List <room>(); ICollection <roomreservation> rss = new List <roomreservation>(); skiworldContext sc = new skiworldContext(); // roms = rs.getByHotel(id); roms = rs.GetAll(); foreach (room r in roms) { rss = r.roomreservations; foreach (roomreservation rr in rss) { users.Add(rr.user); } } /* var query = from c in sc.roomreservation * * where c.id_room == id * select c; * query.ToList(); * foreach (roomreservation r in query) * { * * users.Add(r.user); * * * * }*/ return(users); }
public DatabaseFactory() { dataContext = new skiworldContext(); }
public AccountController() { ctx = new skiworldContext(); }
public UnitOfWork(IDatabaseFactory dbFactory) { this.dbFactory = dbFactory; dataContext = dbFactory.DataContext; }