Ejemplo n.º 1
0
        private void CerrarCaja_Load(object sender, EventArgs e)
        {
            Models.Tickets ticket = new Models.Tickets();
            using (ticket)
            {
                List <Models.Tickets> lista = ticket.getbyUser(Convert.ToInt16(Inicial.id_usario));
                double        total         = 0;
                Models.Cortes cortes        = new Models.Cortes();
                using (cortes)
                {
                    List <Models.Cortes> ultimo = cortes.getnoclose(Convert.ToInt16(Inicial.id_usario));
                    foreach (Models.Cortes item in ultimo)
                    {
                        total += item.Caja_inicial;
                    }

                    foreach (Models.Tickets item in lista)
                    {
                        total += item.Total;
                    }
                    lbEsperado.Text   = string.Format("{0:#,0.00}", total);
                    txtReal.TextAlign = HorizontalAlignment.Right;
                    txtReal.Text      = "0.00";
                    calcula();
                }
            }
        }