Example #1
0
        public frmAperturarCaja(Empleado empleado)
        {
            try
            {
                InitializeComponent();
                this.empleado = empleado;
                this.turnoxempleado =  TurnoXEmpleadoBL.findTurnoXEmpleado(empleado.Id);
                this.txtMontoInicialSoles.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaNumerico);
                this.txtMontoInicialDolares.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaNumerico);
                this.txtMontoInicialSoles.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaBlancos);
                this.txtMontoInicialDolares.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaBlancos);
                inicializarCampos();
                cajaSeleccionada = null;
                tipoCambio = new TipoCambioBL().DameUltimo();

                if (continuar)
                {
                    if (!ValidarTurnos())
                    {
                        Utils.Utils.Error(null, "Su turno de trabajo aun no empieza");
                        this.continuar = false;
                        this.Dispose();

                    }
                }
                else this.Dispose();

            }
            catch (Exception exception) { Utils.Utils.Error(null, "EL empleado no tiene turno asignado"); continuar = false; }
        }
Example #2
0
        public frmTipoCambio()
        {
            InitializeComponent();
            //obtener el ultimo
            txtCompraNuevo.KeyPress += new KeyPressEventHandler(Utils.Utils.ValidaNumerico);
            txtVentaNuevo.KeyPress += new KeyPressEventHandler(Utils.Utils.ValidaNumerico);
            try
            {
                TipoCambioBL objTipoCambioBL = new TipoCambioBL();
                TipoCambio objTipoCamb = new TipoCambio();
                objTipoCamb = objTipoCambioBL.DameUltimo();
                txtCompraAnt.Text = objTipoCamb.Compra.ToString();
                txtVentaAnt.Text = objTipoCamb.Venta.ToString();
                string strFechaActual = DateTime.Now.ToString("dd/MM/yyyy") ;

                if (objTipoCamb.FechaRegistro.ToString("dd/MM/yyyy")== strFechaActual)
                {
                    btnAceptar.Enabled = false;
                    txtCompraNuevo.Enabled = false;
                    txtVentaNuevo.Enabled = false;
                    lblMensaje.Visible = true;
                }

            }catch(Exception exception){
                txtCompraAnt.Text = "No registrado";
                txtVentaAnt.Text = "No registrado";
            }
        }
Example #3
0
 public frmCerrarCaja(Empleado empleado)
 {
     InitializeComponent();
     this.txtSaldoDolares.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaNumerico);
     this.txtSaldoSoles.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaNumerico);
     this.txtSaldoDolares.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaBlancos);
     this.txtSaldoDolares.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaBlancos);
     this.empleado = empleado;
     tipoCambio = new TipoCambioBL().DameUltimo();
 }
Example #4
0
        public frmDetalleVenta(Empleado empleado,TipoCambio tipoCambio)
        {
            InitializeComponent();
            this.empleado = empleado;
            this.tipoCambio = tipoCambio;
            txtNumeroMedio.KeyPress += new KeyPressEventHandler(Utils.Utils.ValidaNumerico);

            txtMonto.KeyPress += new KeyPressEventHandler(Utils.Utils.ValidaNumerico);
            txtMonto.KeyPress += new KeyPressEventHandler(enterEvent);
        }
Example #5
0
        public frmCerrarCaja(Empleado empleado, TurnoXEmpleado turnoxempleado, RegistroCaja registroCaja, Caja caja, TipoCambio tipoCambio)
        {
            InitializeComponent();

            this.turnoxempleado = turnoxempleado;
            this.registroCaja = registroCaja;
            this.caja = caja;
            this.tipoCambio = tipoCambio;

            this.txtSaldoDolares.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaNumerico);
            this.txtSaldoSoles.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaNumerico);
            this.txtSaldoDolares.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaBlancos);
            this.txtSaldoDolares.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaBlancos);
            this.empleado = empleado;
        }
        public frmDetalleOrdenCompra(Empleado empleado, OrdenCompra oc,TipoCambio tipoCambio)
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();
            this.empleado = empleado;
            this.tipoCambio = tipoCambio;
            lblAlerta.Visible = false;
            txtElaborado.Text = empleado.Nombres + " " + empleado.ApellidoPaterno;
            if (oc != null)
            {
                this.ordenCompra = oc;
                lblEstado.Text = oc.Estado;
                MostrarOrdenCompra(this.ordenCompra);
                bloquearCampos();
                btnDesdeCotizacion.Visible = false;
                if (oc.Estado != "Pendiente")//aprobada o rechazada
                {
                    btnModificar.Enabled = false;
                    btnAprobar.Enabled = false;
                    btnEliminar.Enabled = false;
                    lblAlerta.Visible = true;
                    lblAlerta.Text = "Esta orden de compra ya fue " + oc.Estado;
                }
                else {
                    lblAlerta.Visible = false;

                }
            }
            else {

                ordenCompra = new OrdenCompra();
                pnlEstado.Visible = false;
                ordenCompra.Id = 0;
                btnModificar.Text = "Grabar";
                ocLineas = new List<OrdenCompraLinea>();
            }

            cboLocalEntrega.DisplayMember = "Nombre";
            cboLocalEntrega.DataSource = new LocalBL().GetAll();
            cboMoneda.DisplayMember = "Nombre";
            cboMoneda.DataSource = new TipoMonedaBL().GetAll();

            validaFuncionalidades();
        }
Example #7
0
        private void btnAbrirCaja_Click(object sender, EventArgs e)
        {
            bool continuar = true;
            if (!vacio())
            {
                cajaSeleccionada = (Caja)cmbCajas.SelectedItem;
                if (cajaSeleccionada != null)
                {
                    if (tipoCambio == null)
                    {
                        if (Utils.Utils.ContinuarOperacion("No se ha registrado el tipo de cambio desea continuar?"))
                        {
                            tipoCambio = new TipoCambio();
                            tipoCambio.Venta = 0;
                        }
                        else continuar = false;
                    }
                    if (continuar)
                    {
                        try
                        {
                            RegistroCaja registroCaja = new RegistroCaja();
                            registroCaja.FechaRegistro = DateTime.Today;
                            registroCaja.MontoInicioDia = tipoCambio.Venta * float.Parse(txtMontoInicialDolares.Text) + float.Parse(txtMontoInicialSoles.Text);
                            registroCaja.Estado = "Abierto";
                            registroCaja.MontoVentas = 0;
                            registroCaja.MontoDevoluciones = 0;
                            registroCaja.MontoFinDia = 0;
                            registroCaja.Caja = cajaSeleccionada;
                            registroCaja.TurnoXEmpleado = turnoxempleado;
                            RegistroCajaBL.Grabar(registroCaja);
                            Utils.Utils.OK(Utils.Utils.REGISTRO_OK);
                        }
                        catch (Exception exception) { Utils.Utils.Error(null,"El formato ingresado no es correcto"); }
                    }
                }

            }
            else Utils.Utils.Error(null,"Debe completar todos los campos");
        }
Example #8
0
        public void Save(TipoCambio instance)
        {
            ISession hisession = null;
            try
            {
                hisession = NHibernateHelper.GetCurrentSession();
                hisession.BeginTransaction();
                hisession.Merge(instance);
                hisession.Transaction.Commit();
                hisession.Close();
            }
            catch (Exception ex)
            {
                if (hisession != null)
                {
                    if (hisession.IsOpen)
                    {
                        hisession.Close();

                    }
                }

            }
        }
Example #9
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            if (txtVentaNuevo.Text.Length <= 0 || txtCompraNuevo.Text.Length <= 0)
                MessageBox.Show("Debe de Completar los datos");
            else
            {
                TipoCambioBL objTipoCambioBL = new TipoCambioBL();
                TipoCambio objTipoCamb = new TipoCambio();

                string nuevaCompra = txtCompraNuevo.Text.Trim();
                string nuevaVenta = txtVentaNuevo.Text.Trim();

                if (nuevaCompra.Length != 0 && nuevaVenta.Length != 0 )
                {
                    objTipoCamb.Compra = Convert.ToSingle(txtCompraNuevo.Text);
                    objTipoCamb.Venta = Convert.ToSingle(txtVentaNuevo.Text);
                    objTipoCamb.FechaRegistro = System.DateTime.Today;
                    objTipoCambioBL.Grabar(objTipoCamb);
                    Utils.Utils.OK(Utils.Utils.REGISTRO_OK);
                    this.Close();
                }
                else MessageBox.Show("Debe completar los campos");
            }
        }
Example #10
0
 private void btnCerrarCaja_Click(object sender, EventArgs e)
 {
     bool continuar = true;
     if (!vacio())
     {
          if (tipoCambio == null)
             {
                 if (Utils.Utils.ContinuarOperacion("No se ha registrado el tipo de cambio desea continuar?"))
                 {
                     tipoCambio = new TipoCambio();
                     tipoCambio.Venta = 0;
                 }
                 else continuar = false;
             }
                 if (continuar)
             {
                 try
                 {
                     registroCaja.MontoFinDia =  tipoCambio.Venta * float.Parse(txtSaldoDolares.Text) + float.Parse(txtSaldoSoles.Text);
                     registroCaja.Estado = "Cerrado";
                     RegistroCajaBL.Modificar(registroCaja);
                      Utils.Utils.OK(Utils.Utils.REGISTRO_OK);
                      this.Dispose();
                 }
                 catch (Exception exception) { Utils.Utils.Error(null,"El formato ingresado no es correcto"); }
             }
     }
     else Utils.Utils.Error(null,"Debe completar todos los campos");
 }
        private void frmDetalleFacturaProveedor_Load(object sender, EventArgs e)
        {
            tipoCambio = new TipoCambioBL().DameUltimo();
            lblTipoCambio.Text += "(Compra) " + tipoCambio.Compra + " / (Venta) " + tipoCambio.Venta;
            dgvDetalleFactura.CellValueChanged += new DataGridViewCellEventHandler(dgvDetalleFactura_CellValueChanged);

            cboMoneda.DisplayMember = "Nombre";
            cboMoneda.DataSource = new TipoMonedaBL().GetAll();
        }
Example #12
0
        private void RegistrarVenta_Load(object sender, EventArgs e)
        {
            cboMoneda.DisplayMember = "Nombre";
            cboMoneda.DataSource = new TipoMonedaBL().GetAll();
            cboMedioPago.SelectedIndex = 0;
            cboMoneda.SelectedIndex = 0;
            lblEmpleado.Text = empleado.Nombres + " " + empleado.ApellidoPaterno;
            lblFechaActual.Text = DateTime.Today.ToShortDateString();
            lblLocal.Text = empleado.Local.Nombre;

            tipoCambio = new TipoCambioBL().DameUltimo();
            lblTipoCambio.Text = tipoCambio.Venta.ToString();
        }
 private void frmDetalleConsignacion_Load(object sender, EventArgs e)
 {
     tipoCambio = new TipoCambioBL().DameUltimo();
     lblTipoCambio.Text += "(Compra) " + tipoCambio.Compra + " / (Venta) " + tipoCambio.Venta;
 }
        private void frmDetalleFacturaProveedor_Load(object sender, EventArgs e)
        {
            tipoCambio = new TipoCambioBL().DameUltimo();
            if (tipoCambio == null)
            {
                Utils.Utils.Mensaje("No se ha registrado tipo de cambio", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                btnRegistrar.Enabled = false;
                btnDesdeOC.Enabled = false;
            }
            lblTipoCambio.Text += "(Compra) " + tipoCambio.Compra + " / (Venta) " + tipoCambio.Venta;
            dgvDetalleFactura.CellValueChanged += new DataGridViewCellEventHandler(dgvDetalleFactura_CellValueChanged);

            cboMoneda.DisplayMember = "Nombre";
            cboMoneda.DataSource = new TipoMonedaBL().GetAll();
        }
Example #15
0
 public void Grabar(TipoCambio instance)
 {
     new TipoCambioDA().Save(instance);
 }