예제 #1
0
        public ActionResult Departamente()
        {
            Models.DepartamentePVM model = new Models.DepartamentePVM();
            model.departamente = db.departamente.ToList();

            return(PartialView("_Departamente", model));
        }
예제 #2
0
        public ActionResult CreateDepartament(Models.DepartamentePVM model)
        {
            if (ModelState.IsValid)
            {
                Models.departamente dep = new Models.departamente();
                dep.nume = model.newdepname;
                db.departamente.Add(dep);
                db.SaveChanges();
            }

            return(RedirectToAction("Departamente"));
        }