Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                validarDatos();
                FixamoContext context = new FixamoContext();
                if (plazoEntrega == null)
                {
                    Clases.PlazoEntrega newPlazoEntrega = new Clases.PlazoEntrega();
                    newPlazoEntrega.Nombre = nombre.Text;

                    context.PlazosDeEntrega.Add(newPlazoEntrega);
                }
                else
                {
                    Clases.PlazoEntrega newPlazoEntrega = context.PlazosDeEntrega.Find(plazoEntrega.PlazoEntregaId);
                    newPlazoEntrega.Nombre = nombre.Text;
                }
                context.SaveChanges();

                this.Close();
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
            }
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                validarDatos();
                FixamoContext context = new FixamoContext();
                if (doctor == null)
                {
                    Clases.Doctor newDoctor = new Clases.Doctor();
                    newDoctor.Nombre = nombre.Text;

                    context.Doctores.Add(newDoctor);
                }
                else
                {
                    Clases.Doctor newDoctor = context.Doctores.Find(doctor.DoctorId);
                    newDoctor.Nombre = nombre.Text;
                }
                context.SaveChanges();

                this.Close();
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
            }
        }
Пример #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                validarDatos();
                FixamoContext context = new FixamoContext();
                if (condicionPago == null)
                {
                    Clases.CondicionPago newCondicionDePago = new Clases.CondicionPago();
                    newCondicionDePago.Nombre = nombre.Text;

                    context.CondicionesDePago.Add(newCondicionDePago);
                }
                else
                {
                    Clases.CondicionPago newCondicionDePago = context.CondicionesDePago.Find(condicionPago.CondicionPagoId);
                    newCondicionDePago.Nombre = nombre.Text;
                }
                context.SaveChanges();

                this.Close();
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
            }
        }
Пример #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                validarDatos();
                FixamoContext context = new FixamoContext();
                if (lugarCirugia == null)
                {
                    Clases.LugarCirugia newLugarCirugia = new Clases.LugarCirugia();
                    newLugarCirugia.Nombre = nombre.Text;

                    context.LugaresCirugias.Add(newLugarCirugia);
                }
                else
                {
                    Clases.LugarCirugia newLugarCirugia = context.LugaresCirugias.Find(lugarCirugia.LugarCirugiaId);
                    newLugarCirugia.Nombre = nombre.Text;
                }
                context.SaveChanges();

                this.Close();
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
            }
        }
Пример #5
0
 private void button3_Click(object sender, EventArgs e)
 {
     try
     {
         validarUser();
         if ((string)dataGridView1.SelectedRows[0].Cells["Nombre"].Value != "ADM")
         {
             int idUser = (int)dataGridView1.SelectedRows[0].Cells["UsuarioId"].Value;
             //
             FixamoContext  context      = new FixamoContext();
             Clases.Usuario usuarioSelec = context.Usuarios.Find(idUser);
             usuarioSelec.Habilitado = false;
             context.SaveChanges();
             //
             this.AdministracionUsuarios_Load(null, null);
         }
         else
         {
             MessageBox.Show("No se puede dar de baja el usuario ADM");
         }
     }
     catch (Exception exc)
     {
         MessageBox.Show(exc.Message);
     }
 }
Пример #6
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                validarDatos();

                Clases.Paciente newPaciente = new Clases.Paciente();
                newPaciente.Nombre = nombreAgregar.Text;
                if (!(string.IsNullOrEmpty(nroAfiliado.Text)))
                {
                    newPaciente.NroAfiliado = nroAfiliado.Text;
                }


                FixamoContext context = new FixamoContext();
                context.Pacientes.Add(newPaciente);
                context.SaveChanges();

                limpiarDatos();

                cargarDataGrid();
                buscarCoincidencias();
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
            }
        }
Пример #7
0
        private void button1_Click(object sender, EventArgs e)
        {
            FixamoContext context = new FixamoContext();

            Clases.Parametros parametro = context.Parametros.Where(p => p.NombreParametro == "ULTNROPRESUP").First();
            //
            parametro.valor = int.Parse(proxValor.Text) - 1;
            context.SaveChanges();
            //
            this.Close();
        }
Пример #8
0
        private void button3_Click(object sender, EventArgs e)
        {
            int idCondicion = (int)dataGridView1.SelectedRows[0].Cells["CondicionPagoId"].Value;
            //
            FixamoContext context = new FixamoContext();

            Clases.CondicionPago condicionSeleccionado = context.CondicionesDePago.Find(idCondicion);
            condicionSeleccionado.Habilitado = false;
            context.SaveChanges();
            //
            this.AdministracionCondicionesDePago_Load(null, null);
        }
Пример #9
0
        private void button3_Click(object sender, EventArgs e)
        {
            int idPlazoEntrega = (int)dataGridView1.SelectedRows[0].Cells["PlazoEntregaId"].Value;
            //
            FixamoContext context = new FixamoContext();

            Clases.PlazoEntrega plazoEntregaSeleccionado = context.PlazosDeEntrega.Find(idPlazoEntrega);
            plazoEntregaSeleccionado.Habilitado = false;
            context.SaveChanges();
            //
            this.AdministracionPlazosDeEntrega_Load(null, null);
        }
Пример #10
0
        private void button4_Click(object sender, EventArgs e)
        {
            int idDoc = (int)dataGridView1.SelectedRows[0].Cells["DoctorId"].Value;
            //
            FixamoContext context = new FixamoContext();

            Clases.Doctor doctorSeleccionado = context.Doctores.Find(idDoc);
            doctorSeleccionado.Habilitado = false;
            context.SaveChanges();
            //
            cargarDataGrid();
            buscarCoincidencias();
        }
Пример #11
0
        private void button4_Click(object sender, EventArgs e)
        {
            int idLugar = (int)dataGridView1.SelectedRows[0].Cells["LugarCirugiaId"].Value;
            //
            FixamoContext context = new FixamoContext();

            Clases.LugarCirugia lugarCirugiaSeleccionado = context.LugaresCirugias.Find(idLugar);
            lugarCirugiaSeleccionado.Habilitado = false;
            context.SaveChanges();
            //
            cargarDataGrid();
            buscarCoincidencias();
        }
Пример #12
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                validarDatos();
                FixamoContext context = new FixamoContext();
                if (usuario == null)
                {
                    Clases.Usuario newUsuario = new Clases.Usuario();
                    newUsuario.Nombre     = nombre.Text;
                    newUsuario.Contraseña = contraseña.Text;
                    if (!(string.IsNullOrEmpty(email.Text)))
                    {
                        newUsuario.Email = email.Text;
                    }
                    if (!(string.IsNullOrEmpty(telefono.Text)))
                    {
                        newUsuario.Telefono = telefono.Text;
                    }

                    context.Usuarios.Add(newUsuario);
                }
                else
                {
                    Clases.Usuario newUsuario = context.Usuarios.Find(usuario.UsuarioId);
                    newUsuario.Nombre     = nombre.Text;
                    newUsuario.Contraseña = contraseña.Text;
                    if (!(string.IsNullOrEmpty(email.Text)))
                    {
                        newUsuario.Email = email.Text;
                    }
                    if (!(string.IsNullOrEmpty(telefono.Text)))
                    {
                        newUsuario.Telefono = telefono.Text;
                    }
                }
                context.SaveChanges();

                this.Close();
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
            }
        }
Пример #13
0
        private void button2_Click_1(object sender, EventArgs e)
        {
            if (this.dataGridView1.CurrentRow != null) //Averiguar si se seleccionó un campo en el Datagridview
            {
                presupuestos[dataGridView1.SelectedRows[0].Index].Habilitado = false;
                //
                int idPresupuesto = (int)dataGridView1.SelectedRows[0].Cells["PresupuestoId"].Value;
                //
                FixamoContext      context = new FixamoContext();
                Clases.Presupuesto presupuestosSeleccionado = context.Presupuestos.Find(idPresupuesto);
                presupuestosSeleccionado.Habilitado = false;
                context.SaveChanges();
                //

                /*dataGridView1.CurrentCell = null;
                 * dataGridView1.Rows[dataGridView1.SelectedRows[0].Index].Visible = false;*/
                cargarDataGrid();
            }
        }
Пример #14
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                validarDatos();
                FixamoContext context = new FixamoContext();
                if (paciente == null)
                {
                    Clases.Paciente newPaciente = new Clases.Paciente();
                    newPaciente.Nombre = nombre.Text;
                    if (string.IsNullOrEmpty(nroAfiliado.Text))
                    {
                        newPaciente.NroAfiliado = null;
                    }
                    else
                    {
                        newPaciente.NroAfiliado = nroAfiliado.Text;
                    }

                    context.Pacientes.Add(newPaciente);
                }
                else
                {
                    Clases.Paciente newPaciente = context.Pacientes.Find(paciente.PacienteId);
                    newPaciente.Nombre = nombre.Text;
                    if (string.IsNullOrEmpty(nroAfiliado.Text))
                    {
                        newPaciente.NroAfiliado = null;
                    }
                    else
                    {
                        newPaciente.NroAfiliado = nroAfiliado.Text;
                    }
                }
                context.SaveChanges();

                this.Close();
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
            }
        }
Пример #15
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                validarDatos();

                Clases.Solicitante newSolicitante = new Clases.Solicitante();
                newSolicitante.Nombre        = nombreAgregar.Text;
                newSolicitante.NombreOficina = nombreOficina.Text;
                if (!(string.IsNullOrEmpty(telefono.Text)))
                {
                    newSolicitante.Telefono = telefono.Text;
                }
                if (!(string.IsNullOrEmpty(email.Text)))
                {
                    newSolicitante.Email = email.Text;
                }
                if (!(string.IsNullOrEmpty(cuit.Text)))
                {
                    newSolicitante.Cuit = cuit.Text;
                }
                if (!(string.IsNullOrEmpty(razonSoc.Text)))
                {
                    newSolicitante.RazonSoc = razonSoc.Text;
                }
                newSolicitante.Exento = exento.Checked;

                FixamoContext context = new FixamoContext();
                context.Solicitantes.Add(newSolicitante);
                context.SaveChanges();

                limpiarDatos();

                cargarDataGrid();
                buscarCoincidencias();
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
            }
        }
Пример #16
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                validarDatos();

                Clases.PlazoEntrega newPlazoEntrega = new Clases.PlazoEntrega();
                newPlazoEntrega.Nombre = nombreAgregar.Text;

                FixamoContext context = new FixamoContext();
                context.PlazosDeEntrega.Add(newPlazoEntrega);
                context.SaveChanges();

                limpiarDatos();

                this.AdministracionPlazosDeEntrega_Load(null, null);
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
            }
        }
Пример #17
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                validarDatos();

                Clases.CondicionPago newCondicionDePago = new Clases.CondicionPago();
                newCondicionDePago.Nombre = nombreAgregar.Text;

                FixamoContext context = new FixamoContext();
                context.CondicionesDePago.Add(newCondicionDePago);
                context.SaveChanges();

                limpiarDatos();

                this.AdministracionCondicionesDePago_Load(null, null);
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
            }
        }
Пример #18
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                validarDatos();

                Clases.LugarCirugia newLugarCirugia = new Clases.LugarCirugia();
                newLugarCirugia.Nombre = nombreAgregar.Text;

                FixamoContext context = new FixamoContext();
                context.LugaresCirugias.Add(newLugarCirugia);
                context.SaveChanges();

                limpiarDatos();

                cargarDataGrid();
                buscarCoincidencias();
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
            }
        }
Пример #19
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            try
            {
                validarDatos();
                FixamoContext context = new FixamoContext();
                if (solicitante == null)
                {
                    Clases.Solicitante newSolicitante = new Clases.Solicitante();
                    newSolicitante.Nombre        = nombreAgregar.Text;
                    newSolicitante.NombreOficina = nombreOficina.Text;
                    if (!(string.IsNullOrEmpty(telefono.Text)))
                    {
                        newSolicitante.Telefono = telefono.Text;
                    }
                    if (!(string.IsNullOrEmpty(email.Text)))
                    {
                        newSolicitante.Email = email.Text;
                    }
                    if (!(string.IsNullOrEmpty(cuit.Text)))
                    {
                        newSolicitante.Cuit = cuit.Text;
                    }
                    if (!(string.IsNullOrEmpty(razonSoc.Text)))
                    {
                        newSolicitante.RazonSoc = razonSoc.Text;
                    }
                    newSolicitante.Exento = exento.Checked;

                    context.Solicitantes.Add(newSolicitante);
                }
                else
                {
                    Clases.Solicitante newSolicitante = context.Solicitantes.Find(solicitante.SolicitanteId);
                    newSolicitante.Nombre        = nombreAgregar.Text;
                    newSolicitante.NombreOficina = nombreOficina.Text;
                    if (!(string.IsNullOrEmpty(telefono.Text)))
                    {
                        newSolicitante.Telefono = telefono.Text;
                    }
                    if (!(string.IsNullOrEmpty(email.Text)))
                    {
                        newSolicitante.Email = email.Text;
                    }
                    if (!(string.IsNullOrEmpty(cuit.Text)))
                    {
                        newSolicitante.Cuit = cuit.Text;
                    }
                    if (!(string.IsNullOrEmpty(razonSoc.Text)))
                    {
                        newSolicitante.RazonSoc = razonSoc.Text;
                    }
                    newSolicitante.Exento = exento.Checked;
                }
                context.SaveChanges();

                this.Close();
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
            }
        }