Exemplo n.º 1
0
        private void finalizarTSMI_Click(object sender, EventArgs e)
        {
            try
            {
                if (!(cajaIniciada()))
                {
                    return;
                }

                if ((Application.OpenForms.Cast <Form>().FirstOrDefault(x => x is frmCaja) != null) || (Application.OpenForms.Cast <Form>().FirstOrDefault(x => x is frmTipoMovCaja) != null) || (Application.OpenForms.Cast <Form>().FirstOrDefault(x => x is frmComprasPrincipal) != null))
                {
                    MessageBox.Show("Para realizar el Cierre de Caja, debe cerrar los formularios de Caja, Compras y Ventas.", "Atención.", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                frmCerrarCaja cerrarCaja = new frmCerrarCaja();
                cerrarCaja.ShowDialog();

                FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();
                Entidades.Caja caja         = new Entidades.Caja();
                string         fechaSistema = fg.appFechaSistema().ToString().Substring(0, 10);
                if (caja.obtenerEstado() == 0)
                {
                    cajaTTS.Text      = "Caja Cerrada";
                    cajaTTS.BackColor = Color.White;
                    cajaTTS.ForeColor = Color.Black;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString(), "Atención.", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 2
0
        private void mostrarFormularioCajaInicial()
        {
            if (validarInicioCaja()) 
            {
                if (hayMovimientosHoy())
                {
                    if (!(preguntoSiEliminarMovimientosHoy()))
                    {
                        return;
                    }
                    else
                    {
                        eliminarMovimientosHoy();
                    }
                }

                frmCajaInicial cajaIni = new frmCajaInicial();
                cajaIni.ShowDialog();
                FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();
                Entidades.Caja caja = new Entidades.Caja();
                string fechaSistema = fg.appFechaSistema().ToString().Substring(0, 10);
                if (caja.obtenerEstado() != 0)
                {
                    cajaTTS.Text = "Caja Iniciada: " + fechaSistema;
                    cajaTTS.BackColor = Color.Black;
                    cajaTTS.ForeColor = Color.White;
                }
            }
        }
Exemplo n.º 3
0
        private void mostrarFormularioCajaInicial()
        {
            if (validarInicioCaja())
            {
                if (hayMovimientosHoy())
                {
                    if (!(preguntoSiEliminarMovimientosHoy()))
                    {
                        return;
                    }
                    else
                    {
                        eliminarMovimientosHoy();
                    }
                }

                frmCajaInicial cajaIni = new frmCajaInicial();
                cajaIni.ShowDialog();
                FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();
                Entidades.Caja caja         = new Entidades.Caja();
                string         fechaSistema = fg.appFechaSistema().ToString().Substring(0, 10);
                if (caja.obtenerEstado() != 0)
                {
                    cajaTTS.Text      = "Caja Iniciada: " + fechaSistema;
                    cajaTTS.BackColor = Color.Black;
                    cajaTTS.ForeColor = Color.White;
                }
            }
        }
Exemplo n.º 4
0
 private void FrmPrincipal_Load(object sender, EventArgs e)
 {
     IniciarPrograma(); // RR 2014-03-22.
     FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();
     Entidades.Caja caja = new Entidades.Caja();
     string fechaSistema = fg.appFechaSistema().ToString().Substring(0,10);
     if (caja.obtenerEstado() != 0)
     {
         cajaTTS.Text = "Caja Iniciada: " + fechaSistema;
         cajaTTS.BackColor = Color.Black;
         cajaTTS.ForeColor = Color.White;
     }
 }
Exemplo n.º 5
0
        private void FrmPrincipal_Load(object sender, EventArgs e)
        {
            IniciarPrograma(); // RR 2014-03-22.
            FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();
            Entidades.Caja caja         = new Entidades.Caja();
            string         fechaSistema = fg.appFechaSistema().ToString().Substring(0, 10);

            if (caja.obtenerEstado() != 0)
            {
                cajaTTS.Text      = "Caja Iniciada: " + fechaSistema;
                cajaTTS.BackColor = Color.Black;
                cajaTTS.ForeColor = Color.White;
            }
        }
Exemplo n.º 6
0
        public DateTime appFechaSistema()
        {
            try
            {
                ConectarBD         Conex = new ConectarBD();
                FuncionesGenerales fg    = new FuncionesGenerales();
                DataSet            Ds    = new DataSet();
                String             ssQL  = "EXEC dbo.adp_FecSis";

                Ds = Conex.ejecutarQuerySelect(ssQL);
                return(DateTime.Parse(Ds.Tables[0].Rows[0]["FECHA_SISTEMA"].ToString()));
            }
            catch (Exception e)
            {
                throw new System.ArgumentException("[Error] -  [" + e.Message.ToString() + "]");
            }
        }
Exemplo n.º 7
0
        public DateTime appFechaSistema()
        {
            try
            {
                ConectarBD Conex = new ConectarBD();
                FuncionesGenerales fg = new FuncionesGenerales();
                DataSet Ds = new DataSet();
                String ssQL = "EXEC dbo.adp_FecSis";

                Ds = Conex.ejecutarQuerySelect(ssQL);
                return DateTime.Parse(Ds.Tables[0].Rows[0]["FECHA_SISTEMA"].ToString());
            }
            catch (Exception e)
            {
                throw new System.ArgumentException("[Error] -  [" + e.Message.ToString() + "]");
            }
        }
Exemplo n.º 8
0
 private bool validarInicioCaja()
 {
     try
     {
         FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();
         Entidades.Caja caja = new Entidades.Caja();
         if (caja.obtenerEstado() != 0)
         {
             MessageBox.Show("No se puede iniciar la caja debido a que no se cerró la correspondiente al día " + caja.obtenerFechaCajaAbierta() + ".", "Atención.", MessageBoxButtons.OK, MessageBoxIcon.Information);
             return(false);
         }
         return(true);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message.ToString(), "Atención.", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return(false);
     }
 }
Exemplo n.º 9
0
 private bool validarInicioCaja()
 {
     try
     {
         FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();
         Entidades.Caja caja = new Entidades.Caja();
         if (caja.obtenerEstado() != 0)
         {
             MessageBox.Show("No se puede iniciar la caja debido a que no se cerró la correspondiente al día " + caja.obtenerFechaCajaAbierta() + ".", "Atención.", MessageBoxButtons.OK, MessageBoxIcon.Information);
             return false;
         }
         return true;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message.ToString(), "Atención.", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return false;
     }
 }
Exemplo n.º 10
0
        private void finalizarTSMI_Click(object sender, EventArgs e)
        {
            try
            {
                if (!(cajaIniciada())) { return; }

                if ((Application.OpenForms.Cast<Form>().FirstOrDefault(x => x is frmCaja) != null) || (Application.OpenForms.Cast<Form>().FirstOrDefault(x => x is frmTipoMovCaja) != null) || (Application.OpenForms.Cast<Form>().FirstOrDefault(x => x is frmComprasPrincipal) != null))
                {
                    MessageBox.Show("Para realizar el Cierre de Caja, debe cerrar los formularios de Caja, Compras y Ventas.", "Atención.", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                frmCerrarCaja cerrarCaja = new frmCerrarCaja();
                cerrarCaja.ShowDialog();

                FuncionesGenerales.FuncionesGenerales fg = new FuncionesGenerales.FuncionesGenerales();
                Entidades.Caja caja = new Entidades.Caja();
                string fechaSistema = fg.appFechaSistema().ToString().Substring(0, 10);
                if (caja.obtenerEstado() == 0)
                {
                    cajaTTS.Text = "Caja Cerrada";
                    cajaTTS.BackColor = Color.White;
                    cajaTTS.ForeColor = Color.Black;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString(), "Atención.", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }