예제 #1
0
        public void MenorQueUnaFechaTest()
        {
            Fecha fecha = new Fecha(1, 3, 2005);

            Fecha otraFecha = new Fecha(25, 4, 2010);

            Assert.AreEqual(fecha.CompararFecha(otraFecha), -1);
        }
예제 #2
0
        public void MayorQueUnaFecha()
        {
            Fecha fecha = new Fecha(26, 1, 2014);

            Fecha otraFecha = new Fecha(21, 6, 2008);

            Assert.AreEqual(fecha.CompararFecha(otraFecha), 1);
        }
예제 #3
0
        public void AgregarAñosTest()
        {
            Fecha fecha = new Fecha(1, 12, 1985);

            fecha = fecha.AgregarAños(29);

            Fecha otraFecha = new Fecha(1, 12, 2014);

            Assert.AreEqual(fecha.CompararFecha(otraFecha), 0);
        }
예제 #4
0
        public void AgregarDiasTest()
        {
            Fecha fecha = new Fecha(1, 3, 2005);

            fecha = fecha.AgregarDias(60);

            Fecha otraFecha = new Fecha(30, 4, 2005);

            Assert.AreEqual(fecha.CompararFecha(otraFecha), 0);
        }
예제 #5
0
        public void AgregarMesesTest()
        {
            Fecha fecha = new Fecha(22, 10, 2008);

            fecha = fecha.AgregarMeses(12);

            Fecha otraFecha = new Fecha(22, 10, 2009);

            Assert.AreEqual(fecha.CompararFecha(otraFecha), 0);
        }
예제 #6
0
        static void Main(string[] args)
        {
            Console.Write("Ingrese una fecha: ");
            DateTime Fecha;

            while (true)
            {
                if (DateTime.TryParse(Console.ReadLine(), out Fecha))
                {
                    break;
                }

                Console.Write("Fecha inválida. Ingrésela nuevamente: ");
            }

            Console.WriteLine($"Hora de la fecha: {Fecha.Hour}");
            Console.WriteLine($"Hora completa de la fecha: {Fecha.ToString("HH:mm:ss.fff")}");

            Console.ReadKey();
        }
예제 #7
0
        public string actualizar_estado_Habilitar_servicio(int id_servicio, string user)
        {
            string validacion = "fail";

            string Usuario_Edita = user;
            Fecha  fecha         = new Fecha();
            string dato          = fecha.fecha();

            Servicio serv = new Servicio(id_servicio, dato, Usuario_Edita);


            int result = dao_servicio.ActualizarEstadoHabilitarServicio(serv);


            if (result == 1)
            {
                validacion = "sucess";
            }
            return(validacion);
        }
예제 #8
0
        public void mostrarEspecificaciones()
        {
            dataGridViewEspecificaciones.Rows.Clear();
            List <EspecificacionTarea> lista_tareas = consultarEspecificaciones();


            for (int i = 0; i < lista_tareas.Count; i++)
            {
                Fecha    inicio         = Fecha.convertirDateTimeAFecha(lista_tareas[i].DiaInicio);
                DateTime inicioDateTime = new DateTime(inicio.Anio, inicio.Mes, inicio.Dia);
                Fecha    fin            = Fecha.convertirDateTimeAFecha(lista_tareas[i].DiaFin);
                DateTime finDateTime    = new DateTime(fin.Anio, fin.Mes, fin.Dia);

                dataGridViewEspecificaciones.Rows.Add(lista_tareas[i].Numero, lista_tareas[i].Especificacion,
                                                      inicioDateTime.DayOfWeek + ", " + inicio.Dia + " " + Program.str.diccionario["de"] + " " + Fecha.convertirNumeroAMes(inicio.Mes),
                                                      finDateTime.DayOfWeek + ", " + fin.Dia + " " + Program.str.diccionario["de"] + " " + Fecha.convertirNumeroAMes(fin.Mes),
                                                      lista_tareas[i].Dias + "", lista_tareas[i].Cumplido,
                                                      lista_tareas[i].Id);
            }
        }
예제 #9
0
        public JsonResult actualizar_estado_deshabilitar_servicio(int id_servicio)
        {
            string validacion = "fail";

            string Usuario_Edita = (string)(Session["User"]);
            Fecha  fecha         = new Fecha();
            string dato          = fecha.fecha();

            Servicio serv = new Servicio(id_servicio, dato, Usuario_Edita);


            int result = dao_servicio.ActualizarEstadoDeshabilitarServicio(serv);


            if (result == 1)
            {
                validacion = "sucess";
            }
            return(Json(validacion, JsonRequestBehavior.AllowGet));
        }
예제 #10
0
        public IHttpActionResult verificar([FromBody] Fecha fecha, int id_zona, int id_torneo)
        {
            List <fechas> lsFechas = db.fechas.Where(x => x.fecha == fecha.fecha).ToList();

            foreach (var fec in lsFechas)
            {
                if (fec != null)
                {
                    var fixtureDto = db.fixture_zona.SingleOrDefault(x => x.id_fixture == fec.id_fixture_zona);

                    if (fixtureDto != null && fixtureDto.id_zona == id_zona && fixtureDto.id_torneo == id_torneo)
                    {
                        return(BadRequest());
                    }
                }
            }


            return(Ok());
        }
예제 #11
0
        public string actualizar_estado_deshabilitar_proyecto(int id_proyecto, string user)
        {
            string validacion = "fail";

            string Usuario_Edita = user;
            Fecha  fecha         = new Fecha();
            string dato          = fecha.fecha();

            Proyecto proy = new Proyecto(id_proyecto, dato, Usuario_Edita);


            int result = dao_proyecto.ActualizarEstadoDeshabilitarProyecto(proy);


            if (result == 1)
            {
                validacion = "sucess";
            }
            return(validacion);
        }
 public Empleado(string _nombre,
                 string _apellido,
                 Fecha _fechaNac,
                 string _estadoCiv,
                 string _genero,
                 Fecha _fechaIngre,
                 float _sueldoBasico,
                 Cargo _cargo,
                 int _cantHijos)
 {
     nombre       = _nombre;
     apellido     = _apellido;
     fechaNac     = _fechaNac;
     estadoCiv    = _estadoCiv;
     genero       = _genero;
     fechaIngre   = _fechaIngre;
     sueldoBasico = _sueldoBasico;
     cargo        = _cargo;
     cantHijos    = _cantHijos;
 }
예제 #13
0
        public string agrega(Cliente_Servicio cont, string user)
        {
            var   t     = cont;
            Fecha fecha = new Fecha();

            Cliente_Servicio cliente_Servicio = new Cliente_Servicio();

            cliente_Servicio.TARIFA_HORA      = t.TARIFA_HORA;
            cliente_Servicio.ESTADO           = 1;
            cliente_Servicio.USUARIO_CREACION = user;
            cliente_Servicio.FECHA_CREACION   = fecha.fecha();
            cliente_Servicio.FK_ID_CLIENTE    = t.FK_ID_CLIENTE;
            cliente_Servicio.FK_ID_SERVICIO   = t.FK_ID_SERVICIO;

            int result = dao_cliente.AgregarCliente_Servicio(cliente_Servicio);

            string sJSONResponse = JsonConvert.SerializeObject(result, Formatting.Indented);

            return(sJSONResponse);
        }
예제 #14
0
        public string actualizar_estado_deshabilitar_Contrato(int id_contrato, string user)
        {
            string validacion = "fail";

            string Usuario_Edita = user;
            Fecha  fecha         = new Fecha();
            string dato          = fecha.fecha();

            Contrato contrato = new Contrato(id_contrato, dato, Usuario_Edita);

            Servicio_Contrato servicio_Contrato = new Servicio_Contrato();

            int result = dao_contrato.ActualizarEstadoDeshabilitarContrato(contrato);

            if (result == 1)
            {
                validacion = "sucess";
            }
            return(validacion);
        }
예제 #15
0
        public JsonResult actualizar_estado_habilitar_proyecto(int id_proyecto)
        {
            string validacion = "fail";

            string Usuario_Edita = (string)(Session["User"]);
            Fecha  fecha         = new Fecha();
            string dato          = fecha.fecha();

            Proyecto proy = new Proyecto(id_proyecto, dato, Usuario_Edita);


            int result = dao_proyecto.ActualizarEstadoHabilitarProyecto(proy);


            if (result == 1)
            {
                validacion = "sucess";
            }
            return(Json(validacion, JsonRequestBehavior.AllowGet));
        }
예제 #16
0
        public JsonResult actualizar_estado_deshabilitar_fase_tiempo(Fase_Tiempo fase)
        {
            var    t          = fase;
            string validacion = "fail";
            Fecha  fecha      = new Fecha();

            Fase_Tiempo fase_tiempo = new Fase_Tiempo();

            fase_tiempo.ID_FASE              = t.ID_FASE;
            fase_tiempo.FECHA_MODIFICACION   = fecha.fecha();
            fase_tiempo.USUARIO_MODIFICACION = (string)(Session["User"]);

            int result = dao_fase.ActualizarEstadoDeshabilitarFase(fase_tiempo);

            if (result == 1)
            {
                validacion = "sucess";
            }
            return(Json(validacion, JsonRequestBehavior.AllowGet));
        }
예제 #17
0
        static void Main(string[] args)
        {
            DateTime Fecha;

            while (true)
            {
                Console.Write("Ingrese una fecha: ");
                if (DateTime.TryParse(Console.ReadLine(), out Fecha))
                {
                    break;
                }
                Console.WriteLine("Fecha incorrecta.");
            }

            Console.WriteLine($"{Fecha} 30 días después: {Fecha.AddDays(30)}");
            Console.WriteLine($"{Fecha} 60 días después: {Fecha.AddDays(60)}");
            Console.WriteLine($"{Fecha} 90 días después: {Fecha.AddDays(90)}");
            Console.WriteLine($"{Fecha} 180 días después: {Fecha.AddDays(180)}");
            Console.ReadKey();
        }
예제 #18
0
        public string actualizar_estado_deshabilitar_Usuario(int id_usuario, string user)
        {
            string validacion = "fail";

            string Usuario_Edita = user;
            Fecha  fecha         = new Fecha();
            string dato          = fecha.fecha();

            Usuario usuario = new Usuario(id_usuario, dato, Usuario_Edita);


            int result = dao_usuario.ActualizarEstadoDeshabilitarUsuarioo(usuario);


            if (result == 1)
            {
                validacion = "sucess";
            }
            return(validacion);
        }
예제 #19
0
        public JsonResult actualizar_estado_deshabilitar_Tipo_Contrato(int id_tipo_contrato)
        {
            string validacion = "fail";

            string Usuario_Edita = (string)(Session["User"]);
            Fecha  fecha         = new Fecha();
            string dato          = fecha.fecha();

            Tipo_Contrato tipo_Contrato = new Tipo_Contrato(id_tipo_contrato, dato, Usuario_Edita);


            int result = dao_tipo_contrato.ActualizarEstadoDeshabilitarTipoContrato(tipo_Contrato);


            if (result == 1)
            {
                validacion = "sucess";
            }
            return(Json(validacion, JsonRequestBehavior.AllowGet));
        }
예제 #20
0
 private void inicio()
 {
     /*Si la cuota existe, no se muestra el formulario de pago*/
     Fecha fecha = new Fecha();
     bool condicion = gestorAfiliados.IsMesPago(afiliado.codigo, fecha.getAnio());
     if(condicion)
     {
         MetroFramework.MetroMessageBox.Show(this, "El afiliado documento nro: " +afiliado.nroDocumento + " ha cancelado la cuotas del mes"  ,afiliado.nombreCompleto.ToUpper(), MessageBoxButtons.OK, MessageBoxIcon.Information);
         this.Close();
     }
     else
     {
         lblCodigoAfil.Text = afiliado.codigo.ToString();
         lblNombreAfil.Text = afiliado.nombreCompleto;
         lblTipoAfiliado.Text = afiliado.tipoAfiliado;
         lblNroDoc.Text = afiliado.nroDocumento.ToString();
         lblEstadoAfil.Text = afiliado.estado;
         MiMes();
     }
 }
예제 #21
0
        public String actualizar_estado_deshabilitar_Tipo_Contrato(int id_tipo_contrato, string user)
        {
            string validacion = "fail";

            string Usuario_Edita = user;
            Fecha  fecha         = new Fecha();
            string dato          = fecha.fecha();

            Tipo_Contrato tipo_Contrato = new Tipo_Contrato(id_tipo_contrato, dato, Usuario_Edita);


            int result = dao_tipo_contrato.ActualizarEstadoDeshabilitarTipoContrato(tipo_Contrato);


            if (result == 1)
            {
                validacion = "sucess";
            }
            return(validacion);
        }
예제 #22
0
        /// <summary>
        /// Método encargado de Inicializar la Página
        /// </summary>
        private void inicializaPagina()
        {
            //Cargando Catalogos
            cargaCatalogos();

            //Inicializando GridView
            Controles.InicializaGridview(gvServicios);
            Controles.InicializaGridview(gvRequisiciones);
            Controles.InicializaGridview(gvRequisicionesServicio);

            //Inicializando Fechas
            txtFecIniReq.Text      =
                txtFecIniServ.Text = Fecha.ObtieneFechaEstandarMexicoCentro().AddMonths(-1).ToString("dd/MM/yyyy HH:mm");
            txtFecFinReq.Text      =
                txtFecFinServ.Text = Fecha.ObtieneFechaEstandarMexicoCentro().ToString("dd/MM/yyyy HH:mm");

            //Inicializando Controles
            chkIncluirReq.Checked      =
                chkIncluirServ.Checked = true;
        }
예제 #23
0
        public string actualizar_estado_deshabilitar_fase_tiempo(Fase_Tiempo fase, string user)
        {
            var    t          = fase;
            string validacion = "fail";
            Fecha  fecha      = new Fecha();

            Fase_Tiempo fase_tiempo = new Fase_Tiempo();

            fase_tiempo.ID_FASE              = t.ID_FASE;
            fase_tiempo.FECHA_MODIFICACION   = fecha.fecha();
            fase_tiempo.USUARIO_MODIFICACION = user;

            int result = dao_fase.ActualizarEstadoDeshabilitarFase(fase_tiempo);

            if (result == 1)
            {
                validacion = "sucess";
            }
            return(validacion);
        }
예제 #24
0
        public JsonResult actualizar_estado_Habilitar_Usuario(int id_usuario)
        {
            string validacion = "fail";

            string Usuario_Edita = (string)(Session["User"]);
            Fecha  fecha         = new Fecha();
            string dato          = fecha.fecha();

            Usuario usuario = new Usuario(id_usuario, dato, Usuario_Edita);


            int result = dao_usuario.ActualizarEstadoHabilitarUsuario(usuario);


            if (result == 1)
            {
                validacion = "sucess";
            }
            return(Json(validacion, JsonRequestBehavior.AllowGet));
        }
예제 #25
0
        private String ObtenerFecha(object Parametro)
        {
            DateTime Fecha;

            if (Parametro != null)
            {
                if (DateTime.TryParse(Parametro.ToString(), out Fecha))
                {
                    Fecha = Convert.ToDateTime(Parametro.ToString());
                    return(Fecha.ToShortDateString());
                }
                else
                {
                    return(null);
                }
            }
            else
            {
                return(null);
            }
        }
예제 #26
0
        public JsonResult agregar_servicio(FormCollection formCollection)
        {
            string validacion = "fail";

            string descripcion   = formCollection["descripcion"];
            string Usuario_Edita = (string)(Session["User"]);
            Fecha  fecha         = new Fecha();
            string dato          = fecha.fecha();

            Servicio serv = new Servicio(descripcion, dato, Usuario_Edita);


            int result = dao_servicio.AgregarServicio(serv);


            if (result == 1)
            {
                validacion = "sucess";
            }
            return(Json(validacion, JsonRequestBehavior.AllowGet));
        }
예제 #27
0
        public string agregar_servicio(string desc, string user)
        {
            string validacion = "fail";

            string descripcion   = desc;
            string Usuario_Edita = user;
            Fecha  fecha         = new Fecha();
            string dato          = fecha.fecha();

            Servicio serv = new Servicio(descripcion, dato, Usuario_Edita);


            int result = dao_servicio.AgregarServicio(serv);


            if (result == 1)
            {
                validacion = "sucess";
            }
            return(validacion);
        }
예제 #28
0
        //public class Hora
        //{
        //	public int id { get; set; }
        //	public string hora { get; set; }
        //}

        public List <Fecha> ObtenerFechaHora(List <CRONOGRAMA_MEDICO> cronograma)
        {
            int          intervalofecha, intervalohora;
            List <Fecha> fechas = new List <Fecha>();

            foreach (var item in cronograma)
            {
                intervalofecha = item.fechaFin.Value.DayOfYear - item.fechaInicio.Value.DayOfYear;
                intervalohora  = int.Parse(item.horaFin.Split(":")[0]) - int.Parse(item.horaInicio.Split(":")[0]);
                for (int i = 0; i <= intervalofecha; i++)
                {
                    Fecha fecha = new Fecha()
                    {
                        idprogramMed = item.idProgramMedica,
                        fecprogram   = item.fechaInicio.Value.AddDays(i).ToShortDateString()
                    };
                    fechas.Add(fecha);
                }
            }
            return(fechas);
        }
예제 #29
0
파일: Reportes.cs 프로젝트: lulzzz/SAT
        /// <summary>
        /// Obtiene la información detallada de existencias sobre de productos con fecha de caducidad menor o igual a la solicitada dentro del almacén indicado
        /// </summary>
        /// <param name="fecha_caducidad">Fecha límite de caducidad</param>
        /// <param name="id_almacen">Id de Almacén de interés</param>
        /// <returns></returns>
        public static DataTable CargaExistenciasProducto(DateTime fecha_caducidad, int id_almacen)
        {
            //Declarando objeto de resultado
            DataTable mit = null;

            //Construyendo arreglo de valores para generación de consulta
            object[] param = { 3, Fecha.ConvierteDateTimeString(fecha_caducidad, ConfigurationManager.AppSettings.Get("FormatoFechaReportes")), id_almacen, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" };

            //Generando consulta
            using (DataSet ds = CapaDatos.m_capaDeDatos.EjecutaProcAlmacenadoDataSet(_nombre_stored_procedure, param))
            {
                //Si hay resultados
                if (Validacion.ValidaOrigenDatos(ds, "Table"))
                {
                    mit = ds.Tables["Table"];
                }

                //Devolviendo resultado
                return(mit);
            }
        }
예제 #30
0
        static void Main(string[] args)
        {
            DateTime Fecha;

            while (true)
            {
                Console.Write("Ingrese una fecha: ");
                if (DateTime.TryParse(Console.ReadLine(), out Fecha))
                {
                    break;
                }
                Console.WriteLine("Fecha errónea.");
            }
            Console.WriteLine($"Día ingresado: {Fecha.Day}");
            Console.WriteLine($"Nombre de día ingresado: {Fecha.DayOfWeek}");
            Console.WriteLine($"Número de día de la semana ingresado: {Convert.ToInt32(Fecha.DayOfWeek)}");
            Console.WriteLine($"Mes ingresado: {Fecha.Month}");
            Console.WriteLine($"Nombre de Mes ingresado: {Fecha.ToString("MMMM")}");
            Console.WriteLine($"Año ingresado: {Fecha.Year}");
            Console.ReadKey();
        }
예제 #31
0
 public Empleado(string _Nombre,
                 string _Apellido,
                 Fecha _FechaDeNacimiento,
                 string _EstadoCivil,
                 string _Genero,
                 Fecha _FechaDeIngreso,
                 float _SueldoBasico,
                 Cargo _Cargo,
                 int _CantidadDeHijos, int _ID)
 {
     Nombre            = _Nombre;
     Apellido          = _Apellido;
     FechaDeNacimiento = _FechaDeNacimiento;
     EstadoCivil       = _EstadoCivil;
     Genero            = _Genero;
     FechaDeIngreso    = _FechaDeIngreso;
     SueldoBasico      = _SueldoBasico;
     Puesto            = _Cargo;
     CantidadDeHijos   = _CantidadDeHijos;
     ID = _ID;
 }
예제 #32
0
        private void crearObjetoSucursal()
        {
            currentEgreso = new Egreso();

            if (!nuevo)
            {
                currentEgreso.idEgreso = currentIDEgreso;         // Llenar el id categoria cuando este en esdo modificar
            }
            currentEgreso.numeroOperacion = textNOperacion.Text;
            currentEgreso.monto           = textMonto.Text;
            currentEgreso.moneda          = cbxMoneda.Text;
            currentEgreso.idMoneda        = Convert.ToInt32(cbxMoneda.SelectedValue);
            currentEgreso.motivo          = textMotivo.Text;
            currentEgreso.observacion     = textObcervacion.Text;
            Fecha currentFecha = new Fecha()
            {
                date = (DateTime)dtpFechaPago.Value
            };

            currentEgreso.fechaPago = currentFecha;
        }
예제 #33
0
 /// <summary>
 /// Permite conparar 2 fechas
 /// </summary>
 /// <param name="pFecha1">Fecha 1</param>
 /// <param name="pFecha2">Fecha 2</param>
 /// <returns>-1 (fecha 1 menor fecha 2), 0 (fecha 1 igual fecha 2), 1 ( fecha 2 mayor fecha 1)</returns>
 public static int CompararFechas(Fecha pFecha1, Fecha pFecha2)
 {
     //Compara la relacion entre los años
     if (pFecha1.iA < pFecha2.iA)
     {
         return(-1);
     }
     else if (pFecha1.iA > pFecha2.iA)
     {
         return(1);
     }
     else
     {
         //Compara la relacion entre los meses
         if (pFecha1.iM < pFecha2.iM)
         {
             return(-1);
         }
         else if (pFecha1.iM > pFecha2.iM)
         {
             return(1);
         }
         else
         {
             //Compara la relacion entre los dias
             if (pFecha1.iD < pFecha2.iD)
             {
                 return(-1);
             }
             else if (pFecha1.iD > pFecha2.iD)
             {
                 return(1);
             }
             else
             {
                 return(0);
             }
         }
     }
 }
예제 #34
0
        public JsonResult agregar_fase(Fase_Tiempo fase)
        {
            var    t          = fase;
            string validacion = "fail";
            Fecha  fecha      = new Fecha();

            Fase_Tiempo fase_tiempo = new Fase_Tiempo();

            fase_tiempo.DESCRIPCION      = t.DESCRIPCION;
            fase_tiempo.TIEMPO           = t.TIEMPO;
            fase_tiempo.FECHA_CREACION   = fecha.fecha();
            fase_tiempo.USUARIO_CREACION = (string)(Session["User"]);
            fase_tiempo.FK_ID_PROYECTO   = t.FK_ID_PROYECTO;

            int result = dao_fase.AgregarFase_Tiempo(fase_tiempo);

            if (result == 1)
            {
                validacion = "sucess";
            }
            return(Json(validacion, JsonRequestBehavior.AllowGet));
        }
예제 #35
0
파일: HoyMain.cs 프로젝트: Magody/ParetoKin
        public void consultarTareasAtrasadas()
        {
            using (var conn = new SqlConnection(Program.CONECCION_STRING))
            {
                conn.Open();

                // 1.  create a command object identifying the stored procedure
                SqlCommand cmd = new SqlCommand("consultarTareasAtrasadas", conn);

                // 2. set the command object so it knows to execute a stored procedure
                cmd.CommandType = CommandType.StoredProcedure;
                DateTime hoy       = DateTime.Now;
                Fecha    fecha_hoy = new Fecha(hoy.Day, hoy.Month, hoy.Year);
                cmd.Parameters.Add(new SqlParameter("@fechaHoy", fecha_hoy.ToStringReves()));


                // execute the command
                using (SqlDataReader rdr = cmd.ExecuteReader())
                {
                    while (rdr.Read())
                    {
                        dataGridViewListaTareas.Rows.Add(rdr["nombre"].ToString(), Convert.ToBoolean(rdr["importante"].ToString().ToLower()),
                                                         Convert.ToBoolean(rdr["urgente"].ToString().ToLower()),
                                                         rdr["especificacion"].ToString(),
                                                         Convert.ToBoolean(rdr["cumplido"].ToString().ToLower()),
                                                         Convert.ToInt32(rdr["tnumero"].ToString()),
                                                         Convert.ToInt32(rdr["id"].ToString()),
                                                         Convert.ToInt32(rdr["enumero"].ToString()));

                        for (int j = 0; j < dataGridViewListaTareas.Columns.Count - 1; j++)
                        {
                            dataGridViewListaTareas.Rows[dataGridViewListaTareas.Rows.Count - 1].Cells[j].Style.BackColor = colorTareasAtrasadas;
                        }
                    }
                }

                conn.Close();
            }
        }
 public void setIndicesFiltro(int indexTipoAnioParam, int indexTipoNombreParam, int indexTipoEstadoParam, string dayParam, string monthParam, string yearParam, string dayParam2, string monthParam2, string yearParam2, int idNombreParam, int idEstadoParam, int nroBobinaParam, int indexTipoClienteParam,int indexTipoPapelParam, int tipocampoFechaParam,int idTipoPapelParam,int idClienteParam)
 {
     indexTipoAnio = (Fecha)indexTipoAnioParam;
     indexTipoNombre = (Maquinista)indexTipoNombreParam;
     indexTipoEstado = (estado)indexTipoEstadoParam;
     idEstado = idEstadoParam;
     day = dayParam;
     month = monthParam;
     year = yearParam;
     day2 = dayParam2;
     month2 = monthParam2;
     year2 = yearParam2;
     idNombre = idNombreParam;
     nroBobina = nroBobinaParam;
     indexTipoCliente = (Cliente)indexTipoClienteParam;
     indexTipoPapel = (TipoPapel)indexTipoPapelParam;
     tipocampoFecha = (campoFecha)tipocampoFechaParam;
     idTipoPapel = idTipoPapelParam;
     idCliente= idClienteParam;
 }
예제 #37
0
        public void EsBisiestoTest()
        {
            Fecha fecha = new Fecha(10, 9, 2000);

            Assert.AreEqual(fecha.EsBisiesto(), true);
        }
예제 #38
0
        public IEnumerable<Fecha> GetAllFechas(string id)
        {
            Asistentes_TutoresEntities datos = new Asistentes_TutoresEntities();
            int user = datos.Tutor.Where(p => p.Nombre == id).First().Id_Tutor;
            var fe = datos.SP_Fecha(user);

            List<Fecha> fecha =new List<Fecha>();

            foreach (DateTime z  in fe){
                Fecha a = new Fecha();
                a.fecha = z.ToString("yyyy-MM-dd");
                fecha.Add(a);
            }
            return fecha;
        }
예제 #39
0
        public override Dictionary<string, int> LeerArchivo(bool cargaTipo)
        {
            try
            {
                if (File.Exists(pathFile))
                {
                    using (StreamReader sr = new StreamReader(pathFile))
                    {
                        string s = sr.ReadLine();
                        int cantidadLineas=0;
                        while (s != null)
                        {
                            cantidadLineas++;
                            string[] split = s.Split('=');

                            switch (split[0])
                            {
                                case "IP":
                                    direccionIp = split[1];
                                    nameIp = direccionIp.Split(':')[1];
                                    break;
                                case "IP2":
                                    direccionIp2 = split[1];
                                    nameIp2 = direccionIp2.Split(':')[1];
                                    break;
                                case "PUERTO":
                                    puerto = split[1];
                                    break;
                                case "PATH1":
                                    pathGuardadoInfo1 = split[1];
                                    break;
                                case "PATH2":
                                    pathGuardadoInfo2 = split[1];
                                    break;
                                case "MODO":
                                    modoApertura = (modo)(Convert.ToInt32(split[1]));
                                    break;
                                case "MYSQLTIMEOUT":
                                    mysqlTimeOut = split[1];
                                    break;
                                case "FILTROFECHA":
                                    filtroFecha = (Fecha)(Convert.ToInt32(split[1]));
                                    break;
                                case "NROBOBINA":
                                    nroBobina = split[1];
                                    break;
                                case "FILTROESTADO":
                                    filtroEstado = (estado)(Convert.ToInt32(split[1]));
                                    break;
                                case "IDEESTADO":
                                    Estado = split[1];
                                    break;
                                case "FILTROMAQUINISTA":
                                    filtroMaquinista = (Maquinista)(Convert.ToInt32(split[1]));
                                    break;
                                case "IDMAQUINISTA":
                                    maquinista = split[1];
                                    break;
                                case "FILTROTIPOPAPEL":
                                    filtroTipoPapel = (TipoPapel)(Convert.ToInt32(split[1]));
                                    break;
                                case "IDTIPOPAPEL":
                                    tipoPapel = split[1];
                                    break;
                                case "FILTROCLIENTE":
                                    filtroCliente = (Cliente)(Convert.ToInt32(split[1]));
                                    break;
                                case "IDCLIENTE":
                                    cliente = split[1];
                                    break;
                                case "CAMPOFECHA":
                                    CampoFecha = (campoFecha)(Convert.ToInt32(split[1]));
                                    break;
                                case "PORCENTAJEREMITO":
                                    porcentaje = split[1];
                                    break;
                            }
                            s = sr.ReadLine();
                        }

                        if (cantidadLineas != lineasArchivoDefault)
                        {
                            this.BorrarArchivo();
                            this.armarArchivoDefault();
                            this.guardarFiltros(filtroFecha, nroBobina, filtroEstado, Estado, filtroMaquinista, maquinista, filtroTipoPapel, tipoPapel, filtroCliente, cliente, CampoFecha, porcentaje);
                        }
                    }
                }
                else
                {
                    this.armarArchivoDefault();
                    this.guardarFiltros(filtroFecha, nroBobina, filtroEstado, Estado, filtroMaquinista, maquinista, filtroTipoPapel, tipoPapel, filtroCliente, cliente, CampoFecha, porcentaje);
                }
            }
            catch (Exception e)
            {
                this.BorrarArchivo();
                this.armarArchivoDefault();
                this.guardarFiltros(filtroFecha, nroBobina, filtroEstado, Estado, filtroMaquinista, maquinista, filtroTipoPapel, tipoPapel, filtroCliente, cliente, CampoFecha, porcentaje);
            }
            return null;
        }
예제 #40
0
 public void guardarFiltros(Fecha filtroFechaParam,string nroBobinaParam,estado filtroEstadoParam,string EstadoParam ,Maquinista filtroMaquinistaParam,string maquinistaParam,TipoPapel filtroTipoPapelParam,string tipoPapelParam,Cliente filtroClienteParam,string clienteParam,campoFecha CampoFechaParam,string porcentajeParam)
 {
     //FILTROS
     this.GuardarArchivo("FILTROFECHA=" + (Convert.ToInt32(filtroFechaParam)).ToString());
     this.GuardarArchivo("NROBOBINA=" + nroBobinaParam);
     this.GuardarArchivo("FILTROESTADO=" + (Convert.ToInt32(filtroEstadoParam)).ToString());
     this.GuardarArchivo("IDEESTADO=" + EstadoParam);
     this.GuardarArchivo("FILTROMAQUINISTA=" + (Convert.ToInt32(filtroMaquinistaParam)).ToString());
     this.GuardarArchivo("IDMAQUINISTA=" + maquinistaParam);
     this.GuardarArchivo("FILTROTIPOPAPEL=" + (Convert.ToInt32(filtroTipoPapelParam)).ToString());
     this.GuardarArchivo("IDTIPOPAPEL=" + tipoPapelParam);
     this.GuardarArchivo("FILTROCLIENTE=" + (Convert.ToInt32(filtroClienteParam)).ToString());
     this.GuardarArchivo("IDCLIENTE=" + clienteParam);
     this.GuardarArchivo("CAMPOFECHA=" + (Convert.ToInt32(CampoFechaParam)).ToString());
     this.GuardarArchivo("PORCENTAJEREMITO=" + porcentajeParam);
 }
 public void setIndicesFiltro(int indexTipoAnioParam, string dayParam, string monthParam, string yearParam, string dayParam2, string monthParam2, string yearParam2)
 {
     indexTipoAnio = (Fecha)indexTipoAnioParam;
     day = dayParam;
     month = monthParam;
     year = yearParam;
     day2 = dayParam2;
     month2 = monthParam2;
     year2 = yearParam2;
 }
예제 #42
0
        public void DiaDeLaSemanaTest()
        {
            Fecha fecha = new Fecha(1, 10, 2014);

            Assert.AreEqual(fecha.DiaSemana, "Miércoles");
        }