Exemplo n.º 1
0
        public ro_empleado_x_horario_Info get_info(int IdEmpresa, int IdEmpleado)
        {
            try
            {
                ro_empleado_x_horario_Info info = new  ro_empleado_x_horario_Info();

                using (Entities_rrhh Context = new Entities_rrhh())
                {
                    ro_empleado_x_horario Entity = Context.ro_empleado_x_horario.FirstOrDefault(q => q.IdEmpresa == IdEmpresa && q.IdEmpleado == IdEmpleado);
                    if (Entity == null)
                    {
                        return(null);
                    }

                    info = new  ro_empleado_x_horario_Info
                    {
                        IdEmpresa        = Entity.IdEmpresa,
                        IdEmpleado       = Entity.IdEmpleado,
                        IdHorario        = Entity.IdHorario,
                        EsPredeterminado = Entity.EsPredeterminado
                    };
                }

                return(info);
            }
            catch (Exception)
            {
                throw;
            }
        }
 public bool anularDB(ro_empleado_x_horario_Info info)
 {
     try
     {
         return(odata.anularDB(info));
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 3
0
        public bool anularDB(ro_empleado_x_horario_Info info)
        {
            try
            {
                using (Entities_rrhh Context = new Entities_rrhh())
                {
                    Context.Database.ExecuteSqlCommand("delete ro_empleado_x_horario where Idempresa='" + info.IdEmpresa + "' and IdEmpleado ='" + info.IdEmpleado + "'");
                }

                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 4
0
 public bool guardarDB(ro_empleado_x_horario_Info info)
 {
     try
     {
         using (Entities_rrhh Context = new Entities_rrhh())
         {
             ro_empleado_x_horario Entity = new  ro_empleado_x_horario
             {
                 IdEmpresa      = info.IdEmpresa,
                 IdEmpleado     = info.IdEmpleado,
                 IdHorario      = info.IdHorario,
                 FechaIngresa   = info.FechaIngresa,
                 UsuarioIngresa = info.UsuarioIngresa
             };
             Context.ro_empleado_x_horario.Add(Entity);
             Context.SaveChanges();
         }
         return(true);
     }
     catch (Exception)
     {
         throw;
     }
 }