public ActionResult Edit(int id, Funcao_Usuario model)
        {
            try
            {
                
                using (var ctx = new GDentalContext())
                {
                    var original = ctx.FuncaoUsuario.Find(id);

                    if (original != null)
                    {
                        ctx.Entry(original).CurrentValues.SetValues(model);
                        ctx.SaveChanges();
                    }
                }

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
Example #2
0
        public ActionResult Edit(int id, Empresa model)
        {
            try
            {
                var emp = new Empresa();
                using (var ctx = new GDentalContext())
                {
                    var original = ctx.Empresas.Find(id);

                    if (original != null)
                    {
                        ctx.Entry(original).CurrentValues.SetValues(model);
                        ctx.SaveChanges();
                    }
                }

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
        public ActionResult Edit(int id, Tipo_Documento model)
        {
            try
            {
                var tipoDocumento = new Tipo_Documento();
                using (var ctx = new GDentalContext())
                {
                    var original = ctx.TipoDocumentos.Find(id);

                    if (original != null)
                    {
                        ctx.Entry(original).CurrentValues.SetValues(model);
                        ctx.SaveChanges();
                    }
                }

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