Exemple #1
0
 public InformeEntity()
 {
     objPlantilla       = new PlantillaEntity();
     objPartida         = new PartidaEntity();
     objEmpleadoAprueba = new EmpleadoEntity();
     objEmpleadoRespon  = new EmpleadoEntity();
 }
 public PlantillaDetaEntity()
 {
     objPlantilla = new PlantillaEntity();
     objPartida = new PartidaEntity();
     objEmpleadoAprueba = new EmpleadoEntity();
     objEmpleadoRespon = new EmpleadoEntity();
 }
 public ReturnValor ActualizarPlantillaEstado(PlantillaEntity objPlantillaEntity)
 {
     try
     {
         //using (TransactionScope tx = new TransactionScope(TransactionScopeOption.Required))
         //{
         oPlantillaData = new PlantillaData();
         oReturnValor.Exitosa = oPlantillaData.ActualizarEstado(objPlantillaEntity);
         if (oReturnValor.Exitosa)
         {
             oReturnValor.Message = HelpMessages.Evento_EDIT;
             //tx.Complete();
         }
         //}
     }
     catch (Exception ex)
     {
         oReturnValor = HelpException.mTraerMensaje(ex);
     }
     return oReturnValor;
 }
Exemple #4
0
 /// <summary>
 /// Retorna un LISTA de registros de la Entidad Presupuesto.Plantilla
 /// En la BASE de DATO la Tabla : [Presupuesto.Plantilla]
 /// <summary>
 /// <returns>List</returns>
 public List<PlantillaEntity> Listar(Parametro pLista)
 {
     List<PlantillaEntity> lstPlantillaEntity = new List<PlantillaEntity>();
     try
     {
         using (_DBMLPresupuestoDataContext SQLDC = new _DBMLPresupuestoDataContext(conexion))
         {
             var resul = SQLDC.pa_S_Plantilla(null, pLista.numAnio, pLista.codArea);
             foreach (var item in resul)
             {
                 PlantillaEntity objPlantillaEntity = new PlantillaEntity();
                 objPlantillaEntity.Codigo = item.codPlantilla;
                 objPlantillaEntity.numPlantilla = item.numPlantilla;
                 objPlantillaEntity.objPresupuesto.desNombre = item.nombrePresupuesto;
                 objPlantillaEntity.objPresupuesto.numAnio = item.numAnio;
                 objPlantillaEntity.objPresupuesto.fecCierre = item.fecCierre;
                 objPlantillaEntity.objArea.desNombre = item.codAreaNombre;
                 objPlantillaEntity.objEmpleado.desNombre = item.desEmpleadoActual;
                 objPlantillaEntity.codRegEstadoNombre = item.EstadoPlantilla;
                 objPlantillaEntity.segUsuarioCrea = item.segUsuarioCrea;
                 objPlantillaEntity.segFechaCrea= item.segFechaCrea;
                 objPlantillaEntity.segUsuarioEdita = item.segUsuarioEdita;
                 objPlantillaEntity.segFechaEdita = item.segFechaEdita;
                 objPlantillaEntity.monEstimadoTotal = item.monEstimadoTotalxArea.HasValue ? item.monEstimadoTotalxArea.Value : 0;
                 objPlantillaEntity.numDiasExtemporaneo = item.numDiasExtemporaneo;
                 objPlantillaEntity.fecCierreExtempor = item.fecCierre.HasValue ? item.fecCierre.Value.AddDays(item.numDiasExtemporaneo).ToShortDateString() : string.Empty;
                 lstPlantillaEntity.Add(objPlantillaEntity);
             }
         }
     }
     catch (Exception ex)
     {
         log.Error(String.Concat("Listar", " | ", ex.Message.ToString()));
         throw ex;
     }
     return lstPlantillaEntity;
 }
        public ActionResult PlantillaTerminarIngreso(int pID)
        {
            string tipoDevol = null;
            object DataDevol = null;
            object jsonResponse;
            try
            {
                objPlantillaLogic = new PlantillaLogic();
                PlantillaEntity objPlantillaEntity = new PlantillaEntity
                {
                    Codigo = pID,
                    segUsuarioEdita = HttpContext.User.Identity.Name,
                    segUsuarioCrea = HttpContext.User.Identity.Name,
                    segMaquinaOrigen = GetIPAddress(),
                    codRegEstado = Convert.ToInt32(HelpRegEstado.Plantilla.TERMINADA_INGRESO)
                };
                returnValor = objPlantillaLogic.ActualizarPlantillaEstado(objPlantillaEntity);

                DataDevol = returnValor.Message;
                tipoDevol = returnValor.Exitosa ? "C" : "I";

            }
            catch (Exception ex)
            {
                tipoDevol = "E";
                log.Error(String.Concat("PlantillaTerminarIngreso", " | ", ex.Message));
                DataDevol = ex.Message;
            }
            finally
            {
                jsonResponse = new
                {
                    Type = tipoDevol,
                    Data = DataDevol,
                };
            }
            return Json(jsonResponse, JsonRequestBehavior.AllowGet);
        }
Exemple #6
0
        /// <summary>
        /// Almacena el registro de una ENTIDAD de registro de Tipo Partida
        /// En la BASE de DATO la Tabla : [Presupuesto.Partida]
        /// <summary>
        /// <param name = >itemPartida</param>
        public bool ActualizarEstado(PlantillaEntity objPlantilla)
        {
            int codigoRetorno = -1;
            try
            {
                using (_DBMLPresupuestoDataContext SQLDC = new _DBMLPresupuestoDataContext(conexion))
                {
                    SQLDC.pa_U_Plantilla_Estado(
                        objPlantilla.Codigo,
                        objPlantilla.codRegEstado,
                        objPlantilla.segUsuarioEdita,
                        objPlantilla.segMaquinaOrigen);

                    codigoRetorno = 0;
                }
            }
            catch (Exception ex)
            {
                log.Error(String.Concat("ActualizarEstado", " | ", ex.Message.ToString()));
                throw ex;
            }
            return codigoRetorno == 0 ? true : false;
        }