public ActionResult Specialite(int Id, int[] specialites) { using (var db = new RhContext()) { Medecin medecin = db.Medecins.Find(Id); medecin.Specialites = new List <Specialite>(); foreach (int sp in specialites) { medecin.Specialites.Add(db.Specialites.Find(sp)); } db.SaveChanges(); } return(RedirectToAction("Index")); }
public ActionResult Login(UserApp u) { // this action is for handle post (login) if (ModelState.IsValid) // this is check validity { using (RhContext dc = new RhContext()) { var v = dc.Users.Where(a => a.Name_User.Equals(u.Name_User) && a.Password_User.Equals(u.Password_User)).FirstOrDefault(); if (v != null) { Session["LogedUserID"] = v.Name_User.ToString(); return(RedirectToAction("Index", "Succes")); } } } return(View(u)); }
public ActionResult Affecter(int Id, int ServiceId) { using (var db = new RhContext()) { IQueryable <Medecin> queryable = db.Medecins.Where(m => m.Id == Id); var medecin = queryable.Include(r => r.Specialites).FirstOrDefault(); medecin.ServiceId = ServiceId; foreach (Specialite specialite in medecin.Specialites.ToList()) { medecin.Specialites.Remove(specialite); } db.SaveChanges(); } return(RedirectToAction("Index")); }
public DepensesController(RhContext context) { _context = context; }
public CongesController(RhContext context) { _context = context; }
public ServicesController(RhContext context) { _context = context; }
public TypeContratsController(RhContext context) { _context = context; }
public EmployeeRepository(RhContext ctx) { _ctx = ctx; }
public CollaborateursController(RhContext context) { _context = context; }
public ProjetController(RhContext context) { _context = context; }