private void Inicializar()
        {
            cmbVencido.Items.Clear();
            cmbVencido.Items.Add(new RadComboBoxItem("-- Todos --", ""));
            cmbVencido.Items.Add(new RadComboBoxItem("Vencidos", "V"));
            cmbVencido.Items.Add(new RadComboBoxItem("Vigente", "C"));
            cmbVencido.Sort = RadComboBoxSort.Ascending;
            cmbVencido.SortItems();
            cmbVencido.SelectedValue = "C";

            Funciones funcion = new Funciones();

            txtAnio.Value = funcion.GetLocalDateTime(session.Minutos).Year;
            Semana semana = new Semana();

            semana.Sem_FechaAct = funcion.GetLocalDateTime(session.Minutos);
            semana.Id_Emp       = session.Id_Emp;
            semana.Id_Cd        = session.Id_Cd_Ver;
            CN_CatSemana cn_semana   = new CN_CatSemana();
            int          verificador = 0;

            cn_semana.ConsultaSemanaActual(ref semana, session.Emp_Cnx, ref verificador);
            if (verificador > 0 && semana.Id_Sem != 0)
            {
                txtSem.Value = semana.Id_Sem;
                rg1.Rebind();
            }
            else
            {
                Alerta("Aun no se han configurado las semanas del periodo actual");
            }
        }
예제 #2
0
 public SemanaResponse(Semana semana)
 {
     foreach (var item in semana.Dias)
     {
         Dias.Add(new DiaResponse(item));
     }
 }
예제 #3
0
        private bool BO_Cabecera(string fileName)
        {
            string Linea;

            semanaToImport = null;

            try
            {
                if (!File.Exists(fileName))
                {
                    return(false);
                }

                StreamReader fileReader = new StreamReader(fileName);
                Linea = fileReader.ReadLine();
                string[] arrLinea = Linea.Split(new char[] { ',', ';' });
                if (Linea != null)
                {
                    return(true);
                }
            }
            catch (Exception Exception1)
            {
                MessageBox.Show("Error: " + Exception1.Message + "\nfileName: " + fileName, "Error");
            }
            return(false);
        }
예제 #4
0
        public List <Reembolso> Generar(Semana oSemana)
        {
            List <Reembolso> lstReembolsos = new List <Reembolso>();

            List <BSP_Ticket> lstTickets = oSemana.TicketsBSP.Where(x => x.Concepto.Tipo.Equals('R')).OrderBy(x => x.Compania.Codigo).ThenBy(x => x.Moneda).ThenBy(x => x.Billete).ToList();

            List <Reembolso> lstReembolsosPesos = new List <Reembolso>();

            lstTickets.Where(x => x.Moneda == Moneda.Peso).ToList().ForEach(x => lstReembolsosPesos.Add(GetReembolso(x)));
            if (lstReembolsosPesos.Count > 0)
            {
                lstReembolsosPesos.Add(new Reembolso {
                    BoletoNro = "TOTAL", Tarifa = lstReembolsosPesos.Sum(x => x.Tarifa), Contado = lstReembolsosPesos.Sum(x => x.Contado), Credito = lstReembolsosPesos.Sum(x => x.Credito), ImpContado = lstReembolsosPesos.Sum(x => x.ImpContado), ImpCredito = lstReembolsosPesos.Sum(x => x.ImpCredito), CC = lstReembolsosPesos.Sum(x => x.CC), Importe = lstReembolsosPesos.Sum(x => x.Importe), Comision = lstReembolsosPesos.Sum(x => x.Comision), Moneda = "$", IVA = lstReembolsosPesos.Sum(x => x.IVA)
                });
                lstReembolsos.AddRange(lstReembolsosPesos);
            }

            List <Reembolso> lstReembolsosDolares = new List <Reembolso>();

            lstTickets.Where(x => x.Moneda == Moneda.Dolar).ToList().ForEach(x => lstReembolsosDolares.Add(GetReembolso(x)));
            if (lstReembolsosDolares.Count > 0)
            {
                lstReembolsosDolares.Add(new Reembolso {
                    BoletoNro = "TOTAL", Tarifa = lstReembolsosDolares.Sum(x => x.Tarifa), Contado = lstReembolsosDolares.Sum(x => x.Contado), Credito = lstReembolsosDolares.Sum(x => x.Credito), ImpContado = lstReembolsosDolares.Sum(x => x.ImpContado), ImpCredito = lstReembolsosDolares.Sum(x => x.ImpCredito), CC = lstReembolsosDolares.Sum(x => x.CC), Importe = lstReembolsosDolares.Sum(x => x.Importe), Comision = lstReembolsosDolares.Sum(x => x.Comision), Moneda = "D", IVA = lstReembolsosDolares.Sum(x => x.IVA)
                });
                lstReembolsos.AddRange(lstReembolsosDolares);
            }

            return(lstReembolsos);
        }
예제 #5
0
        static string SwitchVelho(Semana semana)
        {
            switch (semana)
            {
            case Semana.Segunda:
                return("Segunda");

            case Semana.Terca:
                return("Terça");

            case Semana.Quarta:
                return("Quarta");

            case Semana.Quinta:
                return("Quinta");

            case Semana.Sexta:
                return("Sexta");

            case Semana.Sabado:
                return("Sábado");

            case Semana.Domingo:
                return("Domingo");

            default:
                return("");
            }
            ;
        }
예제 #6
0
        public async Task <IActionResult> Edit(int id, [Bind("SemanaId,Contenido,Fecha")] Semana semana)
        {
            if (id != semana.SemanaId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(semana);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SemanaExists(semana.SemanaId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(semana));
        }
예제 #7
0
        public void Reset()
        {
            Semana oSemana = Publics.Semana;

            if (oSemana != null)
            {
                lblAgencia.Text     = oSemana.Agencia != null ? oSemana.Agencia.Nombre : "(Ninguna)";
                lblPeriodo.Text     = oSemana.Periodo.ToShortDateString();
                lblFechaDesde.Text  = oSemana.FechaDesde.ToShortDateString();
                lblFechaHasta.Text  = oSemana.FechaHasta.ToShortDateString();
                lblBSPCargado.Text  = oSemana.BSPCargado ? "Si" : "No";
                lblBOCargado.Text   = oSemana.BOCargado ? "Si" : "No";
                btnReportar.Enabled = oSemana.BSPCargado || oSemana.BOCargado;
            }
            else
            {
                lblAgencia.Text     = "(vacío)";
                lblPeriodo.Text     = "(vacío)";
                lblFechaDesde.Text  = "(vacío)";
                lblFechaHasta.Text  = "(vacío)";
                lblBSPCargado.Text  = "(vacío)";
                lblBOCargado.Text   = "(vacío)";
                btnReportar.Enabled = false;
            }
        }
예제 #8
0
        public async Task <ObservableCollection <Semana> > getAllSemana()
        {
            ObservableCollection <Semana> listPlaneta = new ObservableCollection <Semana>();
            ParseQuery <ParseObject>      query       = ParseObject.GetQuery(CLASS);
            IEnumerable <ParseObject>     results     = await query.FindAsync();

            ParseObject listObject;
            Semana      semana;

            int sizeResult = results.Count();

            for (int i = 0; i < sizeResult; i++)
            {
                listObject = results.ElementAt <ParseObject>(i);

                semana = new Semana
                {
                    IdSemana     = listObject.ObjectId,
                    NombreSemana = listObject.Get <string>(C_NAME_SEM)
                };


                listPlaneta.Add(semana);
            }
            return(listPlaneta);
        }
예제 #9
0
        public ActionResult Save(Comum model, Semana dias_culto, Semana dias_rjm, Semana dias_gem)
        {
            try{
                var usuario = UserSession.Get(Request.HttpContext).Usuario;
                if (!usuario.Admin)
                {
                    model.Cod_Comum = usuario.Cod_Comum;
                }

                if (usuario.Instrutor)
                {
                    model.SetDiasCulto(dias_culto);
                    model.SetDiasRJM(dias_rjm);
                    model.SetDiasGEM(dias_gem);

                    char oper = model.Cod_Comum == 0 ? 'C' : 'U';
                    model.Save();
                    Monitor.Add <Comum>(HttpContext, oper, model.Nome);
                }

                return(Json("ok"));
            }
            catch (Exception ex) {
                return(Json(ex.Message));
            }
        }
예제 #10
0
        public List <CreditoObj> Generar(Semana oSemana)
        {
            List <CreditoObj> lstCredito = new List <CreditoObj>();

            List <BSP_Ticket> lstTickets = oSemana.TicketsBSP.Where(x => x.Concepto.Tipo == 'C').OrderBy(x => x.Compania.Codigo).ThenBy(x => x.Moneda).ThenBy(x => x.Billete).ToList();

            List <CreditoObj> lstCreditoPesos = new List <CreditoObj>();

            lstTickets.Where(x => x.Moneda == Moneda.Peso).ToList().ForEach(x => lstCreditoPesos.Add(GetCredito(x)));
            if (lstCreditoPesos.Count > 0)
            {
                lstCreditoPesos.Add(new CreditoObj {
                    Nro = "TOTAL", Tarifa = lstCreditoPesos.Sum(x => x.Tarifa), Contado = lstCreditoPesos.Sum(x => x.Contado), Credito = lstCreditoPesos.Sum(x => x.Credito), Importe = lstCreditoPesos.Sum(x => x.Importe), Comision = lstCreditoPesos.Sum(x => x.Comision), Moneda = "$", IVA = lstCreditoPesos.Sum(x => x.IVA), Impuestos = lstCreditoPesos.Sum(x => x.Impuestos)
                });
                lstCredito.AddRange(lstCreditoPesos);
            }

            List <CreditoObj> lstCreditoDolares = new List <CreditoObj>();

            lstTickets.Where(x => x.Moneda == Moneda.Dolar).ToList().ForEach(x => lstCreditoDolares.Add(GetCredito(x)));
            if (lstCreditoDolares.Count > 0)
            {
                lstCreditoDolares.Add(new CreditoObj {
                    Nro = "TOTAL", Tarifa = lstCreditoDolares.Sum(x => x.Tarifa), Contado = lstCreditoDolares.Sum(x => x.Contado), Credito = lstCreditoDolares.Sum(x => x.Credito), Importe = lstCreditoDolares.Sum(x => x.Importe), Comision = lstCreditoDolares.Sum(x => x.Comision), Moneda = "D", IVA = lstCreditoDolares.Sum(x => x.IVA), Impuestos = lstCreditoDolares.Sum(x => x.Impuestos)
                });
                lstCredito.AddRange(lstCreditoDolares);
            }

            return(lstCredito);
        }
예제 #11
0
        public async void insertSemana(Semana semana)
        {
            ParseObject parseObject = new ParseObject(CLASS);

            parseSemana(parseObject, semana);
            await parseObject.SaveAsync();
        }
예제 #12
0
        public ActionResult Semanal(FormCollection formCollection)
        {
            DateTime data = DateTime.Parse(formCollection["dataRelatorio"]);
            bool     incluiEstacionados = MakeBoolean(formCollection["incluiEstacionado"]);
            int      estacionamentoID   = 1;

            EstacionamentoDAO estacionamentoDAO = new EstacionamentoDAO(conn);
            Estacionamento    est = estacionamentoDAO.BuscarItem("vagas", estacionamentoID);

            if (est != null)
            {
                Semana    semana    = new Semana(data, DayOfWeek.Sunday);
                Relatorio relatorio = new Relatorio(semana, est);

                RegistroDAO registroDAO = new RegistroDAO(conn);
                relatorio.Registros = registroDAO.GeraRelatorio(relatorio);

                relatorio.View = GerarDadosRelatorio(relatorio);
                relatorio.VeiculosFrequentes = (List <Veiculo>)relatorio.Registros.GroupBy(x => x.Veiculo.Placa).Where(x => x.Count() > 1).Select(x => x.FirstOrDefault().Veiculo).ToList();

                ViewData.Model = relatorio;
                return(View());
            }

            return(RedirectToAction("Index", "Gerencia"));
        }
예제 #13
0
        public static List <BaseProductoAlmacen> ObtenerDetalleAbastecimiento(int idAlmacen, int semana, int anio)
        {
            using (var db = new SinabEntities())
            {
                List <prc_ProductosDesabastecidos_Result> pd;
                List <prc_ProductosAbastecidos_Result>    pa;

                var inicioSemana = Semana.FechaInicio(anio, semana);
                var cb           = CuadroBasico.Obtener(db, idAlmacen);

                //EN ESTE SELECT SE OBTIENEN LOS PRODUCTOS SIN EXISTENCIAS EN LA SEMANA Y AÑO  DETALLADO
                if (inicioSemana >= cb.FechaInicio)
                {
                    pd = db.prc_ProductosDesabastecidos(semana, anio, idAlmacen).ToList();
                    pa = db.prc_ProductosAbastecidos(semana, anio, idAlmacen).ToList();
                }
                else
                {
                    pd = db.prc_ProductosDesabastecidosPasado(semana, anio, inicioSemana, idAlmacen).ToList();
                    pa = db.prc_ProductosAbastecidosPasado(semana, anio, inicioSemana, idAlmacen).ToList();
                }


                return((from d in pd
                        join a in pa on new { d.nombre, d.cb } equals new { a.nombre, a.cb }
                        select new BaseProductoAlmacen
                {
                    Almacen = a.nombre,
                    CuadroBasico = a.cb,
                    Desabastecido = d.se,
                    Abastecido = a.ce
                }).ToList());
            }
        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            
            semana = e.Parameter as Semana;
            if (semana != null)
            {
                idSemanaNoti = semana.IdSemana;
                mostrarListaTrabajador();

            }
            else
            {
                //mostrarListaTrabajador();
            }

            idTraNov = e.Parameter as string;
            if (idTraNov != null)
            {
                
                idSemanaNoti = idTraNov;
               mostrarListaTrabajador();

            }
            else
            {

            }
        }
예제 #15
0
 /// <summary>
 /// Construtor para os relatorios.
 /// </summary>
 /// <param name="semana">Semana que será extraido o Relatorio</param>
 /// <param name="estacionamento">Estacionamento que será consultado</param>
 /// <param name="carrosEstacionados">True para incluir no relatório os veiculos que ainda estão estacionados</param>
 public Relatorio(Semana semana, Estacionamento estacionamento)
 {
     Semana                    = semana;
     Estacionamento            = estacionamento;
     IncluirCarrosEstacionados = true;
     SemanasAnteriores         = 0;
     SemanasPosteriores        = 0;
 }
예제 #16
0
        public List <Diferencia> Generar(Semana oSemana)
        {
            List <Diferencia> lstDiferencia = new List <Diferencia>();
            List <BSP_Ticket> lstTickets    = oSemana.TicketsBSP.Where(x => x.Concepto.Tipo == 'B').OrderBy(x => x.Compania.Codigo).ThenBy(x => x.Billete).ToList();
            Diferencia        oDiferencia   = null;

            foreach (BSP_Ticket oBSP_Ticket in lstTickets)
            {
                BO_Ticket bo_ticket = oSemana.TicketsBO.Find(x => x.Billete == oBSP_Ticket.Billete && x.Compania.Codigo == oBSP_Ticket.Compania.Codigo);
                if (bo_ticket != null)
                {
                    decimal ImpuestosBSP = Math.Round(oBSP_Ticket.Detalle.Sum(x => x.ImpContado + x.ImpCredito) + oBSP_Ticket.IVA105, 2);

                    decimal TarifaDif    = Math.Round((oBSP_Ticket.TarContado + oBSP_Ticket.TarCredito) - (bo_ticket.Tarifa), 2);
                    decimal ContadoDif   = Math.Round((oBSP_Ticket.TarContado) - (bo_ticket.TarContado), 2);
                    decimal CreditoDif   = Math.Round((oBSP_Ticket.TarCredito) - (bo_ticket.TarCredito), 2);
                    decimal ImpuestosDif = Math.Round((ImpuestosBSP) - (bo_ticket.Impuestos), 2);
                    decimal ComisionDif  = Math.Round(-(oBSP_Ticket.ComValor + oBSP_Ticket.ComIVA) - (bo_ticket.Comision), 2);

                    if (Math.Abs(TarifaDif) >= DiferenciaMinima || Math.Abs(ContadoDif) >= DiferenciaMinima || Math.Abs(CreditoDif) >= DiferenciaMinima || Math.Abs(ImpuestosDif) >= DiferenciaMinima || Math.Abs(ComisionDif) >= DiferenciaMinima)
                    {
                        oDiferencia = new Diferencia();

                        oDiferencia.BoletoNroBSP = oBSP_Ticket.Billete.ToString();
                        oDiferencia.RgBSP        = oBSP_Ticket.Rg == BSP_Rg.Doméstico ? "C" : "I";
                        oDiferencia.TrBSP        = oBSP_Ticket.Compania.Codigo;
                        oDiferencia.TarifaBSP    = (oBSP_Ticket.TarContado + oBSP_Ticket.TarCredito);
                        oDiferencia.ContadoBSP   = oBSP_Ticket.TarContado;
                        oDiferencia.CreditoBSP   = oBSP_Ticket.TarCredito;

                        oDiferencia.ImpuestosBSP = ImpuestosBSP;
                        oDiferencia.ComisionBSP  = (oBSP_Ticket.ComValor + oBSP_Ticket.ComIVA);
                        oDiferencia.MonedaBSP    = oBSP_Ticket.Moneda == Moneda.Peso ? "$" : "D";

                        oDiferencia.TarifaBO    = bo_ticket.Tarifa;
                        oDiferencia.ContadoBO   = bo_ticket.TarContado;
                        oDiferencia.CreditoBO   = bo_ticket.TarCredito;
                        oDiferencia.ImpuestosBO = bo_ticket.Impuestos;
                        oDiferencia.ComisionBO  = bo_ticket.Comision;
                        oDiferencia.Factura     = bo_ticket.Factura;
                        oDiferencia.Pasajero    = bo_ticket.Pasajero;
                        oDiferencia.MonedaBO    = bo_ticket.Moneda == Moneda.Peso ? "$" : "D";

                        oDiferencia.Operacion = bo_ticket.Expediente;

                        oDiferencia.TarifaDif    = TarifaDif.ToString();
                        oDiferencia.ContadoDif   = ContadoDif;
                        oDiferencia.CreditoDif   = CreditoDif;
                        oDiferencia.ImpuestosDif = ImpuestosDif;
                        oDiferencia.ComisionDif  = ComisionDif;

                        lstDiferencia.Add(oDiferencia);
                    }
                }
            }

            return(lstDiferencia);
        }
예제 #17
0
        public void DeveObterNumeroDaSemana(int ano, int mes, int dia, int numSemana)
        {
            // arrange & act
            var data = new DateTime(ano, mes, dia);
            var sut  = new Semana(data);

            // assert
            Assert.Equal(numSemana, sut.Num);
        }
예제 #18
0
        public async void updateSemana(Semana semana)
        {
            string idinsu = semana.IdSemana;
            ParseQuery <ParseObject> query = ParseObject.GetQuery(CLASS);
            ParseObject parseObject        = await query.GetAsync(idinsu);

            parseObject[C_NAME_SEM] = semana.NombreSemana;
            await parseObject.SaveAsync();
        }
예제 #19
0
        public void TestaSemana()
        {
            Semana   semana          = new Semana(new DateTime(2020, 3, 11), DayOfWeek.Sunday);
            DateTime dataInicialTest = new DateTime(2020, 3, 8);
            DateTime dataFinalTest   = new DateTime(2020, 3, 15);

            //Assert.AreEqual(semana.DataInicial, dataInicialTest);
            Assert.AreEqual(semana.DataFinal, dataFinalTest);
        }
예제 #20
0
        private List <string> GetHeader(Semana oSemana, string Titulo)
        {
            List <string> header = new List <string>();

            header.Add("Informe de Auditoría");
            header.Add(Titulo);
            header.Add("Período de Liquidación del " + oSemana.FechaDesde.ToShortDateString() + " hasta " + oSemana.FechaHasta.ToShortDateString() + " - Semana " + oSemana.Periodo.ToShortDateString());
            header.Add("Empresa " + oSemana.Agencia.Nombre);
            header.Add("IATA " + oSemana.Agencia.ID);
            return(header);
        }
예제 #21
0
        public async Task <IActionResult> Create([Bind("SemanaId,Contenido,Fecha")] Semana semana)
        {
            if (ModelState.IsValid)
            {
                _context.Add(semana);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(semana));
        }
        // função pra adicionar semana
        private void AddOneWeek()
        {
            var umaSemana = new Semana()
            {
                SemanaNum  = _context.Semana.Max(s => s.SemanaNum) + 1,
                DataInicio = DateTime.Now,
                DataFim    = DateTime.Now.AddDays(7)
            };

            _context.Semana.Add(umaSemana);
            _context.SaveChanges();
        }
예제 #23
0
 public void ConsultaSemana(ref Semana _semana, int Cal_Año, int Cal_Mes, Sesion sesion, ref List <Semana> list)
 {
     try
     {
         CD_CatSemana cd_catsemana = new CD_CatSemana();
         cd_catsemana.ConsultaSemana(ref _semana, Cal_Año, Cal_Mes, sesion, ref list);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #24
0
 public void ConsultaSemanaActual(ref Semana semana, string Conexion, ref int verificador)
 {
     try
     {
         CD_CatSemana cd_catSemana = new CD_CatSemana();
         cd_catSemana.ConsultaSemanaActual(ref semana, Conexion, ref verificador);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #25
0
        public List <Over> Generar(Semana oSemana)
        {
            List <Over> lstOver         = new List <Over>();
            List <Over> lstOverCompania = new List <Over>();
            Over        oOverTotal      = null;

            Companias       Companias = new Companias();
            List <Compania> companias = Companias.GetAll();

            Companias.CloseConnection();

            List <BSP_Ticket> lstTicketsBSP = oSemana.TicketsBSP.Where(x => x.Concepto.Tipo == 'B').OrderBy(x => x.Compania.Codigo).ThenBy(x => x.Billete).ToList();

            foreach (Compania compania in companias.OrderBy(x => x.Codigo))
            {
                lstOverCompania = new List <Over>();

                foreach (BSP_Ticket oBSP_Ticket in lstTicketsBSP.Where(x => x.Compania.ID == compania.ID))
                {
                    BO_Ticket oBO_Ticket = oSemana.TicketsBO.Find(x => x.Billete == oBSP_Ticket.Billete && x.Compania.Codigo == oBSP_Ticket.Compania.Codigo);

                    if (oBSP_Ticket.ComOver != 0 || (oBO_Ticket != null && oBO_Ticket.ComOver != 0))
                    {
                        lstOverCompania.Add(GetOver(oBSP_Ticket, oBO_Ticket));
                    }
                }

                foreach (BO_Ticket bo_ticketFaltante in oSemana.TicketsBO.Where(x => x.Compania.ID == compania.ID && !lstTicketsBSP.Any(y => y.Billete == x.Billete && y.Compania.Codigo == compania.Codigo) && x.ComOver != 0).OrderBy(x => x.Billete))
                {
                    lstOverCompania.Add(GetOver(null, bo_ticketFaltante));
                }

                if (lstOverCompania.Count > 0)
                {
                    lstOver.AddRange(lstOverCompania);

                    oOverTotal                    = new Over();
                    oOverTotal.Boleto             = "TOTAL";
                    oOverTotal.Tr                 = compania.Codigo;
                    oOverTotal.OverRecPesos       = lstOverCompania.Select(x => x.OverRecPesos).Sum();
                    oOverTotal.OverPedPesos       = lstOverCompania.Select(x => x.OverPedPesos).Sum();
                    oOverTotal.OverRecDolares     = lstOverCompania.Select(x => x.OverRecDolares).Sum();
                    oOverTotal.OverPedDolares     = lstOverCompania.Select(x => x.OverPedDolares).Sum();
                    oOverTotal.DiferenciasPesos   = lstOverCompania.Select(x => x.DiferenciasPesos).Sum();
                    oOverTotal.DiferenciasDolares = lstOverCompania.Select(x => x.DiferenciasDolares).Sum();

                    lstOver.Add(oOverTotal);
                }
            }

            return(lstOver);
        }
예제 #26
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     semana = e.Parameter as Semana;
     if (semana != null)
     {
         nuevo = true;
         txtNombreSemana.Text = semana.NombreSemana;
     }
     else
     {
         nuevo = false;
     }
 }
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     semana = e.Parameter as Semana;
     if (semana != null)
     {
         nuevo = true;
         txtNombreSemana.Text = semana.NombreSemana;
         
     }
     else
     {
         nuevo = false;
     }
 }
        public Seed()
        {
            Professores = new List <Professor>();
            Salas       = new List <Sala>();
            Disciplinas = new List <Disciplina>();
            Aulas       = new List <Aula>();
            Semana      = new Semana();

            PreencheProfessores();
            PreencheSalas();
            PreencheDisciplinasPrimeiroSemestre();
            PreencheAulas();
            Semana.Dias = PreencheSemana(Aulas);
        }
예제 #29
0
        public void GerarRelatorioSemanal()
        {
            RegistroDAO    registroDAO    = new RegistroDAO(conn);
            Semana         semana         = new Semana(new DateTime(2020, 3, 11), DayOfWeek.Sunday);
            Estacionamento estacionamento = new Estacionamento {
                Id = 1
            };
            Relatorio relatorio = new Relatorio(semana, estacionamento);

            relatorio.IncluirCarrosEstacionados = false;

            List <Registro> registros = registroDAO.GeraRelatorio(relatorio);

            Assert.AreNotEqual(0, registros.Count);
        }
예제 #30
0
        public void Guardar(Semana oSemana, BackgroundWorker backgroundWorker1)
        {
            try
            {
                if (oSemana == null)
                {
                    return;
                }

                using (SqlCeConnection conn = AccesoDatos.OpenConn())
                {
                    Semanas     semanas     = new Semanas(conn);
                    BSP_Tickets bsp_tickets = new BSP_Tickets(conn);
                    if (oSemana.ID > 0)
                    {
                        if (oSemana.TicketsBSP.Count > 0)
                        {
                            bsp_tickets.EliminarPorSemana(oSemana.ID);
                        }
                    }
                    else
                    {
                        semanas.Insertar(oSemana);
                    }

                    BSP_Ticket_Detalles bsp_Ticket_Detalles = new BSP_Ticket_Detalles(conn);
                    int intCont       = 0;
                    int intPorcentaje = 0;
                    foreach (BSP_Ticket Ticket in oSemana.TicketsBSP)
                    {
                        Ticket.SemanaID = oSemana.ID;
                        bsp_tickets.Insertar(Ticket);
                        foreach (BSP_Ticket_Detalle TicketDetalle in Ticket.Detalle)
                        {
                            TicketDetalle.TicketID = Ticket.ID;
                            bsp_Ticket_Detalles.Insertar(TicketDetalle);
                        }
                        intCont++;
                        intPorcentaje = intCont * 100 / oSemana.TicketsBSP.Count;
                        backgroundWorker1.ReportProgress(intPorcentaje, "Guardando BSP... " + intCont + " de " + oSemana.TicketsBSP.Count + " registros guardados.");
                    }
                }
            }
            catch (Exception ex)
            {
                TextToFile.Errores(TextToFile.Error(ex));
            }
        }
예제 #31
0
        static string SwitchNovo(Semana semana)
        {
            var retorno = semana switch
            {
                Semana.Segunda => "Segunda",
                Semana.Terca => "Terça",
                Semana.Quarta => "Quarta",
                Semana.Quinta => "Quinta",
                Semana.Sexta => "Sexta",
                Semana.Sabado => "Sábado",
                Semana.Domingo => "Domingo",
                _ => "",
            };

            return(retorno);
        }
예제 #32
0
        public List <Facturacion> Generar(Semana oSemana)
        {
            List <Facturacion> lstFacturacion            = new List <Facturacion>();
            List <char>        lstTipoConceptoPermitidos = new List <char>();

            lstTipoConceptoPermitidos.Add('B'); //Billetes
            lstTipoConceptoPermitidos.Add('R'); //Reembolsos

            List <BSP_Ticket> lstTickets = oSemana.TicketsBSP.Where(x => lstTipoConceptoPermitidos.Contains(x.Concepto.Tipo)).OrderBy(x => x.Compania.Codigo).ThenBy(x => x.Billete).ToList();

            foreach (BSP_Ticket oBSP_Ticket in lstTickets)
            {
                BO_Ticket bo_ticket = oSemana.TicketsBO.Find(x => x.Billete == oBSP_Ticket.Billete);

                Facturacion oFacturacion = new Facturacion();

                oFacturacion.Cia           = oBSP_Ticket.Compania.Codigo;
                oFacturacion.Rg            = oBSP_Ticket.Rg == BSP_Rg.Doméstico ? "C" : "I";
                oFacturacion.Tipo          = (oBSP_Ticket.Concepto.Tipo.Equals('R') ? "R" : (oBSP_Ticket.Tipo.Contains('F') && !oBSP_Ticket.Detalle.Any(x => x.Observaciones.Trim() == "CNJ") ? "B" : "V"));
                oFacturacion.BoletoNro     = !oBSP_Ticket.Concepto.Tipo.Equals('R') ? oBSP_Ticket.Billete.ToString() : oBSP_Ticket.Detalle.Find(x => x.Observaciones.Substring(0, 2) == "RF").Observaciones.Substring(5, 10);
                oFacturacion.Moneda        = oBSP_Ticket.Moneda == Moneda.Peso ? "$" : "D";
                oFacturacion.FechaEmision  = AuditurHelpers.GetDateTimeString(oBSP_Ticket.FechaVenta);
                oFacturacion.Tarifa        = oBSP_Ticket.TarContado + oBSP_Ticket.TarCredito;
                oFacturacion.QN            = oBSP_Ticket.Detalle.Where(x => x.ISO == "QN").Sum(x => x.ImpContado + x.ImpCredito);
                oFacturacion.Impuestos     = oBSP_Ticket.Detalle.Where(x => x.ISO != "QN").Sum(x => x.ImpContado + x.ImpCredito);
                oFacturacion.IVA10         = oBSP_Ticket.IVA105;
                oFacturacion.Gravado       = Math.Round((oBSP_Ticket.IVA105 / 10.5M) * 100, 2);
                oFacturacion.Exento        = Math.Round(oFacturacion.Tarifa + oFacturacion.QN + oFacturacion.Impuestos - oFacturacion.Gravado, 2);
                oFacturacion.ComNormal     = oBSP_Ticket.ComValor;
                oFacturacion.ComOver       = oBSP_Ticket.ComOver;
                oFacturacion.IVAComisiones = oBSP_Ticket.ComIVA;
                oFacturacion.TotalFinal    = oBSP_Ticket.Total;
                oBSP_Ticket.Detalle.ForEach(x => oFacturacion.Observaciones += x.Observaciones + " ");
                oFacturacion.Observaciones = oFacturacion.Observaciones.Trim();

                if (bo_ticket != null)
                {
                    oFacturacion.Operacion = bo_ticket.Expediente;
                    oFacturacion.Factura   = bo_ticket.Factura;
                    oFacturacion.Pasajero  = bo_ticket.Pasajero;
                }

                lstFacturacion.Add(oFacturacion);
            }
            return(lstFacturacion);
        }
        private void insertSemana(object sender, RoutedEventArgs e)
        {
            string nombreSemana = txtNombreSemana.Text;

            if (nuevo == false)
            {
                Semana semananuevo = new Semana(nombreSemana);
                semanaParse.insertSemana(semananuevo);
            }
            else
            {
                semana.IdSemana = semana.IdSemana;
                semana.NombreSemana = nombreSemana;

                semanaParse.updateSemana(semana);
                nuevo = false;
            }
            //    rootFrame.Navigate(typeof(ListaSemanaPage));
            rootFrame.GoBack();
        }