Example #1
0
        public void ObtenerFechaEntrega_TiempoDeEntrega4Meses_FechadeEntregaDentro4Meses()
        {
            //Arrange
            DateTime     dtFechaPedido          = new DateTime(2020, 1, 23, 14, 0, 0);
            DateTime     dtFechaEntregaEsperado = new DateTime(2020, 5, 22, 14, 0, 0);
            int          iMinutos = 172800;
            FechaEntrega SUT      = new FechaEntrega();

            //Act
            DateTime dFechaEntrega = SUT.ObtenerFechaEntrega(dtFechaPedido, iMinutos);

            //Assert
            Assert.AreEqual(dtFechaEntregaEsperado, dFechaEntrega);
        }
Example #2
0
 public bool Save()
 {
     try
     {
         if (FechaEntrega == null || FechaEntrega.Trim() == "")
         {
             sql = "UPDATE ENTREGADECONTRATOS SET FECHADEENTREGA = NULL" +
                   " WHERE PK1 = " + IdContratos;
         }
         else
         {
             sql = "UPDATE ENTREGADECONTRATOS SET" +
                   " FECHADEENTREGA = CONVERT(datetime,'" + FechaEntrega + "', 103)" +
                   " WHERE  PK1 = " + IdContratos;
         }
         return(db.execute(sql));
     }
     catch { }
     return(false);
 }
Example #3
0
        private static List <string> ObtenerMensajesPedido(List <PedidoDTO> _lstPedidoDTO)
        {
            DateTime              dtFechaActual         = new DateTime(2020, 1, 23, 14, 0, 0);
            var                   docContainer          = Container.For <DI_Dependencias>();
            TiempoRepartoFactory  tiempoRepartoFactory  = new TiempoRepartoFactory(docContainer);
            TiempoTrasladoFactory tiempoTrasladoFactory = new TiempoTrasladoFactory();
            MensajePedidoPaquete  mensajePedidoPaquete  = ObtenerInstanciaMensajePedidoPaquete();
            CostoEnvioFactory     costoEnvioFactory     = new CostoEnvioFactory(docContainer);
            List <string>         lstInformacionPedido  = new List <string>();

            foreach (PedidoDTO pedido in _lstPedidoDTO)
            {
                ITiempoReparto  tiempoReparto  = tiempoRepartoFactory.CrearInstancia(pedido.enumEmpresa);
                ITiempoTraslado tiempoTraslado = tiempoTrasladoFactory.CrearInstancia(pedido.enumMedioTransporte);
                ITiempoEntrega  tiempoEntrega  = new TiempoEntrega(tiempoTraslado, tiempoReparto);
                IFechaEntrega   fechaEntrega   = new FechaEntrega();
                ICostoEnvio     costoEnvio     = costoEnvioFactory.CrearInstancia(pedido.enumMedioTransporte, pedido.cIdentificadorEmpresa);
                ProcesadorInformacionPedidoPaquete procesadorInformacionPedidoPaquete = new ProcesadorInformacionPedidoPaquete(mensajePedidoPaquete, tiempoEntrega, fechaEntrega, costoEnvio);
                lstInformacionPedido.Add(procesadorInformacionPedidoPaquete.ObtenerInformacionPedidoPaquete(pedido, dtFechaActual));
            }
            return(lstInformacionPedido);
        }
        async void Guardar()
        {
            isEnabled = false;
            if (string.IsNullOrEmpty(FechaEntrega.ToString()))
            {
                await Application.Current.MainPage.DisplayAlert("error", "Debe Llenar El Campo Fecha", "Excelente");

                IsEnabled = true;
                return;
            }
            var fecha = FechaEntrega.ToString();

            #region Limpiar Cache //borrar los datos existentes en persistencia

            if (Application.Current.Properties.ContainsKey("ContadorAcciones"))
            {
                Elementos = int.Parse((Application.Current.Properties["ContadorAcciones"]) as string);
            }
            else
            {
                Elementos = 0;
            }
            for (int j = 0; j < Elementos; j++) //Elementos va a representar el total de elementos o filas existentes en mi persistencia
            {
                if (Application.Current.Properties.ContainsKey("TipoAccion" + j))
                {
                    Application.Current.Properties.Remove("TipoAccion" + j);
                }
                if (Application.Current.Properties.ContainsKey("FechaAccion" + j))
                {
                    Application.Current.Properties.Remove("FechaAccion" + j);
                }
                if (Application.Current.Properties.ContainsKey("Responsable"))
                {
                    Application.Current.Properties.Remove("Responsable");
                }
                if (Application.Current.Properties.ContainsKey("Comentario"))
                {
                    Application.Current.Properties.Remove("Comentario");
                }
            }

            #endregion

            #region Ciclo para Guardar en Persistencia mi lista Actual
            i = 0; //inicio el contador de mis elementos o filas en (0)
            foreach (var action in AccionesCaja)
            {
                Application.Current.Properties["TipoAccion" + i]  = action.TipoAccion.ToString();
                Application.Current.Properties["FechaAccion" + i] = action.FechaAccion.ToString();
                Application.Current.Properties["Responsable" + i] = action.Responsable.ToString();
                Application.Current.Properties["Comentario" + i]  = action.Comentario.ToString();
                i++;
                Application.Current.Properties["ContadorAcciones"] = i.ToString();
                await Application.Current.SavePropertiesAsync();
            }

            #endregion

            int filas;
            filas = AccionesCaja.Count;
            Application.Current.Properties["ContadorAcciones"] = filas.ToString();   //hay que examinar esta linea, es de prueba porque creo que no se actualiza bien el contador en la otra viewmodel cuando se borran todos los registros y esta linea evita eso
            HeighListViewB = 44 * filas;                                             //actalizo mi heigh
            ANAccionMeliponarioViewModel.GetInstance().Acciones = this.AccionesCaja; //asigno los datos de mi lista
            await Application.Current.MainPage.DisplayAlert("Notificación", "Usted Tiene hasta Ahora: " + filas + " Acciones en Persistencia", "Excelente");

            await Application.Current.MainPage.DisplayAlert(
                "Hola",
                IdCaja + " " + Tipo + " " + Productor + " " + fecha + " " + Comentario + " " + Origen + " " + FloraNueva,
                "Aceptar");


            #region Miranda: Guardar Tabla Cajas

            #region Ciclo para Guardar en Persistencia
            if (Application.Current.Properties.ContainsKey("Contadorcajas"))//verifico cuantos elementos tiene mi lista para saber cual es la psocion del nuevo elemento a agregar
            {
                ElementosCaja = (int.Parse((Application.Current.Properties["Contadorcajas"]) as string));
            }
            else
            {
                ElementosCaja = 0;
            }

            if (FloraNueva)
            {
                activacaja = "No";
            }
            else
            {
                activacaja = "Si";
            }
            string fechaEntrega = FechaEntrega.ToString();
            if (string.IsNullOrEmpty(Tipo))
            {
                Tipo = "";
            }
            if (string.IsNullOrEmpty(Comentario))//si no hago esto, se le pasan valores nulos a persistencia
            {
                Comentario = "";
            }

            Application.Current.Properties["Idcaja" + ElementosCaja]           = IdCaja.ToString();
            Application.Current.Properties["Tipocaja" + ElementosCaja]         = Tipo.ToString();
            Application.Current.Properties["Fechaentregacaja" + ElementosCaja] = (FechaEntrega).ToString(); //revisar, cuando no se selecciona fecha esta linea manda error OJOO
            Application.Current.Properties["Activacaja" + ElementosCaja]       = activacaja.ToString();
            Application.Current.Properties["Comentariocaja" + ElementosCaja]   = Comentario.ToString();
            Application.Current.Properties["Contadorcajas"] = (ElementosCaja + 1).ToString();
            await Application.Current.SavePropertiesAsync();

            #endregion


            int filascaja;
            filascaja         = ElementosCaja + 1;
            HeighListViewCaja = 44 * filascaja;//actalizo mi heigh
            await Application.Current.MainPage.DisplayAlert("Notificación", "Usted Tiene hasta Ahora: " + filascaja + " Cajas Registradas", "Excelente");

            Cajas.Add(new Caja()
            {
                Activa       = activacaja.ToString(),
                Comentario   = Comentario.ToString(),
                FechaEntrega = FechaEntrega,
                IdCaja       = IdCaja, //int
                TipoCaja     = Tipo.ToString(),
            });
            ANMeliponarioViewModel.GetInstance().CajasAN         = this.Cajas;             //asigno los datos de mi lista
            ANMeliponarioViewModel.GetInstance().HeighListViewAN = this.HeighListViewCaja; //actualizo el heigh de mi vista anterior
            IsEnabled = true;

            await Application.Current.MainPage.Navigation.PopAsync();

            #endregion
        }
Example #5
0
 private void limpiarFechaEntrega(object sender, RoutedEventArgs e)
 {
     FechaEntrega.Clear();
 }
Example #6
0
 public override string ToString()
 {
     return(String.Format("{0} {1} debe {2} artículos y los debería de entregar el {3}", Solicitante.Nombre, Solicitante.Ape_paterno, Muebles.Count, FechaEntrega.ToShortDateString()));
 }
Example #7
0
 public override string ToString()
 {
     return(String.Format("{0} {1} debe {2} articulos y los deberia de entregar el {3}", Solicitante.Nombre, Solicitante.Apellidos, MaterialesPrestados.Count, FechaEntrega.ToShortDateString()));
 }
 //Operacion
 public override string ToString()
 {
     return("Numero de Sistema: " + NumeroSistema + ", Nombre del destinatario: " + Nombre + ", Direccion del destinatario: " + Direccion +
            ", Fecha de entrega: " + FechaEntrega.ToShortDateString() + ", Estado: " + Estado + ", Empleado: " + Empleado.Nombre);
 }