예제 #1
0
 public static UserEmp getInfoEmp(int IDemp)
 {
     using (var query = new DocumentControllerEntities())
     {
         return(query.UserEmp.Find(IDemp));
     }
 }
예제 #2
0
 public static Depto getInfoDepto(int IDdepto)
 {
     using (var query = new DocumentControllerEntities())
     {
         return(query.Depto.Find(IDdepto));
     }
 }
예제 #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();
     }
 }
예제 #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();
     }
 }
예제 #5
0
 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();
     }
 }
예제 #6
0
 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();
     }
 }
예제 #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());
     }
 }
예제 #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);
     }
 }