Ejemplo n.º 1
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);
            }
        }
Ejemplo n.º 2
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);
     }
 }
Ejemplo n.º 3
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);
            }
        }
Ejemplo n.º 4
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);
            }
        }
Ejemplo n.º 5
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);
            }
        }
Ejemplo n.º 6
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);
            }
        }
Ejemplo n.º 7
0
        private void AdministrarProximoNroPresupuesto_Load(object sender, EventArgs e)
        {
            FixamoContext context = new FixamoContext();

            Clases.Parametros parametro = context.Parametros.Where(p => p.NombreParametro == "ULTNROPRESUP").First();
            //
            proxValor.Text = (parametro.valor + 1).ToString();
        }
Ejemplo n.º 8
0
        private void AdministracionCondicionesDePago_Load(object sender, EventArgs e)
        {
            FixamoContext context = new FixamoContext();

            condicionesDePago = context.CondicionesDePago.Where(c => c.Habilitado).ToList();

            dataGridView1.DataSource = condicionesDePago;
        }
Ejemplo n.º 9
0
        private void AdministracionPlazosDeEntrega_Load(object sender, EventArgs e)
        {
            FixamoContext context = new FixamoContext();

            plazosDeEntrega = context.PlazosDeEntrega.Where(p => p.Habilitado).ToList();

            dataGridView1.DataSource = plazosDeEntrega;
        }
Ejemplo n.º 10
0
        private void button2_Click(object sender, EventArgs e)
        {
            int           idPresupuesto = (int)dataGridView1.SelectedRows[0].Cells["PresupuestoId"].Value;
            FixamoContext context       = new FixamoContext();

            Clases.Presupuesto presupuestosSeleccionado = context.Presupuestos.Find(idPresupuesto);
            //presupuestosSeleccionado.imprimir(false);
        }
Ejemplo n.º 11
0
        private void AdministracionUsuarios_Load(object sender, EventArgs e)
        {
            FixamoContext context = new FixamoContext();

            usuarios = context.Usuarios.Where(u => u.Habilitado).ToList();

            dataGridView1.DataSource = usuarios;

            dataGridView1.Columns["Contraseña"].Visible = false;
        }
Ejemplo n.º 12
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (this.dataGridView1.CurrentRow != null) //Averiguar si se seleccionó un campo en el Datagridview
     {
         int                idPresupuesto            = (int)dataGridView1.SelectedRows[0].Cells["PresupuestoId"].Value;
         FixamoContext      context                  = new FixamoContext();
         Clases.Presupuesto presupuestosSeleccionado = context.Presupuestos.Find(idPresupuesto);
         presupuestosSeleccionado.imprimir();
     }
 }
Ejemplo n.º 13
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();
        }
Ejemplo n.º 14
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);
        }
Ejemplo n.º 15
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);
        }
Ejemplo n.º 16
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();
        }
Ejemplo n.º 17
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();
        }
Ejemplo n.º 18
0
        private void cargarDataGrid()
        {
            dataGridView1.DataSource = null;

            FixamoContext context = new FixamoContext();

            solicitantes = context.Solicitantes.Where(s => s.Habilitado).ToList();

            dataGridView1.DataSource = solicitantes;
            foreach (DataGridViewRow Row in dataGridView1.Rows)
            {
                Row.Visible = true;
            }
        }
Ejemplo n.º 19
0
        private void cargarDataGrid()
        {
            dataGridView1.DataSource = null;

            FixamoContext context = new FixamoContext();

            doctores = context.Doctores.Where(d => d.Habilitado).ToList();

            dataGridView1.DataSource = doctores;
            foreach (DataGridViewRow Row in dataGridView1.Rows)
            {
                Row.Visible = true;
            }
        }
Ejemplo n.º 20
0
        private void cargarDataGrid()
        {
            dataGridView1.DataSource = null;

            FixamoContext context = new FixamoContext();

            lugaresCirugia = context.LugaresCirugias.Where(l => l.Habilitado).ToList();

            dataGridView1.DataSource = lugaresCirugia;
            foreach (DataGridViewRow Row in dataGridView1.Rows)
            {
                Row.Visible = true;
            }
        }
Ejemplo n.º 21
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);
            }
        }
Ejemplo n.º 22
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();
            }
        }
Ejemplo n.º 23
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);
            }
        }
Ejemplo n.º 24
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);
            }
        }
Ejemplo n.º 25
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);
            }
        }
Ejemplo n.º 26
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);
            }
        }
Ejemplo n.º 27
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);
            }
        }
Ejemplo n.º 28
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);
            }
        }