예제 #1
0
        // GET: Empresa/Details/5
        public ActionResult Details(int id)
        {
            var emp = new Empresa();
            using (var ctx = new GDentalContext())
            {
                emp = ctx.Empresas.Find(id);
            }

            return View(emp);
        }
예제 #2
0
        // GET: TipoDocumento/Details/5
        public ActionResult Details(int id)
        {
            var tipoContatos = new Tipo_Contato();
            using (var ctx = new GDentalContext())
            {
                tipoContatos = ctx.TipoContatos.Find(id);
            }

            return View(tipoContatos);
        }
        // GET: FuncaoUsuario/Details/5
        public ActionResult Details(int id)
        {
            var funcaoUsuario = new Funcao_Usuario();
            using (var ctx = new GDentalContext())
            {
                funcaoUsuario = ctx.FuncaoUsuario.Find(id);
            }

            return View(funcaoUsuario);
        }
예제 #4
0
        // GET: TipoDocumento/Edit/5
        public ActionResult Edit(int id)
        {
            try
            {
                var tipoContato = new Tipo_Contato();
                using (var ctx = new GDentalContext())
                {
                    tipoContato = ctx.TipoContatos.Find(id);
                }

                return View(tipoContato);
            }
            catch
            {
                return View();
            }
        }
        // GET: FuncaoUsuario/Edit/5
        public ActionResult Edit(int id)
        {
            try
            {
                var funcaoUsuario = new Funcao_Usuario();
                using (var ctx = new GDentalContext())
                {
                    funcaoUsuario = ctx.FuncaoUsuario.Find(id);
                }

                return View(funcaoUsuario);
            }
            catch
            {
                return View();
            }
        }
        public ActionResult Create(Funcao_Usuario model)
        {
            try
            {
                using (var ctx = new GDentalContext())
                {
                    ctx.FuncaoUsuario.Add(model);
                    ctx.SaveChanges();
                }

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
예제 #7
0
        public ActionResult Create(Empresa model)
        {
            try
            {
                using (var ctx = new GDentalContext())
                {
                    ctx.Empresas.Add(model);
                    ctx.SaveChanges();
                }

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
예제 #8
0
        // GET: Empresa/Edit/5
        public ActionResult Edit(int id)
        {
            try
            {
                var emp = new Empresa();
                using (var ctx = new GDentalContext())
                {
                    emp = ctx.Empresas.Find(id);
                }

                return View(emp);
            }
            catch
            {
                return View();
            }
        }
예제 #9
0
        public ActionResult Create(Tipo_Documento model)
        {
            try
            {
                using (var ctx = new GDentalContext())
                {
                    ctx.TipoDocumentos.Add(model);
                    ctx.SaveChanges();
                }

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
예제 #10
0
        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();
            }
        }
예제 #11
0
        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();
            }
        }
예제 #12
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();
            }
        }
예제 #13
0
파일: Form1.cs 프로젝트: jocosta/GDental
        public Form1()
        {
            InitializeComponent();

            using (var ctx = new GDentalContext())
            {
                Empresa emp = new Empresa() {
                    ChaveApi = "",
                    Cnpj = "83.756.386/0001-93",
                    CroResponsavel = "123456",
                    FimExpediente = "18:00",
                    InicioExpediente = "08:00",
                    NomeFantasia = "Dentitas SA",
                    RazaoSocial = "Dentistas SA"
                    


                };

                ctx.Empresas.Add(emp);
                ctx.SaveChanges();
            }
           
        }
예제 #14
0
        // GET: TipoDocumento/Delete/5
        public ActionResult Delete(int id)
        {
            try
            {
                var tipoDocumento = new Tipo_Documento();
                using (var ctx = new GDentalContext())
                {
                    tipoDocumento = ctx.TipoDocumentos.Find(id);
                }

                return View(tipoDocumento);
            }
            catch
            {
                return View();
            }
        }
예제 #15
0
        public ActionResult Delete(int id, Funcao_Usuario model)
        {

            try
            {
               
                using (var ctx = new GDentalContext())
                {
                    var original = ctx.FuncaoUsuario.Find(id);
                    ctx.FuncaoUsuario.Remove(original);
                    ctx.SaveChanges();
                }
                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
예제 #16
0
 // GET: FuncaoUsuario
 public ActionResult Index()
 {
     var model = new GDentalContext().FuncaoUsuario.ToList();
     return View(model);
 }
예제 #17
0
 // GET: TipoDocumento
 public ActionResult Index()
 {
     var model = new GDentalContext().TipoDocumentos.ToList();
     return View(model);
 }
예제 #18
0
 // GET: Empresa
 public ActionResult Index()
 {
     var model = new GDentalContext().Empresas.ToList();
     return View(model);
 }
예제 #19
0
        public ActionResult Delete(int id, Tipo_Contato model)
        {

            try
            {
                var tipoContato = new Tipo_Contato();
                using (var ctx = new GDentalContext())
                {
                    var original = ctx.TipoContatos.Find(id);
                    ctx.TipoContatos.Remove(original);
                    ctx.SaveChanges();
                }
                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }