Example #1
0
        private void bt_cuota_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(cmb_cuota.Text))
            {
                MessageBox.Show("Elija cantidad de cuotas");
            }
            else
            {
                //Compra
                DateTime fechaSistema = DataBase.ObtenerFechaSistema();
                Compra   compra       = new Compra();
                compra.com_fecha   = fechaSistema;
                compra.com_cli     = this.idCliente;
                compra.com_tipoDoc = this.tipoDoc;
                compra.cabinas     = cabinasCompradas;
                compra.com_mp      = CompraFunc.ObtenerIDMp(cmb_mp.Text);
                compra.com_detalle = String.Concat("N° Cuotas: ", cmb_cuota.Text);
                SqlDataReader reader = CompraFunc.CrearCompra(compra);

                Int32 idCompra = 0;

                if (reader.Read())
                {
                    idCompra = Convert.ToInt32(reader.GetDecimal(0));
                }

                MessageBox.Show("Compra realizada");
                MostrarVoucher mv = new MostrarVoucher(compra, null, idCompra, this.esCompra);
                this.Hide();
                mv.ShowDialog();
                this.Close();
            }
        }
Example #2
0
        private void bt_cuota_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(cmb_cuota.Text))
            {
                MessageBox.Show("Elija cantidad de cuotas");
            }
            else
            {
                //Compra
                DateTime fechaSistema = DataBase.ObtenerFechaSistema();
                Compra   compra       = new Compra();
                compra.com_fecha = fechaSistema;
                DataGridViewRow dataRow = dgv_cabina.Rows[(dgv_cabina.CurrentRow.Index)];
                compra.com_cli     = Convert.ToInt32(dataRow.Cells["Documento"].Value.ToString());
                compra.com_tipoDoc = Convert.ToInt32(Client.ObtenerIDTipoDoc(dataRow.Cells["TipoDoc"].Value.ToString()));
                compra.cabinas     = this.cabinasCompradas;
                compra.com_mp      = CompraFunc.ObtenerIDMp(cmb_mp.Text);
                compra.com_detalle = String.Concat("N° Cuotas: ", cmb_cuota.Text);
                SqlDataReader reader = CompraFunc.CrearCompra(compra);

                Int32 idCompra = 0;

                if (reader.Read())
                {
                    idCompra = Convert.ToInt32(reader.GetDecimal(0));
                }
                CompraFunc.ComprarReserva(Convert.ToInt32(txt_reserva.Text.Trim()));
                MessageBox.Show("Compra realizada");
                MostrarVoucher mv = new MostrarVoucher(compra, null, idCompra, true);
                this.Hide();
                mv.ShowDialog();
                this.Close();
            }
        }
Example #3
0
        private void bt_mp_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(cmb_mp.Text))
            {
                MessageBox.Show("Elija medio de pago");
            }
            else
            {
                //Credito
                if (CompraFunc.ObtenerIDMp(cmb_mp.Text) == 2)
                {
                    lb_cuota.Visible  = true;
                    bt_cuota.Visible  = true;
                    cmb_cuota.Visible = true;
                    bt_mp.Enabled     = false;
                    cmb_mp.Enabled    = false;
                }
                else
                {
                    //Compra
                    DateTime fechaSistema = DataBase.ObtenerFechaSistema();
                    Compra   compra       = new Compra();
                    compra.com_fecha   = fechaSistema;
                    compra.com_cli     = this.idCliente;
                    compra.com_tipoDoc = this.tipoDoc;
                    compra.cabinas     = cabinasCompradas;
                    compra.com_mp      = CompraFunc.ObtenerIDMp(cmb_mp.Text);
                    SqlDataReader reader = CompraFunc.CrearCompra(compra);

                    Int32 idCompra = 0;

                    if (reader.Read())
                    {
                        idCompra = Convert.ToInt32(reader.GetDecimal(0));
                    }

                    MessageBox.Show("Compra realizada");
                    MostrarVoucher mv = new MostrarVoucher(compra, null, idCompra, this.esCompra);
                    this.Hide();
                    mv.ShowDialog();
                    this.Close();
                }
            }
        }