Ejemplo n.º 1
0
        public Boolean GrabarBD(ro_Empleado_X_Horario_Info info, ref string msg)
        {
            try {
                using (EntitiesRoles db = new EntitiesRoles()){
                    ro_empleado_x_horario item = new ro_empleado_x_horario();

                    item.IdEmpresa        = info.IdEmpresa;
                    item.IdEmpleado       = info.IdEmpleado;
                    item.IdHorario        = info.IdHorario;
                    item.EsPredeterminado = info.EsPredeterminado;
                    item.FechaIngresa     = info.FechaIngresa;
                    item.UsuarioIngresa   = info.UsuarioIngresa;

                    db.ro_empleado_x_horario.Add(item);
                    db.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);
                mensaje = ex.InnerException + " " + ex.Message;
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                throw new Exception(ex.InnerException.ToString());
            }
        }
Ejemplo n.º 2
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;
            }
        }
Ejemplo n.º 3
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;
     }
 }