Example #1
0
        private void button4_Click(object sender, EventArgs e)
        {
            int idSolic = (int)dataGridView1.SelectedRows[0].Cells["SolicitanteId"].Value;
            //
            FixamoContext context = new FixamoContext();

            Clases.Solicitante solicitantesSeleccionado = context.Solicitantes.Find(idSolic);
            solicitantesSeleccionado.Habilitado = false;
            context.SaveChanges();
            //
            cargarDataGrid();
            buscarCoincidencias();
        }
Example #2
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);
            }
        }
Example #3
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);
            }
        }
Example #4
0
 public AMSolicitantes(Clases.Solicitante solicitanteP)
 {
     InitializeComponent();
     solicitante = solicitanteP;
 }