Exemplo n.º 1
0
        private void registrarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmTransporte frm = new frmTransporte();

            frm.MdiParent = this;
            frm.Show();
        }
Exemplo n.º 2
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            frmTransporte frm = new frmTransporte();

            frm.txtFlete.Text         = this.lblFlete.Text;
            frm.txtViatico.Text       = this.lblViaticos.Text;
            frm.txtPeaje.Text         = this.lblPeaje.Text;
            frm.txtCombustible.Text   = this.lblCombustible.Text;
            frm.txtMantenimiento.Text = this.lblMantenimiento.Text;
            frm.txtOtrosGastos.Text   = this.lblOtroGastos.Text;
            frm.cbFormaPago.Text      = this.lblFormaPagoTransporte.Text;
            decimal adelanto = 00.00m, saldo = 00.00m;

            adelanto = Convert.ToDecimal(lblAdelantoTransporte.Text);
            saldo    = Convert.ToDecimal(lblSaldoTransporte.Text);

            if (lblBanderaFecha.Text != "0")
            {
                frm.cargarTrabajador();
                frm.dtFechaLlegada.Value = Convert.ToDateTime(this.lblFechaLLegada.Text);
                frm.dtFechaSalida.Value  = Convert.ToDateTime(this.lblFechaSalida.Text);
                int idPersona;
                if (lblIdPersonaTransporte.Text == "0" || lblIdPersonaTransporte.Text == "")
                {
                    frm.cbProducto.SelectedIndex = -1;
                }
                else
                {
                    idPersona = Convert.ToInt32(lblIdPersonaTransporte.Text);
                    frm.cbProducto.SelectedValue = idPersona;
                }

                if (lblFormaPagoTransporte.Text == "CREDITO")
                {
                    frm.txtAdelanto.Visible = true;
                    frm.txtAdelanto.Text    = lblAdelantoTransporte.Text;
                    frm.txtSaldo.Visible    = true;
                    frm.txtSaldo.Text       = lblSaldoTransporte.Text;
                }
            }

            if (lblTotalTransporte.Text == "00.00")
            {
                frm.txtTotal.Text = this.lblFlete.Text;
            }
            else
            {
                frm.txtTotal.Text = this.lblTotalTransporte.Text;
            }

            frm.ShowDialog();
        }