public static UserEmp getInfoEmp(int IDemp) { using (var query = new DocumentControllerEntities()) { return(query.UserEmp.Find(IDemp)); } }
public static Depto getInfoDepto(int IDdepto) { using (var query = new DocumentControllerEntities()) { return(query.Depto.Find(IDdepto)); } }
public static void EliminarDept(int id) { using (var query = new DocumentControllerEntities()) { var depto = query.Depto.Find(id); query.Depto.Remove(depto); query.SaveChanges(); } }
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(); } }
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()); } }
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); } }