public bool ModificarDB(ro_fectividad_Entrega_tipoServicio_Info Info, ref string mensaje)
        {
            try
            {
                using (EntityRoles_FJ Context = new EntityRoles_FJ())
                {
                    ro_fectividad_Entrega_tipoServicio contact = Context.ro_fectividad_Entrega_tipoServicio.FirstOrDefault(q => q.IdEmpresa == Info.IdEmpresa && q.IdServicio == Info.IdServicio);
                    if (contact != null)
                    {
                        contact.ts_Descripcion = Info.ts_Descripcion;
                        contact.ts_codigo      = Info.ts_codigo;
                        contact.Porcentaje     = Info.Porcentaje;

                        contact.Efectividad_entrega  = Info.Efectividad_entrega;
                        contact.Efectividad_volumen  = Info.Efectividad_volumen;
                        contact.Recuperacion_cartera = Info.Recuperacion_cartera;
                        contact.Genera_novedad       = Info.Genera_novedad;

                        contact.IdUsuarioUltModi = Info.IdUsuarioUltModi;
                        contact.Fecha_UltMod     = DateTime.Now;
                        Context.SaveChanges();
                    }
                }
                return(true);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString();
                throw new Exception(ex.ToString());
            }
        }
 public bool AnularDB(ro_fectividad_Entrega_tipoServicio_Info Info, ref string mensaje)
 {
     try
     {
         using (EntityRoles_FJ Context = new EntityRoles_FJ())
         {
             ro_fectividad_Entrega_tipoServicio contact = Context.ro_fectividad_Entrega_tipoServicio.FirstOrDefault(q => q.IdEmpresa == Info.IdEmpresa && q.IdServicio == Info.IdServicio);
             if (contact != null)
             {
                 contact.IdUsuarioUltAnu = Info.IdUsuarioUltAnu;
                 contact.Fecha_UltAnu    = Info.Fecha_UltAnu;
                 contact.Estado          = false;
                 Context.SaveChanges();
             }
         }
         return(true);
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         mensaje = ex.ToString();
         throw new Exception(ex.ToString());
     }
 }
        public bool GuardarDB(ro_fectividad_Entrega_tipoServicio_Info Info, ref int IdServicio, ref string mensaje)
        {
            try
            {
                IdServicio = Get_Id(Info.IdEmpresa, ref mensaje);

                using (EntityRoles_FJ Context = new EntityRoles_FJ())
                {
                    ro_fectividad_Entrega_tipoServicio contact = new ro_fectividad_Entrega_tipoServicio();

                    contact.IdEmpresa            = Info.IdEmpresa;
                    contact.IdServicio           = Info.IdServicio = IdServicio;
                    contact.ts_Descripcion       = Info.ts_Descripcion;
                    contact.ts_codigo            = Info.ts_codigo;
                    contact.Porcentaje           = Info.Porcentaje;
                    contact.Estado               = Info.Estado;
                    contact.IdUsuario            = Info.IdUsuario;
                    contact.Fecha_Transaccion    = Info.Fecha_Transaccion;
                    contact.Efectividad_entrega  = Info.Efectividad_entrega;
                    contact.Efectividad_volumen  = Info.Efectividad_volumen;
                    contact.Recuperacion_cartera = Info.Recuperacion_cartera;
                    contact.Genera_novedad       = Info.Genera_novedad;

                    Context.ro_fectividad_Entrega_tipoServicio.Add(contact);
                    Context.SaveChanges();
                }

                return(true);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString();
                throw new Exception(ex.ToString());
            }
        }