public ActionResult DeleteConfirmed(int id)
        {
            tp_jsf_timesheet tp_jsf_timesheet = ts.GetById(id);

            ts.Delete(tp_jsf_timesheet);
            ts.Commit();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
        // GET: testts
        public ActionResult Index()
        {
            tp_jsf_timesheet time = new tp_jsf_timesheet();
            Employe          ee   = new Employe();
            var myModel           = new testt();

            myModel.listA = ee.GetAll();

            // ts.Add(tp_jsf_timesheet);
            return(View(myModel));

            /*  IEnumerable<tp_jsf_employe> list = ts.GetAll();*/
        }
        public ActionResult Delete(int id)
        {
            if (id == 0)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tp_jsf_timesheet tp_jsf_timesheet = ts.GetById(id);

            if (tp_jsf_timesheet == null)
            {
                return(HttpNotFound());
            }
            return(View(tp_jsf_timesheet));
        }
        public ActionResult Create([Bind(Include = "idT,EtatTache,NbreConge,NbreHeureTRavJour,NbreHeureTRavS,idEmploye,idp,idpfk,etat")] tp_jsf_timesheet tp_jsf_timesheet)
        {
            tp_jsf_timesheet timesheet = new tp_jsf_timesheet();

            // Employe ee = new Employe();
            //var myModel = new testt();
            // myModel.listA = ee.GetAll();
            if (ModelState.IsValid)
            {
                /*  List<object> m = new List<object>();
                 * m.Add(em.GetAll().ToList());
                 * m.Add(tp_jsf_timesheet);*/

                ts.Add(tp_jsf_timesheet);
                ts.Commit();
                ViewBag.idEmploye = new SelectList(em.GetAll(), "id", "nom", tp_jsf_timesheet.idEmploye);
                return(RedirectToAction("Index"));
            }



            return(View());
        }