Exemplo n.º 1
0
        private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == (char)Keys.Enter || e.KeyChar == (char)Keys.Tab)
            {
                this.NombredataGridView.MultiSelect   = false;
                this.NombredataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;

                if (!String.IsNullOrEmpty(IdLoteriatextBox.Text))
                {
                    lista = LoteriasBLL.GetListaLoteriaID(Utilidades.ToInt(IdLoteriatextBox.Text));
                }
                else
                {
                    lista = LoteriasBLL.GetListaLoteriaID(1);
                }

                NombredataGridView.DataSource = lista;
                if (NombredataGridView.CurrentRow != null)
                {
                    NombreLoteriatextBox.Text = NombredataGridView.SelectedRows[0].Cells[1].Value.ToString();
                    MontotextBox.Focus();
                }
                else
                {
                    MessageBox.Show("Esta loteria no Existe");
                    NombreLoteriatextBox.Clear();
                    IdLoteriatextBox.Clear();
                    IdLoteriatextBox.Focus();
                }
            }
        }
Exemplo n.º 2
0
 private void Limpiar()
 {
     IdnumericUpDown.Value = 0;
     MontotextBox.Clear();
     DescripciontextBox.Clear();
     TipocomboBox.SelectedText = string.Empty;
 }
Exemplo n.º 3
0
 private void Agregarbutton_Click(object sender, EventArgs e)
 {
     if (!(string.IsNullOrEmpty(IdLoteriatextBox.Text)))
     {
         if ((JugadatextBox.Text).Length > 0 && ((JugadatextBox.Text).Length < 3))
         {
             string tipo = "Quiniela";
             GuardarDetalleData(tipo);
         }
         else
         if ((JugadatextBox.Text).Length >= 3 && (JugadatextBox.Text).Length < 5)
         {
             string tipo = "Pale";
             GuardarDetalleData(tipo);
         }
         else
         if ((JugadatextBox.Text).Length >= 5 && (JugadatextBox.Text).Length < 7)
         {
             string tipo = "Tripleta";
             GuardarDetalleData(tipo);
         }
         else
         {
             MessageBox.Show("Error en el Formato");
             MontotextBox.Focus();
         }
     }
     else
     {
         MessageBox.Show("No puedes crear jugada sin especificar una loteria");
         Loteriabutton.Focus();
     }
 }
Exemplo n.º 4
0
 private void Nuevobutton_Click(object sender, EventArgs e)
 {
     EntradaInversionIDnumericUpDown.Value = 0;
     FechadateTimePicker.Value             = DateTime.Now;
     MontotextBox.Clear();
     InversionerrorProvider.Clear();
 }
 public void LimpiarTextBox()
 {
     InscripcionIdtextBox.Clear();
     EstudianteIdtextBox.Clear();
     MontotextBox.Clear();
     BalancetextBox.Clear();
 }
 private void Nuevobutton_Click(object sender, EventArgs e)
 {
     SalidaIdtextBox.Clear();
     CuentaIdtextBox.Clear();
     MontotextBox.Clear();
     ObservacionrichTextBox.Clear();
 }
Exemplo n.º 7
0
        private bool Validar()
        {
            bool paso = true;

            MyError.Clear();

            if (string.IsNullOrWhiteSpace(ComentariotextBox.Text))
            {
                MyError.SetError(ComentariotextBox, "El campo comentario no puede estar vacio");
                ComentariotextBox.Focus();
                paso = false;
            }
            if (string.IsNullOrWhiteSpace(DepositotextBox.Text))
            {
                MyError.SetError(DepositotextBox, "El campo deposito no puede estar vacio");
                DepositotextBox.Focus();
                paso = false;
            }
            if (string.IsNullOrWhiteSpace(MontotextBox.Text))
            {
                MyError.SetError(MontotextBox, "El campo monto no puede estar vacio");
                MontotextBox.Focus();
                paso = false;
            }
            return(paso);
        }
Exemplo n.º 8
0
        private void Eliminarbutton_Click(object sender, EventArgs e)
        {
            if (validar(1))
            {
                MessageBox.Show("Favor de Llenar casilla para poder Eliminar");
            }
            else
            {
                int id = Convert.ToInt32(EntradaInversionIDnumericUpDown.Value);

                if (BLL.EntradaInversionBLL.Eliminar(id))
                {
                    MessageBox.Show("Eliminado!", "Exitoso", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    EntradaInversionIDnumericUpDown.Value = 0;
                    FechadateTimePicker.Value             = DateTime.Now;
                    MontotextBox.Clear();
                    InversionerrorProvider.Clear();
                }
                else
                {
                    MessageBox.Show("No Pudo Eliminar!", "Fallido!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                InversionerrorProvider.Clear();
            }
        }
Exemplo n.º 9
0
        public void GuardarDetalleData(string Tipo)
        {
            this.DatosdataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            this.DatosdataGridView.MultiSelect   = false;
            var detalle = new Detalles();

            DatosdataGridView.Rows.Add();
            int cantFilas = DatosdataGridView.Rows.Count - 1;

            DatosdataGridView[0, cantFilas].Value = Tipo;
            DatosdataGridView[1, cantFilas].Value = JugadatextBox.Text;
            DatosdataGridView[2, cantFilas].Value = MontotextBox.Text;
            total = total + Utilidades.ToInt(MontotextBox.Text);
            //  detalle.IdLoteria = Utilidades.ToInt(Loteriabutton.Text);
            detalle.Jugada = Utilidades.ToInt(JugadatextBox.Text);
            detalle.Precio = Utilidades.ToInt(MontotextBox.Text);
            detalle.Tipo   = Tipo.ToString();


            if (DetallesBLL.Guardar(detalle))
            {
                id++;
                ticket.detalles.Add(DetallesBLL.Buscar(id));
                TotaltextBox.Clear();
                JugadatextBox.Clear();
                MontotextBox.Clear();
                TotaltextBox.Text = total.ToString();
                MontotextBox.Focus();
            }
            else
            {
                MessageBox.Show("Error en guardar los datos intente de nuevo");
            }
        }
Exemplo n.º 10
0
 private void Nuevobutton_Click(object sender, EventArgs e)
 {
     PrestamoIdtextBox.Clear();
     MontotextBox.Clear();
     SemanaNotextBox.Clear();
     ValorCuotatextBox.Clear();
     PrestamodataGridView.Rows.Clear();
 }
Exemplo n.º 11
0
 void limpiar()
 {
     RecepcionIdtextBox.Clear();
     CantPtextBox.Clear();
     ObservacionrichTextBox.Clear();
     RecibidoPortextBox.Clear();
     MontotextBox.Clear();
     PreciotextBox.Clear();
 }
Exemplo n.º 12
0
        private void EliminarButton_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(TicketIdTextBox.Text))
            {
                MessageBox.Show("LLena el campo con el numero de Ticket");
            }
            else
            {
                var ticket = TicketsBLL.Buscar(Convert.ToInt32(TicketIdTextBox.Text));
                if (ticket != null)
                {
                    IdLoteriatextBox.Text                = (ticket.IdLoteria).ToString();
                    NombreLoteriatextBox.Text            = (ticket.NombreLoteria).ToString();
                    FechadateTimePicker.Text             = (ticket.Fecha).ToString();
                    Usuariolabel.Text                    = ticket.Usuario.ToString();
                    TotaltextBox.Text                    = ticket.Total.ToString();
                    DatosdataGridView.DataSource         = null;
                    DatosdataGridView.DataSource         = ticket.detalles;
                    DatosdataGridView.Columns[0].Visible = false;
                    DatosdataGridView.Columns[1].Visible = false;
                    DatosdataGridView.Columns[2].Visible = false;
                    DialogResult dialogo = MessageBox.Show("Desea Borrar el Ticket", "Borrarando Ticket", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                    if (dialogo == DialogResult.Yes)
                    {
                        int TicketId = Utilidades.ToInt(TicketIdTextBox.Text);
                        TicketsBLL.Eliminar(TicketId);
                        MontotextBox.Clear();
                        JugadatextBox.Clear();
                        IdLoteriatextBox.Clear();
                        NombreLoteriatextBox.Clear();
                        TotaltextBox.Clear();
                        TicketIdTextBox.Clear();
                        DatosdataGridView.DataSource         = null;
                        DatosdataGridView.Columns[0].Visible = true;
                        DatosdataGridView.Columns[2].Visible = true;
                        DatosdataGridView.Columns[1].Visible = true;
                        TicketIdTextBox.Focus();
                    }
                }
                else
                {
                    MessageBox.Show("Este Ticket no Existe");

                    MontotextBox.Clear();
                    JugadatextBox.Clear();
                    IdLoteriatextBox.Clear();
                    NombreLoteriatextBox.Clear();
                    TotaltextBox.Clear();
                    TicketIdTextBox.Clear();
                    DatosdataGridView.DataSource         = null;
                    DatosdataGridView.Columns[0].Visible = true;
                    DatosdataGridView.Columns[2].Visible = true;
                    DatosdataGridView.Columns[1].Visible = true;
                    TicketIdTextBox.Focus();
                }
            }
        }
        private void Nuevobutton_Click(object sender, EventArgs e)
        {
            FechadateTimePicker.Value = DateTime.Now;;
            IDEstudiantetextBox.Clear();
            MontoAsignaturanumericUpDown.Value = 0;
            PCTnumericUpDown.Value             = 0;
            ObservacionestextBox.Clear();
            MontotextBox.Clear();
            BuscartextBox.Clear();
            NombretextBox.Clear();

            LimpiarProviderError();
        }
Exemplo n.º 14
0
 private void Nuevobutton_Click_1(object sender, EventArgs e)
 {
     MontotextBox.Clear();
     NumerotextBox.Clear();
     //LoteriasComboBox.SelectedItem = 0;
     //Total.Clear();
     //TotalPale.Clear();
     //TotalQuiniela.Clear();
     //TotalTripleta.Clear();
     //Quiniela.Clear();
     //Pale.Clear();
     //Tripleta.Clear();
 }
Exemplo n.º 15
0
 private void Nuevobutton_Click(object sender, EventArgs e)
 {
     CantidadnumericUpDown.Value = 0;
     ComentariotextBox.Clear();
     IDnumericUpDown.Value = 0;
     MontotextBox.Clear();
     DetalledataGridView.DataSource = null;
     FechadateTimePicker.Value      = DateTime.Now;
     cotisar = new Cotizaciones();
     DescripciontextBox.Clear();
     PreciotextBox.Clear();
     ArticuloIdnumericUpDown.Value = 0;
     ImportetextBox.Clear();
 }
Exemplo n.º 16
0
 private void Limpiar()
 {
     IdTextBox.Clear();
     ClientecomboBox.SelectedIndex = 0;
     MontotextBox.Clear();
     CuotaPtextBox.Clear();
     FechaIdateTimePicker.Text = string.Empty;
     FechaFdateTimePicker.Text = string.Empty;
     SemanaNotextBox.Clear();
     PagoTotaltextBox.Clear();
     IdTextBox.Enabled      = false;
     BuscarButton.Enabled   = false;
     GuardarButton.Enabled  = true;
     EliminarButton.Enabled = false;
 }
Exemplo n.º 17
0
        private void Nuevobutton_Click_1(object sender, EventArgs e)
        {
            MontotextBox.Clear();
            JugadatextBox.Clear();
            IdLoteriatextBox.Clear();
            NombreLoteriatextBox.Clear();
            TotaltextBox.Clear();
            TicketIdTextBox.Clear();

            Usuariolabel.Text                    = "";
            DatosdataGridView.DataSource         = null;
            DatosdataGridView.Columns[0].Visible = true;
            DatosdataGridView.Columns[2].Visible = true;
            DatosdataGridView.Columns[1].Visible = true;
            IdLoteriatextBox.Focus();
        }
Exemplo n.º 18
0
        private void GuardarButton_Click_1(object sender, EventArgs e)
        {
            if (Utilidades.ToInt(TotaltextBox.Text) > 0)
            {
                int Id;
                int.TryParse(TicketIdTextBox.Text, out Id);
                ticket.IdLoteria     = Utilidades.ToInt(IdLoteriatextBox.Text);
                ticket.Fecha         = FechadateTimePicker.Value;
                ticket.Usuario       = "Juan peres";
                ticket.Nulo          = false;
                ticket.Total         = Utilidades.ToInt(TotaltextBox.Text);
                ticket.IdDetalle     = 1;
                ticket.IdTicket      = Id;
                ticket.NombreLoteria = NombreLoteriatextBox.Text;

                if (TicketsBLL.Guardar(ticket))
                {
                    MessageBox.Show("Guardado");
                    DatosdataGridView.DataSource = null;
                    MontotextBox.Clear();
                    JugadatextBox.Clear();
                    IdLoteriatextBox.Clear();
                    NombreLoteriatextBox.Clear();
                    TotaltextBox.Clear();
                    TicketIdTextBox.Clear();
                    Usuariolabel.Text                    = "";
                    DatosdataGridView.DataSource         = null;
                    DatosdataGridView.Columns[0].Visible = true;
                    DatosdataGridView.Columns[2].Visible = true;
                    DatosdataGridView.Columns[1].Visible = true;

                    IdLoteriatextBox.Focus();
                }
                else
                {
                    MessageBox.Show("Error hay Guardar el ticket");
                    IdLoteriatextBox.Focus();
                }
            }
            else
            {
                MessageBox.Show("Tienes que insertar al menos una jugada...");
                IdLoteriatextBox.Focus();
            }
        }
Exemplo n.º 19
0
        private bool Validar()
        {
            bool   validado    = true;
            string obligatorio = "Campo obligatorio";

            if (string.IsNullOrWhiteSpace(IDnumericUpDown.Text))
            {
                errorProvider.SetError(IDnumericUpDown, obligatorio);
                IDnumericUpDown.Focus();
                validado = false;
            }
            if (string.IsNullOrWhiteSpace(MontotextBox.Text))
            {
                errorProvider.SetError(MontotextBox, obligatorio);
                MontotextBox.Focus();
                validado = false;
            }
            if (ToDecimal(MontotextBox.Text) < 1)
            {
                errorProvider.SetError(MontotextBox, "El monto debe ser mayor a 0");
                MontotextBox.Focus();
                validado = false;
            }
            if (string.IsNullOrWhiteSpace(TiempotextBox.Text))
            {
                errorProvider.SetError(TiempotextBox, obligatorio);
                TiempotextBox.Focus();
                validado = false;
            }
            if (ToInt(TiempotextBox.Text) < 1)
            {
                errorProvider.SetError(TiempotextBox, "El tiempo debe ser mayor a un mes");
                TiempotextBox.Focus();
                validado = false;
            }
            if (string.IsNullOrWhiteSpace(FechadateTimePicker.Value.ToString()))
            {
                errorProvider.SetError(FechadateTimePicker, obligatorio);
                FechadateTimePicker.Focus();
                validado = false;
            }

            return(validado);
        }
 private void NuevobuttonC_Click(object sender, EventArgs e)
 {
     CotizaciontextBox.Clear();
     FechadateTimePicker.Value = DateTime.Now;
     ComentariotextBox.Clear();
     ArticuloIDnumericUpDown.Value = 0;
     CantidadnumericUpDown.Value   = 0;
     MontotextBox.Clear();
     DescripciontextBox.Clear();
     PreciotextBox.Clear();
     DetalledataGridView.ClearSelection();
     Cotisar.CotizacionDetalle      = new List <CotizacionesDetalle>();
     DetalledataGridView.DataSource = null;
     DetallenumericUpDown.Value     = 0;
     DetallenumericUpDown.Enabled   = false;
     BuscarDetalllebutton.Enabled   = false;
     LimpiarProvider();
     Cotisar.Monto = 0;
 }
Exemplo n.º 21
0
        private void Buscarbutton_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(TicketIdTextBox.Text))
            {
                MessageBox.Show("LLena el campo con el numero de Ticket");
            }
            else
            {
                var ticket = TicketsBLL.Buscar(Convert.ToInt32(TicketIdTextBox.Text));
                if (ticket != null)
                {
                    IdLoteriatextBox.Text                = (ticket.IdLoteria).ToString();
                    NombreLoteriatextBox.Text            = (ticket.NombreLoteria).ToString();
                    FechadateTimePicker.Text             = (ticket.Fecha).ToString();
                    Usuariolabel.Text                    = ticket.Usuario.ToString();
                    TotaltextBox.Text                    = ticket.Total.ToString();
                    DatosdataGridView.DataSource         = null;
                    DatosdataGridView.DataSource         = ticket.detalles;
                    DatosdataGridView.Columns[0].Visible = false;
                    DatosdataGridView.Columns[1].Visible = false;
                    DatosdataGridView.Columns[2].Visible = false;
                }
                else
                {
                    MessageBox.Show("Este Ticket no Existe");

                    MontotextBox.Clear();
                    JugadatextBox.Clear();
                    IdLoteriatextBox.Clear();
                    NombreLoteriatextBox.Clear();
                    TotaltextBox.Clear();
                    TicketIdTextBox.Clear();
                    DatosdataGridView.DataSource         = null;
                    DatosdataGridView.Columns[0].Visible = true;
                    DatosdataGridView.Columns[2].Visible = true;
                    DatosdataGridView.Columns[1].Visible = true;
                    TicketIdTextBox.Focus();
                }
            }
        }
Exemplo n.º 22
0
        private void Limpiar()
        {
            Detalle = new Entidades.FacturasProductos();
            Factura = new Entidades.Facturas();

            FacturaIdmaskedTextBox.Clear();
            ClienteIdmaskedTextBox.Clear();
            NombreClientetextBox.Clear();
            MontotextBox.Clear();
            FechadateTimePicker.Value = DateTime.Now;
            ProductoIdmaskedTextBox.Clear();
            DescripcionProductotextBox.Clear();
            ProductodataGridView.DataSource = null;
            CantidadnumericUpDown.Value     = 0;
            PreciotextBox.Clear();
            DevueltatextBox.Clear();
            RecibidomaskedTextBox.Clear();
            ComentariotextBox.Clear();
            NombreClienteerrorProvider.Clear();
            CantidaderrorProvider.Clear();
            ProductoerrorProvider.Clear();
            RecibidoerrorProvider.Clear();
            GriderrorProvider.Clear();
            ClienteIderrorProvider.Clear();
            FacturaIderrorProvider.Clear();
            DevueltaerrorProvider.Clear();
            FormaPagoComboBox.Text = null;

            ClienteIdmaskedTextBox.Enabled  = true;
            ProductoIdmaskedTextBox.Enabled = true;
            FechadateTimePicker.Enabled     = true;
            ComentariotextBox.Enabled       = true;
            FormaPagoComboBox.Enabled       = true;
            ProductodataGridView.Enabled    = true;
            RecibidomaskedTextBox.Enabled   = false;
            FacturaIdmaskedTextBox.Enabled  = true;
            CantidadnumericUpDown.Enabled   = false;
        }
Exemplo n.º 23
0
        private void Guardarbutton_Click(object sender, EventArgs e)
        {
            if (validar(3))
            {
                MessageBox.Show("Dijite un Monto");
                return;
            }

            if (validar(4))
            {
                MessageBox.Show("Digite un monto", "Validar");
                return;
            }
            if (validar(2))
            {
                MessageBox.Show("Favor de Llenar las Casillas");
                return;
            }

            else
            {
                bool paso = false;


                EntradaInversion entrada = Llenaclase();

                if (EntradaInversionIDnumericUpDown.Value == 0)
                {
                    paso = EntradaInversionBLL.Guardar(entrada);
                }
                else
                {
                    int id    = Convert.ToInt32(EntradaInversionIDnumericUpDown.Value);
                    var entry = EntradaInversionBLL.Buscar(id);

                    if (entry != null)
                    {
                        paso = EntradaInversionBLL.Editar(entrada);
                    }
                    else
                    {
                        MessageBox.Show("Id no existe", "Falló",
                                        MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }


                EntradaInversionIDnumericUpDown.Value = 0;
                FechadateTimePicker.Value             = DateTime.Now;
                MontotextBox.Clear();
                InversionerrorProvider.Clear();
                if (paso)
                {
                    MessageBox.Show("Guardado!", "Exitoso", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    EntradaInversionIDnumericUpDown.Value = 0;
                    FechadateTimePicker.Value             = DateTime.Now;
                    MontotextBox.Clear();
                    InversionerrorProvider.Clear();
                }
                else
                {
                    MessageBox.Show("No pudo Guardar!", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Exemplo n.º 24
0
 public void LimpiarTextBox()
 {
     IdEstudiantetextBox.Clear();
     MontotextBox.Clear();
     BalancetextBox.Clear();
 }