Exemple #1
0
        //
        // GET: /ControleVaga/Edit/5

        public ActionResult Edit(int id)
        {
            var estacionaFacil = new CrudEstacionaFacil();

            TB_CONTROLE_VAGA tbControleVaga = estacionaFacil.TB_CONTROLE_VAGAs.Where(controleVaga => controleVaga.ID_Vagas == id).FirstOrDefault();

            return(View(tbControleVaga));
        }
Exemple #2
0
        //
        // GET: /ControleVaga/Delete/5

        public ActionResult Delete(int id)
        {
            var estacionaFacil = new CrudEstacionaFacil();

            TB_CONTROLE_VAGA tbControleVaga = estacionaFacil.TB_CONTROLE_VAGAs.SingleOrDefault(controleVaga => controleVaga.ID_Vagas == id);

            return(View(tbControleVaga));
        }
Exemple #3
0
        public ActionResult Create(TB_CONTROLE_VAGA tbControleVaga)
        {
            CrudEstacionaFacil estacionaFacil = new CrudEstacionaFacil();

            try
            {
                // TODO: Add insert logic here
                if (tbControleVaga.Vaga != null)
                {
                    estacionaFacil.TB_CONTROLE_VAGAs.InsertOnSubmit(tbControleVaga);
                    estacionaFacil.SubmitChanges();
                }
                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Exemple #4
0
        public ActionResult Edit(int id, FormCollection collection)
        {
            var estacionaFacil = new CrudEstacionaFacil();

            TB_CONTROLE_VAGA tbControleVaga = estacionaFacil.TB_CONTROLE_VAGAs.Where(controleVaga => controleVaga.ID_Vagas == id).FirstOrDefault();

            try
            {
                // TODO: Add update logic here
                UpdateModel(tbControleVaga, collection.ToValueProvider());

                estacionaFacil.SubmitChanges();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Exemple #5
0
        public ActionResult Delete(int id, FormCollection collection)
        {
            var estacionaFacil = new CrudEstacionaFacil();

            TB_CONTROLE_VAGA tbControleVaga = estacionaFacil.TB_CONTROLE_VAGAs.SingleOrDefault(controleVaga => controleVaga.ID_Vagas == id);

            try
            {
                // TODO: Add delete logic here
                estacionaFacil.TB_CONTROLE_VAGAs.DeleteOnSubmit(tbControleVaga);

                estacionaFacil.SubmitChanges();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }