示例#1
0
        public bool BO_Ejemplo(ref DTO_EjemploType DTO_Ejemplo)
        {
            var dates = new List <DateTime>();

            for (var dt = DTO_Ejemplo.fechaCreacion; dt <= DTO_Ejemplo.fechaFin; dt = dt.AddMonths(1))
            {
                dates.Add(new DateTime(dt.Year, dt.Month, 1));
            }

            DTO_Ejemplo.fechasFaltantes = new List <string>();
            foreach (var item in dates)
            {
                if (!(DTO_Ejemplo.fechas.Where(x => Convert.ToDateTime(x) == item).ToList().Count() > 0))
                {
                    DTO_Ejemplo.fechasFaltantes.Add(item.ToString("yyyy-MM-dd"));
                }
            }

            DTO_Ejemplo.DTO_Transaction = new DTO_TransactionType();
            DTO_Ejemplo.DTO_Transaction.transactionNumber  = "0";
            DTO_Ejemplo.DTO_Transaction.transactionMessage = "PROCESO REALIZADO CORRECTAMENTE";


            return(bResultado);
        }
示例#2
0
        public IHttpActionResult ListaEjemploPrevired(DTO_EjemploType DTO_Ejemplo)
        {
            try
            {
                using (BO_EjemploType BO_Ejemplo = new BO_EjemploType())
                {
                    bResultado = BO_Ejemplo.BO_Ejemplo(ref DTO_Ejemplo);
                }

                return(Ok(DTO_Ejemplo));
            }
            catch (Exception ex)
            {
                return(Ok(new DTO_EjemploType()
                {
                    DTO_Transaction = new DTO_TransactionType()
                    {
                        transactionNumber = "-180124090202",
                        transactionMessage = ex.Message
                    }
                }));
            }
        }