Beispiel #1
0
        public int Actualiza(int pIntIdCronograma, int pIntIdExpediente, int pIntPlazoEjecucion)
        {
            int intResultado = -999;
            int intRows      = 0;

            try
            {
                ObrasPublicasEntities   objContext             = new ObrasPublicasEntities();
                OP_CRONOGRAMA_EJECUCION objCronogramaEjecucion = objContext.OP_CRONOGRAMA_EJECUCION.First(x => x.coCronograma == pIntIdCronograma);

                if (objCronogramaEjecucion != null)
                {
                    objCronogramaEjecucion.nuPlazoEjecucion = pIntPlazoEjecucion;

                    intRows = objContext.SaveChanges();

                    if (intRows > 0)
                    {
                        intResultado = 1;
                    }
                }
            }
            catch (Exception ex)
            {
            }
            return(intResultado);
        }
Beispiel #2
0
        public int Inserta(int pIntIdExpediente, int pIntPlazoEjecucion)
        {
            int intResultado = -999;
            int intRows;

            try
            {
                ObrasPublicasEntities objContext = new ObrasPublicasEntities();

                OP_CRONOGRAMA_EJECUCION objCronogramaEjecucion = new OP_CRONOGRAMA_EJECUCION();
                objCronogramaEjecucion.coExpediente     = pIntIdExpediente;
                objCronogramaEjecucion.feEmision        = DateTime.Now;
                objCronogramaEjecucion.nuPlazoEjecucion = pIntPlazoEjecucion;

                objContext.AddToOP_CRONOGRAMA_EJECUCION(objCronogramaEjecucion);
                intRows = objContext.SaveChanges();

                if (intRows > 0)
                {
                    intResultado = 1;
                }
            }
            catch (Exception ex)
            {
                intResultado = -999;
            }
            return(intResultado);
        }