Ejemplo n.º 1
0
        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"));
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        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;
 }
Ejemplo n.º 5
0
 public CongesController(RhContext context)
 {
     _context = context;
 }
Ejemplo n.º 6
0
 public ServicesController(RhContext context)
 {
     _context = context;
 }
Ejemplo n.º 7
0
 public TypeContratsController(RhContext context)
 {
     _context = context;
 }
Ejemplo n.º 8
0
 public EmployeeRepository(RhContext ctx)
 {
     _ctx = ctx;
 }
Ejemplo n.º 9
0
 public CollaborateursController(RhContext context)
 {
     _context = context;
 }
Ejemplo n.º 10
0
 public ProjetController(RhContext context)
 {
     _context = context;
 }