Пример #1
0
        private void Busquedabutton_Click_1(object sender, EventArgs e)
        {
            int id;

            int.TryParse(IDNumericUpDown.Text, out id);
            POSRepositorio repo = new POSRepositorio();
            POS            p    = new POS();

            p = repo.Buscar(id);

            Limpiar();

            if (p == null)
            {
                MessageBox.Show("No encontrado");
            }
            else
            {
                if (p.Estado == false)
                {
                    LlenarCampo(p);
                }
                else
                {
                    MessageBox.Show("Ya este registro del pos esta cerrado en caja");
                }
            }
        }
Пример #2
0
        private void Eliminarbutton_Click(object sender, EventArgs e)
        {
            int id;

            int.TryParse(IDNumericUpDown.Text, out id);
            POSRepositorio repo = new POSRepositorio();

            Limpiar();

            if (repo.Buscar(id) != null)
            {
                if (repo.Eliminar(id))
                {
                    MessageBox.Show("Eliminado");
                }
                else
                {
                    MessageBox.Show("No se pudo eliminar");
                }
            }
            else
            {
                MessageBox.Show("No encontrado");
            }
        }
Пример #3
0
        public bool ExisteEnLaBaseDeDatos()
        {
            POSRepositorio repo = new POSRepositorio();
            POS            p    = repo.Buscar((int)IDNumericUpDown.Value);

            return(p != null);
        }
        private void Guardarbutton_Click(object sender, EventArgs e)
        {
            bool paso = false;

            RepositorioBase <Cierre> repo = new RepositorioBase <Cierre>();
            Cierre cierre = new Cierre();


            if (!Validar())
            {
                return;
            }

            POSRepositorio repositorioPOS = new POSRepositorio();

            foreach (var item in repositorioPOS.GetList(r => true))
            {
                foreach (var aux in ListaPOS)
                {
                    if (item.PosId == aux.PosId)
                    {
                        item.Estado = true;

                        repositorioPOS.Modificar(item);
                    }
                }
            }


            cierre = LlenarClase();

            if (IDNumericUpDown.Value == 0)
            {
                paso = repo.Guardar(cierre);
                Limpiar();
            }
            else
            {
                if (!ExisteEnLaBaseDeDatos())
                {
                    MessageBox.Show("No esta registrado para modificar");
                    return;
                }
                paso = repo.Modificar(cierre);
            }

            if (paso)
            {
                MessageBox.Show("Guardado");
                DSETextBox.Text  = "0";
                DSTTextBox.Text  = "0";
                DSTGTextBox.Text = "0";
            }
            else
            {
                MessageBox.Show("No fue posible guardar");
            }
        }
Пример #5
0
        private void ReportesButton_Click(object sender, EventArgs e)
        {
            POSRepositorio repositorio = new POSRepositorio();

            ListaVentasPOS = repositorio.GetList(p => true).Where(p => p.Fecha.Date == DateTime.Today).ToList();

            if (ListaVentasPOS.Count == 0)
            {
                MessageBox.Show("No hay datos para imprimir");
                return;
            }

            VentasPOSReportViewer prestamosReportViewer = new VentasPOSReportViewer(ListaVentasPOS);

            prestamosReportViewer.ShowDialog();
        }
Пример #6
0
        private void Guardarbutton_Click(object sender, EventArgs e)
        {
            bool paso = false;

            POSRepositorio repo = new POSRepositorio();
            POS            p    = new POS();

            if (!validar())
            {
                return;
            }

            p = LlenarClase();

            if (IDNumericUpDown.Value == 0)
            {
                paso = repo.Guardar(p);
            }
            else
            {
                if (!ExisteEnLaBaseDeDatos())
                {
                    MessageBox.Show("No esta registrado");
                    return;
                }
                paso = repo.Modificar(p);
            }

            if (paso)
            {
                Limpiar();
                MessageBox.Show("Guardado");
            }
            else
            {
                MessageBox.Show("No fue posible guardar");
            }
        }
        private void rCierreCaja_Load(object sender, EventArgs e)
        {
            ListaPOS = new List <POS>();
            POSRepositorio repos = new POSRepositorio();
            POS            pos   = new POS();

            CargarGrid();

            var    Lista         = repos.GetList(p => true);
            double totalefectivo = 0;
            double totalcredito  = 0;
            double totalgeneral  = 0;

            foreach (var item in Lista)
            {
                if (!item.Estado)
                {
                    if (item.TipoPago == "Tarjeta credito")
                    {
                        totalcredito += item.Total;
                    }
                    else
                    {
                        totalefectivo += item.Total;
                    }

                    ListaPOS.Add(item);
                }
            }

            totalgeneral = totalefectivo + totalcredito;

            DSETextBox.Text  = Convert.ToString(totalefectivo);
            DSTTextBox.Text  = Convert.ToString(totalcredito);
            DSTGTextBox.Text = Convert.ToString(totalgeneral);
        }