private List <Permission> Get_Permission_By_Id(int id_rol = 1) { var list = (from permission in connection.SGA_PERMISOS join rolU in connection.SGA_ROLES_PERMISOS on new { x = permission.ID, y = id_rol } equals new { x = rolU.ID_PERMISO, y = rolU.ID_ROL } into UnionValues from rolU in UnionValues.DefaultIfEmpty() select new Permission { ID = permission.ID, Category = permission.CATEGORIA.Value, Description = permission.NOMBRE, Active = (rolU == null ? false : true) }); return(list.ToList()); }
public List <Product> Get_Products_By_Mov(string Id_Move = "0") { BMS_DATA_DENTEntities connection = BDConnection.Get_Connection(); var model = (from seri in connection.INV_MOVS join prod in connection.INV_PROD on new { x = seri.CIA, y = seri.COD_PROD } equals new { x = prod.CIA, y = prod.COD_PROD } into UnionValues from product in UnionValues.DefaultIfEmpty() where seri.NUM_DOC == Id_Move && seri.CIA == "003" select new Product { id = seri.CONSECUTIVO, cod_prod = seri.COD_PROD, description = product.NOMBRE_1, serial_number = seri.SERIE, category = product.NOTAS }).ToList(); return(model); }