Exemple #1
0
 public static UserEmp getInfoEmp(int IDemp)
 {
     using (var query = new DocumentControllerEntities())
     {
         return(query.UserEmp.Find(IDemp));
     }
 }
Exemple #2
0
 public static Depto getInfoDepto(int IDdepto)
 {
     using (var query = new DocumentControllerEntities())
     {
         return(query.Depto.Find(IDdepto));
     }
 }
Exemple #3
0
 public static void EliminarDept(int id)
 {
     using (var query = new DocumentControllerEntities())
     {
         var depto = query.Depto.Find(id);
         query.Depto.Remove(depto);
         query.SaveChanges();
     }
 }
Exemple #4
0
 public static void EliminarEmp(int id)
 {
     using (var query = new DocumentControllerEntities())
     {
         var emp = query.UserEmp.Find(id);
         query.UserEmp.Remove(emp);
         query.SaveChanges();
     }
 }
 public void EditarDepartamentos(Depto dep)
 {
     using (var query = new DocumentControllerEntities())
     {
         var a = query.Depto.Find(dep.idDepto);
         a.siglas   = dep.siglas;
         a.FullName = dep.FullName;
         query.SaveChanges();
     }
 }
 public void EditarEmpleado(UserEmp emp)
 {
     using (var query = new DocumentControllerEntities())
     {
         var d = query.UserEmp.Find(emp.idUserEmp);
         d.FirstName = emp.FirstName;
         d.LastName  = emp.LastName;
         d.Email     = emp.Email;
         d.password  = emp.password;
         d.Position  = emp.Position;
         d.Depto     = emp.Depto;
         query.SaveChanges();
     }
 }
Exemple #7
0
 public List <UserEmp> verificacion(string user, string password)
 {
     using (var Query = new DocumentControllerEntities())
     {
         var usuario = from registro in Query.UserEmp
                       where registro.Email == user && registro.password == password
                       select registro;
         DatosUser.usuario = (from d in Query.UserEmp
                              where d.Email == user && d.password == password
                              select d.idUserEmp).Single();
         DatosUser.Depa = (from d in Query.UserEmp
                           where d.Email == user && d.password == password
                           select d.idUserEmp).Single();
         return(usuario.ToList());
     }
 }
Exemple #8
0
 public static ReporteDocument getInfoReport(int id)
 {
     using (var query = new DocumentControllerEntities())
     {
         var data = (from index in query.ReporteDocument
                     where index.Documento_ID == id
                     select new Reporte
         {
             Documento_ID = index.Documento_ID,
             Empleado = index.Empleado,
             Departamento_ = index.Departamento_,
             Documento_Generado = index.Documento_Generado,
             Fecha_Creacion = index.Fecha_Creacion,
             Codigo_Documento = index.Codigo_Documento
         }).Single();
         return(data);
     }
 }