├── test.txt ├── Andricsak ├── Laborator │ ├── Laborator3 │ │ ├── test.txt │ │ ├── Laborator2.csproj │ │ └── Program.cs │ ├── Laborator2 │ │ ├── appsettings.json │ │ ├── appsettings.Development.json │ │ ├── Studenti.cs │ │ ├── Laborator2.csproj │ │ ├── Student.cs │ │ ├── Program.cs │ │ ├── Controllers │ │ │ ├── ValuesController.cs │ │ │ └── StudentController.cs │ │ └── Startup.cs │ ├── Laborator5WebJob │ │ ├── StudentsAPI │ │ │ ├── appsettings.json │ │ │ ├── appsettings.Development.json │ │ │ ├── StudentsAPI.csproj │ │ │ ├── StudentModel.cs │ │ │ ├── Student.cs │ │ │ ├── Program.cs │ │ │ ├── .vscode │ │ │ │ ├── launch.json │ │ │ │ └── tasks.json │ │ │ ├── Startup.cs │ │ │ ├── Controllers │ │ │ │ └── StudentsController.cs │ │ │ └── StudentsService.cs │ │ └── WebJob │ │ │ ├── WebJob.csproj │ │ │ ├── StudentEntity.cs │ │ │ └── Program.cs │ ├── Laborator6WebQueue │ │ ├── StudentsAPI │ │ │ ├── appsettings.json │ │ │ ├── appsettings.Development.json │ │ │ ├── StudentModel.cs │ │ │ ├── StudentsAPI.csproj │ │ │ ├── Student.cs │ │ │ ├── Program.cs │ │ │ ├── .vscode │ │ │ │ ├── launch.json │ │ │ │ └── tasks.json │ │ │ ├── Startup.cs │ │ │ ├── StudentsService.cs │ │ │ └── Controllers │ │ │ │ └── StudentsController.cs │ │ └── Receive │ │ │ ├── Receive.csproj │ │ │ ├── Student.cs │ │ │ └── Program.cs │ └── Laborator4Azure │ │ ├── Andricsak.csproj │ │ ├── StudentEntity.cs │ │ └── Program.cs └── Proiect │ └── AnimalDanger │ ├── react-client │ ├── build │ │ ├── robots.txt │ │ ├── favicon.ico │ │ ├── logo192.png │ │ ├── logo512.png │ │ ├── static │ │ │ ├── css │ │ │ │ ├── main.a8cd3667.chunk.css │ │ │ │ └── main.a8cd3667.chunk.css.map │ │ │ └── js │ │ │ │ ├── runtime-main.297d04f9.js │ │ │ │ └── main.767cb65b.chunk.js │ │ ├── manifest.json │ │ ├── precache-manifest.33e5e80196ca2f57e47bf86f453e2024.js │ │ ├── service-worker.js │ │ ├── asset-manifest.json │ │ └── index.html │ ├── public │ │ ├── robots.txt │ │ ├── favicon.ico │ │ ├── logo192.png │ │ ├── logo512.png │ │ ├── manifest.json │ │ └── index.html │ ├── src │ │ ├── components │ │ │ ├── nature.jpeg │ │ │ ├── Login.css │ │ │ ├── NavMenu.css │ │ │ ├── Home.js │ │ │ ├── Layout.js │ │ │ ├── PrivateRoute.js │ │ │ ├── NavMenu.js │ │ │ ├── Intro.css │ │ │ ├── ViewAnimals.js │ │ │ ├── Login.js │ │ │ └── AddAnimal.js │ │ ├── App.test.js │ │ ├── App.css │ │ ├── index.css │ │ ├── index.js │ │ ├── App.js │ │ └── serviceWorker.js │ ├── .gitignore │ └── package.json │ ├── AnimalDanger │ ├── appsettings.Development.json │ ├── Models │ │ ├── AnimalType.cs │ │ ├── Alert.cs │ │ └── Animal.cs │ ├── appsettings.json │ ├── Repositories │ │ ├── IAnimalRepo.cs │ │ ├── AnimalRepo.cs │ │ └── AlertRepo.cs │ ├── Program.cs │ ├── AnimalDangerApi.csproj │ ├── Startup.cs │ └── Controllers │ │ └── AnimalController.cs │ ├── BackgroundWorker │ ├── Models │ │ ├── AnimalType.cs │ │ ├── Alert.cs │ │ └── Animal.cs │ ├── BackgroundWorker.csproj │ ├── Settings.job │ ├── Program.cs │ ├── Operations │ │ └── AreaOperations.cs │ └── Repositories │ │ └── AlertRepo.cs │ └── AnimalDanger.sln ├── _Exemple ├── Lab 5 │ └── AzureFunction │ │ ├── host.json │ │ ├── .vscode │ │ ├── extensions.json │ │ ├── settings.json │ │ ├── launch.json │ │ └── tasks.json │ │ ├── local.settings.json │ │ ├── Models │ │ ├── BankTransactionStatistics.cs │ │ └── BankTransaction.cs │ │ ├── AzureFunction.csproj │ │ └── TableStorageAzureFunction.cs ├── Lab 6 │ ├── AzureFunction │ │ ├── host.json │ │ ├── .vscode │ │ │ ├── extensions.json │ │ │ ├── settings.json │ │ │ ├── launch.json │ │ │ └── tasks.json │ │ ├── Models │ │ │ ├── QueueMessage.cs │ │ │ ├── BankTransactionStatistics.cs │ │ │ └── BankTransaction.cs │ │ ├── local.settings.json │ │ ├── AzureFunction.csproj │ │ ├── BankTransactionQueueFunction.cs │ │ └── TableStorageAzureFunction.cs │ └── QueueConsoleApp │ │ ├── QueueConsoleApp.csproj │ │ ├── Models │ │ └── QueueMessage.cs │ │ ├── .vscode │ │ ├── launch.json │ │ └── tasks.json │ │ └── Program.cs ├── AzureFunc-WebApi │ ├── AzureFunction │ │ ├── host.json │ │ ├── .vscode │ │ │ ├── extensions.json │ │ │ ├── settings.json │ │ │ ├── launch.json │ │ │ └── tasks.json │ │ ├── local.settings.json │ │ ├── Models │ │ │ └── MyValue.cs │ │ ├── AzureFunction.csproj │ │ └── ServiceBusQueueTriggerCSharp.cs │ └── WebApi │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── Models │ │ └── MyValue.cs │ │ ├── WebApi.csproj │ │ ├── Program.cs │ │ ├── Startup.cs │ │ ├── .vscode │ │ ├── tasks.json │ │ └── launch.json │ │ └── Controllers │ │ └── ValuesController.cs ├── Lab 3 │ ├── GoogleDriveApp │ │ ├── testfile.xml │ │ ├── CreateGoogleFile.cs │ │ ├── credentials.json │ │ ├── GoogleDriveApiApp.csproj │ │ └── .vscode │ │ │ ├── launch.json │ │ │ └── tasks.json │ └── Pasi pentru dezvoltare google app.docx └── Lab 2 │ └── WebApi │ ├── appsettings.Development.json │ ├── Models │ └── Student.cs │ ├── appsettings.json │ ├── DATC_lab2.csproj │ ├── Program.cs │ ├── Startup.cs │ ├── .vscode │ ├── tasks.json │ └── launch.json │ └── Controllers │ ├── StudentController.cs │ └── Student2Controller.cs ├── index.html └── RUS_ALEXANDRU └── Lab2 └── WebApi ├── appsettings.Development.json ├── Models └── Student.cs ├── appsettings.json ├── DATC_lab2.csproj ├── Program.cs ├── Controllers ├── ValuesController.cs └── StudentController.cs ├── Startup.cs └── .vscode ├── tasks.json └── launch.json /test.txt: -------------------------------------------------------------------------------- 1 | Hello, world! 2 | 3 | This is an edit! -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator3/test.txt: -------------------------------------------------------------------------------- 1 | Some text 2 | -------------------------------------------------------------------------------- /_Exemple/Lab 5/AzureFunction/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0" 3 | } -------------------------------------------------------------------------------- /_Exemple/Lab 6/AzureFunction/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0" 3 | } -------------------------------------------------------------------------------- /_Exemple/AzureFunc-WebApi/AzureFunction/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0" 3 | } -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/build/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | -------------------------------------------------------------------------------- /_Exemple/Lab 3/GoogleDriveApp/testfile.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /_Exemple/Lab 3/Pasi pentru dezvoltare google app.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diercan/DATC-2019/HEAD/_Exemple/Lab 3/Pasi pentru dezvoltare google app.docx -------------------------------------------------------------------------------- /_Exemple/Lab 5/AzureFunction/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "ms-azuretools.vscode-azurefunctions", 4 | "ms-vscode.csharp" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /_Exemple/Lab 6/AzureFunction/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "ms-azuretools.vscode-azurefunctions", 4 | "ms-vscode.csharp" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/build/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diercan/DATC-2019/HEAD/Andricsak/Proiect/AnimalDanger/react-client/build/favicon.ico -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/build/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diercan/DATC-2019/HEAD/Andricsak/Proiect/AnimalDanger/react-client/build/logo192.png -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/build/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diercan/DATC-2019/HEAD/Andricsak/Proiect/AnimalDanger/react-client/build/logo512.png -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diercan/DATC-2019/HEAD/Andricsak/Proiect/AnimalDanger/react-client/public/favicon.ico -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diercan/DATC-2019/HEAD/Andricsak/Proiect/AnimalDanger/react-client/public/logo192.png -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diercan/DATC-2019/HEAD/Andricsak/Proiect/AnimalDanger/react-client/public/logo512.png -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator2/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /_Exemple/AzureFunc-WebApi/AzureFunction/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "ms-azuretools.vscode-azurefunctions", 4 | "ms-vscode.csharp" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/src/components/nature.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diercan/DATC-2019/HEAD/Andricsak/Proiect/AnimalDanger/react-client/src/components/nature.jpeg -------------------------------------------------------------------------------- /_Exemple/Lab 3/GoogleDriveApp/CreateGoogleFile.cs: -------------------------------------------------------------------------------- 1 | namespace GoogleDriveApiApp 2 | { 3 | internal class CreateGoogleFile 4 | { 5 | public string name { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator5WebJob/StudentsAPI/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator6WebQueue/StudentsAPI/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator2/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /_Exemple/AzureFunc-WebApi/AzureFunction/local.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "AzureWebJobsStorage": "", 5 | "FUNCTIONS_WORKER_RUNTIME": "dotnet", 6 | "ConnectionStringKey": "" 7 | } 8 | } -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/AnimalDanger/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/src/components/Login.css: -------------------------------------------------------------------------------- 1 | @media all and (min-width: 480px) { 2 | .Login { 3 | padding: 60px 0; 4 | } 5 | 6 | .Login form { 7 | margin: 0 auto; 8 | max-width: 320px; 9 | } 10 | } -------------------------------------------------------------------------------- /_Exemple/Lab 2/WebApi/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator5WebJob/StudentsAPI/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator6WebQueue/StudentsAPI/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /RUS_ALEXANDRU/Lab2/WebApi/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /_Exemple/AzureFunc-WebApi/WebApi/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /_Exemple/Lab 3/GoogleDriveApp/credentials.json: -------------------------------------------------------------------------------- 1 | { 2 | "installed": 3 | { 4 | "auth_provider_x509_cert_url": "", 5 | "auth_uri": "", 6 | "client_id": "", 7 | "client_secret": "", 8 | "project_id": "", 9 | "redirect_uris": [ "", "" ], 10 | "token_uri": "" 11 | } 12 | } -------------------------------------------------------------------------------- /RUS_ALEXANDRU/Lab2/WebApi/Models/Student.cs: -------------------------------------------------------------------------------- 1 | namespace DATC_lab2.Models 2 | { 3 | public class Student 4 | { 5 | public int Id { get; set; } 6 | public string Name { get; set; } 7 | public string Email { get; set; } 8 | public int Age { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /_Exemple/Lab 2/WebApi/Models/Student.cs: -------------------------------------------------------------------------------- 1 | namespace DATC_lab2.Models 2 | { 3 | public class Student 4 | { 5 | public int Id { get; set; } 6 | public string Name { get; set; } 7 | public string Email { get; set; } 8 | public int Age { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /RUS_ALEXANDRU/Lab2/WebApi/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "Debug": { 5 | "LogLevel": { 6 | "Default": "Warning" 7 | } 8 | }, 9 | "Console": { 10 | "LogLevel": { 11 | "Default": "Warning" 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /_Exemple/Lab 2/WebApi/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "Debug": { 5 | "LogLevel": { 6 | "Default": "Warning" 7 | } 8 | }, 9 | "Console": { 10 | "LogLevel": { 11 | "Default": "Warning" 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /_Exemple/Lab 5/AzureFunction/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "azureFunctions.deploySubpath": "bin/Release/netcoreapp2.1/publish", 3 | "azureFunctions.projectLanguage": "C#", 4 | "azureFunctions.projectRuntime": "~2", 5 | "debug.internalConsoleOptions": "neverOpen", 6 | "azureFunctions.preDeployTask": "publish" 7 | } -------------------------------------------------------------------------------- /_Exemple/Lab 6/AzureFunction/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "azureFunctions.deploySubpath": "bin/Release/netcoreapp2.1/publish", 3 | "azureFunctions.projectLanguage": "C#", 4 | "azureFunctions.projectRuntime": "~2", 5 | "debug.internalConsoleOptions": "neverOpen", 6 | "azureFunctions.preDeployTask": "publish" 7 | } -------------------------------------------------------------------------------- /_Exemple/AzureFunc-WebApi/WebApi/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "Debug": { 5 | "LogLevel": { 6 | "Default": "Warning" 7 | } 8 | }, 9 | "Console": { 10 | "LogLevel": { 11 | "Default": "Warning" 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /_Exemple/AzureFunc-WebApi/AzureFunction/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "azureFunctions.deploySubpath": "bin/Release/netcoreapp2.1/publish", 3 | "azureFunctions.projectLanguage": "C#", 4 | "azureFunctions.projectRuntime": "~2", 5 | "debug.internalConsoleOptions": "neverOpen", 6 | "azureFunctions.preDeployTask": "publish" 7 | } -------------------------------------------------------------------------------- /_Exemple/Lab 5/AzureFunction/local.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "AzureWebJobsStorage": "", 5 | "FUNCTIONS_WORKER_RUNTIME": "dotnet" 6 | }, 7 | "extensionBundle": { 8 | "id": "Microsoft.Azure.Functions.ExtensionBundle", 9 | "version": "[1.*, 2.0.0) 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/AnimalDanger/Models/AnimalType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace AnimalDangerApi.Models 7 | { 8 | public enum AnimalType 9 | { 10 | Bear, 11 | Fox, 12 | Wolf 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | it('renders without crashing', () => { 6 | const div = document.createElement('div'); 7 | ReactDOM.render(, div); 8 | ReactDOM.unmountComponentAtNode(div); 9 | }); 10 | -------------------------------------------------------------------------------- /_Exemple/Lab 5/AzureFunction/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Attach to .NET Functions", 6 | "type": "coreclr", 7 | "request": "attach", 8 | "processId": "${command:azureFunctions.pickProcess}" 9 | } 10 | ] 11 | } -------------------------------------------------------------------------------- /_Exemple/Lab 6/AzureFunction/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Attach to .NET Functions", 6 | "type": "coreclr", 7 | "request": "attach", 8 | "processId": "${command:azureFunctions.pickProcess}" 9 | } 10 | ] 11 | } -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/BackgroundWorker/Models/AnimalType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace BackgroundWorker.Models 7 | { 8 | public enum AnimalType 9 | { 10 | Bear, 11 | Fox, 12 | Wolf 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /_Exemple/AzureFunc-WebApi/AzureFunction/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Attach to .NET Functions", 6 | "type": "coreclr", 7 | "request": "attach", 8 | "processId": "${command:azureFunctions.pickProcess}" 9 | } 10 | ] 11 | } -------------------------------------------------------------------------------- /_Exemple/Lab 6/AzureFunction/Models/QueueMessage.cs: -------------------------------------------------------------------------------- 1 | namespace AzureFunction.Models 2 | { 3 | public class QueueMessage 4 | { 5 | public string SenderName { get; set; } 6 | public string DestinationAccount { get; set; } 7 | public string DestinationName { get; set; } 8 | public int Ammount { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /_Exemple/Lab 6/AzureFunction/local.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "AzureWebJobsStorage": "", 5 | "FUNCTIONS_WORKER_RUNTIME": "dotnet", 6 | "ConnectionStringKey": "" 7 | }, 8 | "extensionBundle": { 9 | "id": "Microsoft.Azure.Functions.ExtensionBundle", 10 | "version": "[1.*, 2.0.0)" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator4Azure/Andricsak.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp2.1 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator5WebJob/WebJob/WebJob.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp2.1 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/src/components/NavMenu.css: -------------------------------------------------------------------------------- 1 | a.navbar-brand { 2 | white-space: normal; 3 | text-align: center; 4 | word-break: break-all; 5 | } 6 | 7 | html { 8 | font-size: 14px; 9 | } 10 | @media (min-width: 768px) { 11 | html { 12 | font-size: 16px; 13 | } 14 | } 15 | 16 | .box-shadow { 17 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 18 | } 19 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | 12 | # misc 13 | .DS_Store 14 | .env.local 15 | .env.development.local 16 | .env.test.local 17 | .env.production.local 18 | 19 | npm-debug.log* 20 | yarn-debug.log* 21 | yarn-error.log* 22 | -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator3/Laborator2.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp2.1 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | } 8 | 9 | .App-header { 10 | background-color: #282c34; 11 | min-height: 100vh; 12 | display: flex; 13 | flex-direction: column; 14 | align-items: center; 15 | justify-content: center; 16 | font-size: calc(10px + 2vmin); 17 | color: white; 18 | } 19 | 20 | .App-link { 21 | color: #09d3ac; 22 | } 23 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/src/components/Home.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | 3 | export class Home extends Component { 4 | static displayName = Home.name; 5 | 6 | render () { 7 | return ( 8 |
9 |

Welcome to animal danger administrator application!

10 |

Here you can view if dangerous animals are inside a city!

11 |
12 | ); 13 | } 14 | } 15 | 16 | 17 | -------------------------------------------------------------------------------- /_Exemple/Lab 6/QueueConsoleApp/QueueConsoleApp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/AnimalDanger/Models/Alert.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.WindowsAzure.Storage.Table; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace AnimalDangerApi.Models 8 | { 9 | public class Alert : TableEntity 10 | { 11 | public string Description { get; set; } 12 | public int Id { get; set; } 13 | public string City { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/BackgroundWorker/Models/Alert.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.WindowsAzure.Storage.Table; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace BackgroundWorker.Models 8 | { 9 | public class Alert : TableEntity 10 | { 11 | public string Description { get; set; } 12 | public int Id { get; set; } 13 | public string City { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", 4 | "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator2/Studenti.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using StudentNameSpace; 4 | namespace StudentiNameSpace 5 | { 6 | public static class Studenti{ 7 | public static List students = new List() 8 | { 9 | new Student(1,"Vasile","Politehnica",3), 10 | new Student(2,"Ion","Politehnica",1), 11 | new Student(3,"Marie","Politehnica",2) 12 | }; 13 | } 14 | } -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/src/components/Layout.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { Container } from 'reactstrap'; 3 | import { NavMenu } from './NavMenu'; 4 | 5 | export class Layout extends Component { 6 | static displayName = Layout.name; 7 | 8 | render () { 9 | return ( 10 |
11 | 12 | 13 | {this.props.children} 14 | 15 |
16 | ); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator2/Laborator2.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /_Exemple/Lab 5/AzureFunction/Models/BankTransactionStatistics.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.WindowsAzure.Storage.Table; 2 | 3 | namespace AzureFunction.Models 4 | { 5 | class BankTransactionStatistics : TableEntity 6 | { 7 | public BankTransactionStatistics(string id, string senderName) 8 | { 9 | this.RowKey = id; 10 | this.PartitionKey = senderName; 11 | } 12 | 13 | public BankTransactionStatistics() { } 14 | 15 | public int Ammount { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /_Exemple/Lab 6/AzureFunction/Models/BankTransactionStatistics.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.WindowsAzure.Storage.Table; 2 | 3 | namespace AzureFunction.Models 4 | { 5 | class BankTransactionStatistics : TableEntity 6 | { 7 | public BankTransactionStatistics(string id, string senderName) 8 | { 9 | this.RowKey = id; 10 | this.PartitionKey = senderName; 11 | } 12 | 13 | public BankTransactionStatistics() { } 14 | 15 | public int Ammount { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/AnimalDanger/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*", 10 | "ConnectionStrings": { 11 | "AzureConnectionString": "DefaultEndpointsProtocol=https;AccountName=animaldanger;AccountKey=eu+i0X92PnCCcrPXYdEfzo/onHrgZheCxZY3xsO5mj4Amm1zwF2bEIYpVY7aknILcZETcysR5hDHtN3qokhoXg==;EndpointSuffix=core.windows.net" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator6WebQueue/Receive/Receive.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp2.1 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/AnimalDanger/Models/Animal.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.WindowsAzure.Storage.Table; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace AnimalDangerApi.Models 8 | { 9 | public class Animal : TableEntity 10 | { 11 | public int Id { get; set; } 12 | public double Long { get; set; } 13 | public double Lat { get; set; } 14 | public string Name { get; set; } 15 | public AnimalType Type { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/BackgroundWorker/Models/Animal.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.WindowsAzure.Storage.Table; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace BackgroundWorker.Models 8 | { 9 | public class Animal : TableEntity 10 | { 11 | public int Id { get; set; } 12 | public double Long { get; set; } 13 | public double Lat { get; set; } 14 | public string Name { get; set; } 15 | public AnimalType Type { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /_Exemple/Lab 2/WebApi/DATC_lab2.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /RUS_ALEXANDRU/Lab2/WebApi/DATC_lab2.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/AnimalDanger/Repositories/IAnimalRepo.cs: -------------------------------------------------------------------------------- 1 | using AnimalDangerApi.Models; 2 | using Microsoft.WindowsAzure.Storage.Table; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | 8 | namespace AnimalDangerApi.Repositories 9 | { 10 | public interface IAnimalRepo 11 | { 12 | public Task InsertOrUpdate(Animal animal); 13 | public Task RetrieveSingleEntity(string id); 14 | public Task> GetAllAnimals(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator5WebJob/StudentsAPI/StudentsAPI.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.1 5 | InProcess 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator4Azure/StudentEntity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.WindowsAzure.Storage; 3 | using Microsoft.WindowsAzure.Storage.Table; 4 | 5 | namespace Andricsak 6 | { 7 | public class StudentEntity : TableEntity 8 | { 9 | public StudentEntity(string university,string id) 10 | { 11 | this.PartitionKey = university; 12 | this.RowKey = id; 13 | } 14 | public StudentEntity(){} 15 | public string University{get;set;} 16 | 17 | public string ID{get;set;} 18 | public string Name{get;set;} 19 | } 20 | } -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/BackgroundWorker/BackgroundWorker.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Exe 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Always 13 | 14 | 15 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/build/static/css/main.a8cd3667.chunk.css: -------------------------------------------------------------------------------- 1 | body{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}a.navbar-brand{white-space:normal;text-align:center;word-break:break-all}html{font-size:14px}@media (min-width:768px){html{font-size:16px}}.box-shadow{box-shadow:0 .25rem .75rem rgba(0,0,0,.05)} 2 | /*# sourceMappingURL=main.a8cd3667.chunk.css.map */ -------------------------------------------------------------------------------- /_Exemple/Lab 5/AzureFunction/Models/BankTransaction.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.WindowsAzure.Storage.Table; 2 | 3 | namespace AzureFunction.Models 4 | { 5 | public class BankTransaction : TableEntity 6 | { 7 | public BankTransaction(string id, string senderName) 8 | { 9 | this.RowKey = id; 10 | this.PartitionKey = senderName; 11 | } 12 | 13 | public BankTransaction() { } 14 | 15 | public string DestinationAccount { get; set; } 16 | public string DestinationName { get; set; } 17 | public int Ammount { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/src/components/PrivateRoute.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Route, Redirect } from 'react-router-dom'; 3 | 4 | const PrivateRoute = ({component: Component, isLogged, ...rest}) => { 5 | 6 | return ( 7 | // Show the component only when the user is logged in 8 | // Otherwise, redirect the user to /signin page 9 | ( 10 | isLogged ? 11 | 12 | : 13 | )} /> 14 | ); 15 | }; 16 | 17 | export default PrivateRoute; -------------------------------------------------------------------------------- /_Exemple/AzureFunc-WebApi/WebApi/Models/MyValue.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.WindowsAzure.Storage.Table; 3 | 4 | namespace Models 5 | { 6 | public class MyValue : TableEntity 7 | { 8 | public MyValue(string partionKey, string rowKey) 9 | { 10 | this.RowKey = rowKey; 11 | this.PartitionKey = partionKey; 12 | } 13 | 14 | public MyValue() 15 | { 16 | this.RowKey = Guid.NewGuid().ToString(); 17 | this.PartitionKey = Guid.NewGuid().ToString(); 18 | } 19 | public int Value { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/BackgroundWorker/Settings.job: -------------------------------------------------------------------------------- 1 | { 2 | 3 | // Examples: 4 | 5 | // Runs every minute 6 | // "schedule": "0 * * * * *" 7 | 8 | // Runs every 15 minutes 9 | // "schedule": "0 */15 * * * *" 10 | 11 | // Runs every hour (i.e. whenever the count of minutes is 0) 12 | // "schedule": "0 0 * * * *" 13 | 14 | // Runs every hour from 9 AM to 5 PM 15 | // "schedule": "0 0 9-17 * * *" 16 | 17 | // Runs at 9:30 AM every day 18 | // "schedule": "0 30 9 * * *" 19 | 20 | // Runs at 9:30 AM every week day 21 | // "schedule": "0 30 9 * * 1-5" 22 | } -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator5WebJob/StudentsAPI/StudentModel.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.WindowsAzure.Storage.Table; 2 | 3 | namespace Models 4 | { 5 | public class StudentModel 6 | { 7 | public string FirstName { get; set; } 8 | 9 | public string LastName { get; set; } 10 | 11 | public string Email { get; set; } 12 | 13 | public string PhoneNumber { get; set; } 14 | 15 | public int Year { get; set; } 16 | 17 | public string Faculty { get; set; } 18 | 19 | public string University { get; set; } 20 | 21 | public string CNP { get; set; } 22 | } 23 | } -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator6WebQueue/StudentsAPI/StudentModel.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.WindowsAzure.Storage.Table; 2 | 3 | namespace Models 4 | { 5 | public class StudentModel 6 | { 7 | public string FirstName { get; set; } 8 | 9 | public string LastName { get; set; } 10 | 11 | public string Email { get; set; } 12 | 13 | public string PhoneNumber { get; set; } 14 | 15 | public int Year { get; set; } 16 | 17 | public string Faculty { get; set; } 18 | 19 | public string University { get; set; } 20 | 21 | public string CNP { get; set; } 22 | } 23 | } -------------------------------------------------------------------------------- /_Exemple/AzureFunc-WebApi/AzureFunction/Models/MyValue.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.WindowsAzure.Storage.Table; 3 | 4 | namespace AzureFunction.Models 5 | { 6 | public class MyValue : TableEntity 7 | { 8 | public MyValue(string partionKey, string rowKey) 9 | { 10 | this.RowKey = rowKey; 11 | this.PartitionKey = partionKey; 12 | } 13 | 14 | public MyValue() 15 | { 16 | this.RowKey = Guid.NewGuid().ToString(); 17 | this.PartitionKey = Guid.NewGuid().ToString(); 18 | } 19 | public int Value { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /_Exemple/AzureFunc-WebApi/WebApi/WebApi.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/build/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator2/Student.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace StudentNameSpace{ 5 | public class Student 6 | { 7 | 8 | private int m_id; 9 | private string m_nume; 10 | private string m_facultate; 11 | private int m_an; 12 | 13 | public Student(int id, string nume, string facultate,int an) 14 | { 15 | m_id = id; 16 | m_an = an; 17 | m_nume = nume; 18 | m_facultate = facultate; 19 | } 20 | public int ID{get ; set;} 21 | public string NUME{get; set;} 22 | public string FACULTATE{get; set;} 23 | public int AN{get; set;} 24 | 25 | } 26 | } -------------------------------------------------------------------------------- /_Exemple/Lab 5/AzureFunction/AzureFunction.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netcoreapp2.1 4 | v2 5 | 6 | 7 | 8 | 9 | 10 | 11 | PreserveNewest 12 | 13 | 14 | PreserveNewest 15 | Never 16 | 17 | 18 | -------------------------------------------------------------------------------- /_Exemple/Lab 2/WebApi/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Logging; 10 | 11 | namespace DATC_lab2 12 | { 13 | public class Program 14 | { 15 | public static void Main(string[] args) 16 | { 17 | BuildWebHost(args).Run(); 18 | } 19 | 20 | public static IWebHost BuildWebHost(string[] args) => 21 | WebHost.CreateDefaultBuilder(args) 22 | .UseStartup() 23 | .Build(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /RUS_ALEXANDRU/Lab2/WebApi/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Logging; 10 | 11 | namespace DATC_lab2 12 | { 13 | public class Program 14 | { 15 | public static void Main(string[] args) 16 | { 17 | BuildWebHost(args).Run(); 18 | } 19 | 20 | public static IWebHost BuildWebHost(string[] args) => 21 | WebHost.CreateDefaultBuilder(args) 22 | .UseStartup() 23 | .Build(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /_Exemple/AzureFunc-WebApi/WebApi/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Logging; 10 | 11 | namespace DATC_lab2 12 | { 13 | public class Program 14 | { 15 | public static void Main(string[] args) 16 | { 17 | BuildWebHost(args).Run(); 18 | } 19 | 20 | public static IWebHost BuildWebHost(string[] args) => 21 | WebHost.CreateDefaultBuilder(args) 22 | .UseStartup() 23 | .Build(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator6WebQueue/StudentsAPI/StudentsAPI.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.1 5 | InProcess 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator2/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Logging; 10 | 11 | namespace Laborator2 12 | { 13 | public class Program 14 | { 15 | public static void Main(string[] args) 16 | { 17 | CreateWebHostBuilder(args).Build().Run(); 18 | } 19 | 20 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 21 | WebHost.CreateDefaultBuilder(args) 22 | .UseStartup(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator5WebJob/StudentsAPI/Student.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.WindowsAzure.Storage.Table; 2 | 3 | namespace Models 4 | { 5 | public class StudentEntity : TableEntity 6 | { 7 | public StudentEntity(string university, string cnp) 8 | { 9 | this.PartitionKey = university; 10 | this.RowKey = cnp; 11 | } 12 | 13 | public StudentEntity() { } 14 | 15 | public string FirstName { get; set; } 16 | 17 | public string LastName { get; set; } 18 | 19 | public string Email { get; set; } 20 | 21 | public string PhoneNumber { get; set; } 22 | 23 | public int Year { get; set; } 24 | 25 | public string Faculty { get; set; } 26 | } 27 | } -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator6WebQueue/Receive/Student.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.WindowsAzure.Storage.Table; 2 | 3 | namespace Receive 4 | { 5 | public class StudentEntity : TableEntity 6 | { 7 | public StudentEntity(string university, string cnp) 8 | { 9 | this.PartitionKey = university; 10 | this.RowKey = cnp; 11 | } 12 | 13 | public StudentEntity() { } 14 | 15 | public string FirstName { get; set; } 16 | 17 | public string LastName { get; set; } 18 | 19 | public string Email { get; set; } 20 | 21 | public string PhoneNumber { get; set; } 22 | 23 | public int Year { get; set; } 24 | 25 | public string Faculty { get; set; } 26 | } 27 | } -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator5WebJob/WebJob/StudentEntity.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.WindowsAzure.Storage.Table; 2 | 3 | namespace WebJob 4 | { 5 | public class StudentEntity : TableEntity 6 | { 7 | public StudentEntity(string university, string cnp) 8 | { 9 | this.PartitionKey = university; 10 | this.RowKey = cnp; 11 | } 12 | 13 | public StudentEntity() { } 14 | 15 | public string FirstName { get; set; } 16 | 17 | public string LastName { get; set; } 18 | 19 | public string Email { get; set; } 20 | 21 | public string PhoneNumber { get; set; } 22 | 23 | public int Year { get; set; } 24 | 25 | public string Faculty { get; set; } 26 | } 27 | } -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator6WebQueue/StudentsAPI/Student.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.WindowsAzure.Storage.Table; 2 | 3 | namespace Models 4 | { 5 | public class StudentEntity : TableEntity 6 | { 7 | public StudentEntity(string university, string cnp) 8 | { 9 | this.PartitionKey = university; 10 | this.RowKey = cnp; 11 | } 12 | 13 | public StudentEntity() { } 14 | 15 | public string FirstName { get; set; } 16 | 17 | public string LastName { get; set; } 18 | 19 | public string Email { get; set; } 20 | 21 | public string PhoneNumber { get; set; } 22 | 23 | public int Year { get; set; } 24 | 25 | public string Faculty { get; set; } 26 | } 27 | } -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator5WebJob/StudentsAPI/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Logging; 10 | 11 | namespace StudentsAPI 12 | { 13 | public class Program 14 | { 15 | public static void Main(string[] args) 16 | { 17 | CreateWebHostBuilder(args).Build().Run(); 18 | } 19 | 20 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 21 | WebHost.CreateDefaultBuilder(args) 22 | .UseStartup(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator6WebQueue/StudentsAPI/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Logging; 10 | 11 | namespace StudentsAPI 12 | { 13 | public class Program 14 | { 15 | public static void Main(string[] args) 16 | { 17 | CreateWebHostBuilder(args).Build().Run(); 18 | } 19 | 20 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 21 | WebHost.CreateDefaultBuilder(args) 22 | .UseStartup(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /_Exemple/Lab 3/GoogleDriveApp/GoogleDriveApiApp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | PreserveNewest 15 | 16 | 17 | PreserveNewest 18 | 19 | 20 | PreserveNewest 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/src/index.js: -------------------------------------------------------------------------------- 1 | import 'bootstrap/dist/css/bootstrap.css'; 2 | import React from 'react'; 3 | import ReactDOM from 'react-dom'; 4 | import './index.css'; 5 | import App from './App'; 6 | import * as serviceWorker from './serviceWorker'; 7 | import {BrowserRouter} from 'react-router-dom'; 8 | 9 | const baseUrl = document.getElementsByTagName('base')[0].getAttribute('href'); 10 | const rootElement = document.getElementById('root'); 11 | 12 | ReactDOM.render( 13 | 14 | 15 | , 16 | rootElement); 17 | // If you want your app to work offline and load faster, you can change 18 | // unregister() to register() below. Note this comes with some pitfalls. 19 | // Learn more about service workers: https://bit.ly/CRA-PWA 20 | serviceWorker.unregister(); 21 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/AnimalDanger/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace AnimalDanger 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /_Exemple/Lab 6/QueueConsoleApp/Models/QueueMessage.cs: -------------------------------------------------------------------------------- 1 | using System.Text; 2 | 3 | namespace QueueConsoleApp.Models 4 | { 5 | public class QueueMessage 6 | { 7 | public string SenderName { get; set; } 8 | public string DestinationAccount { get; set; } 9 | public string DestinationName { get; set; } 10 | public int Ammount { get; set; } 11 | 12 | public override string ToString() 13 | { 14 | var stringBuilder = new StringBuilder(); 15 | stringBuilder.AppendLine($"\tSenderName: {SenderName}"); 16 | stringBuilder.AppendLine($"\tDestinationAccount: {DestinationAccount}"); 17 | stringBuilder.AppendLine($"\tDestinationName: {DestinationName}"); 18 | stringBuilder.AppendLine($"\tAmmount: {Ammount}"); 19 | 20 | return stringBuilder.ToString(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /_Exemple/Lab 6/AzureFunction/AzureFunction.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netcoreapp2.1 4 | v2 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | PreserveNewest 14 | 15 | 16 | PreserveNewest 17 | Never 18 | 19 | 20 | -------------------------------------------------------------------------------- /_Exemple/AzureFunc-WebApi/AzureFunction/AzureFunction.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netcoreapp2.1 4 | v2 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | PreserveNewest 14 | 15 | 16 | PreserveNewest 17 | Never 18 | 19 | 20 | -------------------------------------------------------------------------------- /_Exemple/Lab 6/AzureFunction/Models/BankTransaction.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.WindowsAzure.Storage.Table; 2 | using System; 3 | 4 | namespace AzureFunction.Models 5 | { 6 | public class BankTransaction : TableEntity 7 | { 8 | public BankTransaction(string id, string senderName) 9 | { 10 | this.RowKey = id; 11 | this.PartitionKey = senderName; 12 | } 13 | 14 | public BankTransaction(QueueMessage queueMessage) 15 | { 16 | this.RowKey = Guid.NewGuid().ToString(); 17 | this.PartitionKey = queueMessage.SenderName; 18 | this.DestinationAccount = queueMessage.DestinationAccount; 19 | this.DestinationName = queueMessage.DestinationName; 20 | this.Ammount = queueMessage.Ammount; 21 | } 22 | 23 | public BankTransaction() { } 24 | 25 | public string DestinationAccount { get; set; } 26 | public string DestinationName { get; set; } 27 | public int Ammount { get; set; } 28 | } 29 | } -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/build/static/css/main.a8cd3667.chunk.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["index.css","NavMenu.css"],"names":[],"mappings":"AAAA,KACE,QAAS,CACT,mIAEY,CACZ,kCAAmC,CACnC,iCACF,CAEA,KACE,uEAEF,CCZA,eACE,kBAAmB,CACnB,iBAAkB,CAClB,oBACF,CAEA,KACE,cACF,CACA,yBACE,KACE,cACF,CACF,CAEA,YACE,0CACF","file":"main.a8cd3667.chunk.css","sourcesContent":["body {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen\",\n \"Ubuntu\", \"Cantarell\", \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\",\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, \"Courier New\",\n monospace;\n}\n","a.navbar-brand {\r\n white-space: normal;\r\n text-align: center;\r\n word-break: break-all;\r\n}\r\n\r\nhtml {\r\n font-size: 14px;\r\n}\r\n@media (min-width: 768px) {\r\n html {\r\n font-size: 16px;\r\n }\r\n}\r\n\r\n.box-shadow {\r\n box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);\r\n}\r\n"]} -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/AnimalDanger/AnimalDangerApi.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | all 13 | runtime; build; native; contentfiles; analyzers; buildtransitive 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/build/precache-manifest.33e5e80196ca2f57e47bf86f453e2024.js: -------------------------------------------------------------------------------- 1 | self.__precacheManifest = (self.__precacheManifest || []).concat([ 2 | { 3 | "revision": "51a4160184199824c5432317c2018c2a", 4 | "url": "/DATC-2019/Andricsak/Proiect/AnimalDanger/react-client/index.html" 5 | }, 6 | { 7 | "revision": "851a13823b6dff6c07a3", 8 | "url": "/DATC-2019/Andricsak/Proiect/AnimalDanger/react-client/static/css/2.833dd627.chunk.css" 9 | }, 10 | { 11 | "revision": "7976910cd2ac65294891", 12 | "url": "/DATC-2019/Andricsak/Proiect/AnimalDanger/react-client/static/css/main.a8cd3667.chunk.css" 13 | }, 14 | { 15 | "revision": "851a13823b6dff6c07a3", 16 | "url": "/DATC-2019/Andricsak/Proiect/AnimalDanger/react-client/static/js/2.08cb4003.chunk.js" 17 | }, 18 | { 19 | "revision": "7976910cd2ac65294891", 20 | "url": "/DATC-2019/Andricsak/Proiect/AnimalDanger/react-client/static/js/main.767cb65b.chunk.js" 21 | }, 22 | { 23 | "revision": "ab1f941cd96a9d4dd155", 24 | "url": "/DATC-2019/Andricsak/Proiect/AnimalDanger/react-client/static/js/runtime-main.297d04f9.js" 25 | } 26 | ]); -------------------------------------------------------------------------------- /RUS_ALEXANDRU/Lab2/WebApi/Controllers/ValuesController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | 7 | namespace DATC_lab2.Controllers 8 | { 9 | [Route("api/[controller]")] 10 | public class ValuesController : Controller 11 | { 12 | // GET api/values 13 | [HttpGet] 14 | public IEnumerable Get() 15 | { 16 | return new string[] { "value1", "value2" }; 17 | } 18 | 19 | // GET api/values/5 20 | [HttpGet("{id}")] 21 | public string Get(int id) 22 | { 23 | return "value"; 24 | } 25 | 26 | // POST api/values 27 | [HttpPost] 28 | public void Post([FromBody]string value) 29 | { 30 | } 31 | 32 | // PUT api/values/5 33 | [HttpPut("{id}")] 34 | public void Put(int id, [FromBody]string value) 35 | { 36 | } 37 | 38 | // DELETE api/values/5 39 | [HttpDelete("{id}")] 40 | public void Delete(int id) 41 | { 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /_Exemple/Lab 3/GoogleDriveApp/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to find out which attributes exist for C# debugging 3 | // Use hover for the description of the existing attributes 4 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": ".NET Core Launch (console)", 9 | "type": "coreclr", 10 | "request": "launch", 11 | "preLaunchTask": "build", 12 | // If you have changed target frameworks, make sure to update the program path. 13 | "program": "${workspaceFolder}/bin/Debug/netcoreapp3.0/GoogleDriveApiApp.dll", 14 | "args": [], 15 | "cwd": "${workspaceFolder}", 16 | // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console 17 | "console": "internalConsole", 18 | "stopAtEntry": false 19 | }, 20 | { 21 | "name": ".NET Core Attach", 22 | "type": "coreclr", 23 | "request": "attach", 24 | "processId": "${command:pickProcess}" 25 | } 26 | ] 27 | } -------------------------------------------------------------------------------- /_Exemple/Lab 6/QueueConsoleApp/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to find out which attributes exist for C# debugging 3 | // Use hover for the description of the existing attributes 4 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": ".NET Core Launch (console)", 9 | "type": "coreclr", 10 | "request": "launch", 11 | "preLaunchTask": "build", 12 | // If you have changed target frameworks, make sure to update the program path. 13 | "program": "${workspaceFolder}/bin/Debug/netcoreapp3.0/QueueConsoleApp.dll", 14 | "args": [], 15 | "cwd": "${workspaceFolder}", 16 | // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console 17 | "console": "internalConsole", 18 | "stopAtEntry": false 19 | }, 20 | { 21 | "name": ".NET Core Attach", 22 | "type": "coreclr", 23 | "request": "attach", 24 | "processId": "${command:pickProcess}" 25 | } 26 | ] 27 | } -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator2/Controllers/ValuesController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | 7 | namespace Laborator2.Controllers 8 | { 9 | [Route("api/[controller]")] 10 | [ApiController] 11 | public class ValuesController : ControllerBase 12 | { 13 | // GET api/values 14 | [HttpGet] 15 | public ActionResult> Get() 16 | { 17 | return new string[] { "value1", "value2" }; 18 | } 19 | 20 | // GET api/values/5 21 | [HttpGet("{id}")] 22 | public ActionResult Get(int id) 23 | { 24 | return "value"; 25 | } 26 | 27 | // POST api/values 28 | [HttpPost] 29 | public void Post([FromBody] string value) 30 | { 31 | } 32 | 33 | // PUT api/values/5 34 | [HttpPut("{id}")] 35 | public void Put(int id, [FromBody] string value) 36 | { 37 | } 38 | 39 | // DELETE api/values/5 40 | [HttpDelete("{id}")] 41 | public void Delete(int id) 42 | { 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator2/Controllers/StudentController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using StudentiNameSpace; 7 | using StudentNameSpace; 8 | 9 | namespace Laborator2.Controllers 10 | { 11 | [Route("api/[controller]")] 12 | [ApiController] 13 | public class StudentController : ControllerBase 14 | { 15 | 16 | // GET api/values 17 | [HttpGet] 18 | public ActionResult> Get() 19 | { 20 | return Studenti.students; 21 | } 22 | 23 | // GET api/values/5 24 | [HttpGet("{id}")] 25 | public ActionResult Get(int id) 26 | { 27 | return "value"; 28 | } 29 | 30 | // POST api/values 31 | [HttpPost] 32 | public void Post([FromBody] string value) 33 | { 34 | } 35 | 36 | // PUT api/values/5 37 | [HttpPut("{id}")] 38 | public void Put(int id, [FromBody] string value) 39 | { 40 | } 41 | 42 | // DELETE api/values/5 43 | [HttpDelete("{id}")] 44 | public void Delete(int id) 45 | { 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator5WebJob/StudentsAPI/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": ".NET Core Launch (web)", 9 | "type": "coreclr", 10 | "request": "launch", 11 | "preLaunchTask": "build", 12 | "program": "${workspaceFolder}/bin/Debug/netcoreapp2.2/StudentsAPI.dll", 13 | "args": [], 14 | "cwd": "${workspaceFolder}", 15 | "stopAtEntry": false, 16 | "serverReadyAction": { 17 | "action": "openExternally", 18 | "pattern": "^\\s*Now listening on:\\s+(https?://\\S+)" 19 | }, 20 | "env": { 21 | "ASPNETCORE_ENVIRONMENT": "Development" 22 | }, 23 | "sourceFileMap": { 24 | "/Views": "${workspaceFolder}/Views" 25 | } 26 | }, 27 | { 28 | "name": ".NET Core Attach", 29 | "type": "coreclr", 30 | "request": "attach", 31 | "processId": "${command:pickProcess}" 32 | } 33 | ] 34 | } -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator6WebQueue/StudentsAPI/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": ".NET Core Launch (web)", 9 | "type": "coreclr", 10 | "request": "launch", 11 | "preLaunchTask": "build", 12 | "program": "${workspaceFolder}/bin/Debug/netcoreapp2.2/StudentsAPI.dll", 13 | "args": [], 14 | "cwd": "${workspaceFolder}", 15 | "stopAtEntry": false, 16 | "serverReadyAction": { 17 | "action": "openExternally", 18 | "pattern": "^\\s*Now listening on:\\s+(https?://\\S+)" 19 | }, 20 | "env": { 21 | "ASPNETCORE_ENVIRONMENT": "Development" 22 | }, 23 | "sourceFileMap": { 24 | "/Views": "${workspaceFolder}/Views" 25 | } 26 | }, 27 | { 28 | "name": ".NET Core Attach", 29 | "type": "coreclr", 30 | "request": "attach", 31 | "processId": "${command:pickProcess}" 32 | } 33 | ] 34 | } -------------------------------------------------------------------------------- /RUS_ALEXANDRU/Lab2/WebApi/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Builder; 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.Extensions.Configuration; 8 | using Microsoft.Extensions.DependencyInjection; 9 | using Microsoft.Extensions.Logging; 10 | using Microsoft.Extensions.Options; 11 | 12 | namespace DATC_lab2 13 | { 14 | public class Startup 15 | { 16 | public Startup(IConfiguration configuration) 17 | { 18 | Configuration = configuration; 19 | } 20 | 21 | public IConfiguration Configuration { get; } 22 | 23 | // This method gets called by the runtime. Use this method to add services to the container. 24 | public void ConfigureServices(IServiceCollection services) 25 | { 26 | services 27 | .AddMvc() 28 | .AddXmlSerializerFormatters(); 29 | } 30 | 31 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 32 | public void Configure(IApplicationBuilder app, IHostingEnvironment env) 33 | { 34 | if (env.IsDevelopment()) 35 | { 36 | app.UseDeveloperExceptionPage(); 37 | } 38 | 39 | app.UseMvc(); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /_Exemple/Lab 2/WebApi/Startup.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Builder; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.DependencyInjection; 10 | using Microsoft.Extensions.Logging; 11 | using Microsoft.Extensions.Options; 12 | 13 | namespace DATC_lab2 14 | { 15 | public class Startup 16 | { 17 | public Startup(IConfiguration configuration) 18 | { 19 | Configuration = configuration; 20 | } 21 | 22 | public IConfiguration Configuration { get; } 23 | 24 | // This method gets called by the runtime. Use this method to add services to the container. 25 | public void ConfigureServices(IServiceCollection services) 26 | { 27 | services 28 | .AddMvc() 29 | .AddXmlSerializerFormatters(); 30 | } 31 | 32 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 33 | public void Configure(IApplicationBuilder app, IHostingEnvironment env) 34 | { 35 | if (env.IsDevelopment()) 36 | { 37 | app.UseDeveloperExceptionPage(); 38 | } 39 | 40 | app.UseMvc(); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /_Exemple/AzureFunc-WebApi/WebApi/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Builder; 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.Extensions.Configuration; 8 | using Microsoft.Extensions.DependencyInjection; 9 | using Microsoft.Extensions.Logging; 10 | using Microsoft.Extensions.Options; 11 | 12 | namespace DATC_lab2 13 | { 14 | public class Startup 15 | { 16 | public Startup(IConfiguration configuration) 17 | { 18 | Configuration = configuration; 19 | } 20 | 21 | public IConfiguration Configuration { get; } 22 | 23 | // This method gets called by the runtime. Use this method to add services to the container. 24 | public void ConfigureServices(IServiceCollection services) 25 | { 26 | services 27 | .AddMvc() 28 | .AddXmlSerializerFormatters(); 29 | } 30 | 31 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 32 | public void Configure(IApplicationBuilder app, IHostingEnvironment env) 33 | { 34 | if (env.IsDevelopment()) 35 | { 36 | app.UseDeveloperExceptionPage(); 37 | } 38 | 39 | app.UseMvc(); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /_Exemple/AzureFunc-WebApi/WebApi/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/WebApi.csproj", 11 | "/property:GenerateFullPaths=true", 12 | "/consoleloggerparameters:NoSummary" 13 | ], 14 | "problemMatcher": "$msCompile" 15 | }, 16 | { 17 | "label": "publish", 18 | "command": "dotnet", 19 | "type": "process", 20 | "args": [ 21 | "publish", 22 | "${workspaceFolder}/WebApi.csproj", 23 | "/property:GenerateFullPaths=true", 24 | "/consoleloggerparameters:NoSummary" 25 | ], 26 | "problemMatcher": "$msCompile" 27 | }, 28 | { 29 | "label": "watch", 30 | "command": "dotnet", 31 | "type": "process", 32 | "args": [ 33 | "watch", 34 | "run", 35 | "${workspaceFolder}/WebApi.csproj", 36 | "/property:GenerateFullPaths=true", 37 | "/consoleloggerparameters:NoSummary" 38 | ], 39 | "problemMatcher": "$msCompile" 40 | } 41 | ] 42 | } -------------------------------------------------------------------------------- /_Exemple/Lab 2/WebApi/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/DATC_lab2.csproj", 11 | "/property:GenerateFullPaths=true", 12 | "/consoleloggerparameters:NoSummary" 13 | ], 14 | "problemMatcher": "$msCompile" 15 | }, 16 | { 17 | "label": "publish", 18 | "command": "dotnet", 19 | "type": "process", 20 | "args": [ 21 | "publish", 22 | "${workspaceFolder}/DATC_lab2.csproj", 23 | "/property:GenerateFullPaths=true", 24 | "/consoleloggerparameters:NoSummary" 25 | ], 26 | "problemMatcher": "$msCompile" 27 | }, 28 | { 29 | "label": "watch", 30 | "command": "dotnet", 31 | "type": "process", 32 | "args": [ 33 | "watch", 34 | "run", 35 | "${workspaceFolder}/DATC_lab2.csproj", 36 | "/property:GenerateFullPaths=true", 37 | "/consoleloggerparameters:NoSummary" 38 | ], 39 | "problemMatcher": "$msCompile" 40 | } 41 | ] 42 | } -------------------------------------------------------------------------------- /RUS_ALEXANDRU/Lab2/WebApi/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/DATC_lab2.csproj", 11 | "/property:GenerateFullPaths=true", 12 | "/consoleloggerparameters:NoSummary" 13 | ], 14 | "problemMatcher": "$msCompile" 15 | }, 16 | { 17 | "label": "publish", 18 | "command": "dotnet", 19 | "type": "process", 20 | "args": [ 21 | "publish", 22 | "${workspaceFolder}/DATC_lab2.csproj", 23 | "/property:GenerateFullPaths=true", 24 | "/consoleloggerparameters:NoSummary" 25 | ], 26 | "problemMatcher": "$msCompile" 27 | }, 28 | { 29 | "label": "watch", 30 | "command": "dotnet", 31 | "type": "process", 32 | "args": [ 33 | "watch", 34 | "run", 35 | "${workspaceFolder}/DATC_lab2.csproj", 36 | "/property:GenerateFullPaths=true", 37 | "/consoleloggerparameters:NoSummary" 38 | ], 39 | "problemMatcher": "$msCompile" 40 | } 41 | ] 42 | } -------------------------------------------------------------------------------- /_Exemple/Lab 6/QueueConsoleApp/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/QueueConsoleApp.csproj", 11 | "/property:GenerateFullPaths=true", 12 | "/consoleloggerparameters:NoSummary" 13 | ], 14 | "problemMatcher": "$msCompile" 15 | }, 16 | { 17 | "label": "publish", 18 | "command": "dotnet", 19 | "type": "process", 20 | "args": [ 21 | "publish", 22 | "${workspaceFolder}/QueueConsoleApp.csproj", 23 | "/property:GenerateFullPaths=true", 24 | "/consoleloggerparameters:NoSummary" 25 | ], 26 | "problemMatcher": "$msCompile" 27 | }, 28 | { 29 | "label": "watch", 30 | "command": "dotnet", 31 | "type": "process", 32 | "args": [ 33 | "watch", 34 | "run", 35 | "${workspaceFolder}/QueueConsoleApp.csproj", 36 | "/property:GenerateFullPaths=true", 37 | "/consoleloggerparameters:NoSummary" 38 | ], 39 | "problemMatcher": "$msCompile" 40 | } 41 | ] 42 | } -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator5WebJob/StudentsAPI/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/StudentsAPI.csproj", 11 | "/property:GenerateFullPaths=true", 12 | "/consoleloggerparameters:NoSummary" 13 | ], 14 | "problemMatcher": "$msCompile" 15 | }, 16 | { 17 | "label": "publish", 18 | "command": "dotnet", 19 | "type": "process", 20 | "args": [ 21 | "publish", 22 | "${workspaceFolder}/StudentsAPI.csproj", 23 | "/property:GenerateFullPaths=true", 24 | "/consoleloggerparameters:NoSummary" 25 | ], 26 | "problemMatcher": "$msCompile" 27 | }, 28 | { 29 | "label": "watch", 30 | "command": "dotnet", 31 | "type": "process", 32 | "args": [ 33 | "watch", 34 | "run", 35 | "${workspaceFolder}/StudentsAPI.csproj", 36 | "/property:GenerateFullPaths=true", 37 | "/consoleloggerparameters:NoSummary" 38 | ], 39 | "problemMatcher": "$msCompile" 40 | } 41 | ] 42 | } -------------------------------------------------------------------------------- /_Exemple/Lab 3/GoogleDriveApp/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/GoogleDriveApiApp.csproj", 11 | "/property:GenerateFullPaths=true", 12 | "/consoleloggerparameters:NoSummary" 13 | ], 14 | "problemMatcher": "$msCompile" 15 | }, 16 | { 17 | "label": "publish", 18 | "command": "dotnet", 19 | "type": "process", 20 | "args": [ 21 | "publish", 22 | "${workspaceFolder}/GoogleDriveApiApp.csproj", 23 | "/property:GenerateFullPaths=true", 24 | "/consoleloggerparameters:NoSummary" 25 | ], 26 | "problemMatcher": "$msCompile" 27 | }, 28 | { 29 | "label": "watch", 30 | "command": "dotnet", 31 | "type": "process", 32 | "args": [ 33 | "watch", 34 | "run", 35 | "${workspaceFolder}/GoogleDriveApiApp.csproj", 36 | "/property:GenerateFullPaths=true", 37 | "/consoleloggerparameters:NoSummary" 38 | ], 39 | "problemMatcher": "$msCompile" 40 | } 41 | ] 42 | } -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator6WebQueue/StudentsAPI/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/StudentsAPI.csproj", 11 | "/property:GenerateFullPaths=true", 12 | "/consoleloggerparameters:NoSummary" 13 | ], 14 | "problemMatcher": "$msCompile" 15 | }, 16 | { 17 | "label": "publish", 18 | "command": "dotnet", 19 | "type": "process", 20 | "args": [ 21 | "publish", 22 | "${workspaceFolder}/StudentsAPI.csproj", 23 | "/property:GenerateFullPaths=true", 24 | "/consoleloggerparameters:NoSummary" 25 | ], 26 | "problemMatcher": "$msCompile" 27 | }, 28 | { 29 | "label": "watch", 30 | "command": "dotnet", 31 | "type": "process", 32 | "args": [ 33 | "watch", 34 | "run", 35 | "${workspaceFolder}/StudentsAPI.csproj", 36 | "/property:GenerateFullPaths=true", 37 | "/consoleloggerparameters:NoSummary" 38 | ], 39 | "problemMatcher": "$msCompile" 40 | } 41 | ] 42 | } -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "homepage": " https://alexinio97.github.io/DATC-2019/Andricsak/Proiect/AnimalDanger/react-client/", 3 | "name": "react-client", 4 | "version": "0.1.0", 5 | "private": true, 6 | "dependencies": { 7 | "axios": "^0.19.0", 8 | "bootstrap": "^4.3.1", 9 | "google-map-react": "^1.1.5", 10 | "google-maps-react": "^2.0.2", 11 | "jquery": "^3.4.1", 12 | "leaflet": "^1.6.0", 13 | "mdbreact": "^4.24.0", 14 | "react": "^16.12.0", 15 | "react-bootstrap": "^0.32.4", 16 | "react-dom": "^16.12.0", 17 | "react-google-login": "^5.0.7", 18 | "react-leaflet": "^2.6.0", 19 | "react-router": "^5.1.2", 20 | "react-router-dom": "^5.1.2", 21 | "react-scripts": "3.2.0", 22 | "reactstrap": "^8.1.1" 23 | }, 24 | "scripts": { 25 | "start": "react-scripts start", 26 | "build": "react-scripts build", 27 | "test": "react-scripts test", 28 | "predeploy": "npm run build", 29 | "deploy": "gh-pages -d build", 30 | "eject": "react-scripts eject" 31 | }, 32 | "eslintConfig": { 33 | "extends": "react-app" 34 | }, 35 | "browserslist": { 36 | "production": [ 37 | ">0.2%", 38 | "not dead", 39 | "not op_mini all" 40 | ], 41 | "development": [ 42 | "last 1 chrome version", 43 | "last 1 firefox version", 44 | "last 1 safari version" 45 | ] 46 | }, 47 | "devDependencies": { 48 | "gh-pages": "^2.1.1" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/build/service-worker.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Welcome to your Workbox-powered service worker! 3 | * 4 | * You'll need to register this file in your web app and you should 5 | * disable HTTP caching for this file too. 6 | * See https://goo.gl/nhQhGp 7 | * 8 | * The rest of the code is auto-generated. Please don't update this file 9 | * directly; instead, make changes to your Workbox build configuration 10 | * and re-run your build process. 11 | * See https://goo.gl/2aRDsh 12 | */ 13 | 14 | importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js"); 15 | 16 | importScripts( 17 | "/DATC-2019/Andricsak/Proiect/AnimalDanger/react-client/precache-manifest.33e5e80196ca2f57e47bf86f453e2024.js" 18 | ); 19 | 20 | self.addEventListener('message', (event) => { 21 | if (event.data && event.data.type === 'SKIP_WAITING') { 22 | self.skipWaiting(); 23 | } 24 | }); 25 | 26 | workbox.core.clientsClaim(); 27 | 28 | /** 29 | * The workboxSW.precacheAndRoute() method efficiently caches and responds to 30 | * requests for URLs in the manifest. 31 | * See https://goo.gl/S9QRab 32 | */ 33 | self.__precacheManifest = [].concat(self.__precacheManifest || []); 34 | workbox.precaching.precacheAndRoute(self.__precacheManifest, {}); 35 | 36 | workbox.routing.registerNavigationRoute(workbox.precaching.getCacheKeyForURL("/DATC-2019/Andricsak/Proiect/AnimalDanger/react-client/index.html"), { 37 | 38 | blacklist: [/^\/_/,/\/[^/?]+\.[^/]+$/], 39 | }); 40 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/BackgroundWorker/Program.cs: -------------------------------------------------------------------------------- 1 | using BackgroundWorker.Models; 2 | using BackgroundWorker.Operations; 3 | using BackgroundWorker.Repositories; 4 | using Newtonsoft.Json; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Net.Http; 8 | 9 | namespace BackgroundWorker 10 | { 11 | class Program 12 | { 13 | static private HttpClient _client; 14 | static private AreaOperations _ops; 15 | static private AlertRepo _repo; 16 | static async System.Threading.Tasks.Task Main(string[] args) 17 | { 18 | Console.WriteLine("Initializing background worker..."); 19 | Initialize(); 20 | Console.WriteLine("Calculating if animals are inside safe zone..."); 21 | await CheckAnimalsSafeAreaAsync(); 22 | Console.WriteLine("\nJob done!\n"); 23 | } 24 | 25 | static public void Initialize() 26 | { 27 | _client = new HttpClient(); 28 | _ops = new AreaOperations(); 29 | _repo = new AlertRepo(); 30 | } 31 | 32 | static public async System.Threading.Tasks.Task CheckAnimalsSafeAreaAsync() 33 | { 34 | var request = _client.GetAsync($"https://animaldangerapi.azurewebsites.net/api/Animal/"); 35 | var initialAnimal = JsonConvert.DeserializeObject>(await request.Result.Content.ReadAsStringAsync()); 36 | 37 | await _ops.CheckAnimalsInZoneAsync(initialAnimal, _repo); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /_Exemple/Lab 2/WebApi/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to find out which attributes exist for C# debugging 3 | // Use hover for the description of the existing attributes 4 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": ".NET Core Launch (web)", 9 | "type": "coreclr", 10 | "request": "launch", 11 | "preLaunchTask": "build", 12 | // If you have changed target frameworks, make sure to update the program path. 13 | "program": "${workspaceFolder}/bin/Debug/netcoreapp2.0/DATC_lab2.dll", 14 | "args": [], 15 | "cwd": "${workspaceFolder}", 16 | "stopAtEntry": false, 17 | // Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser 18 | "serverReadyAction": { 19 | "action": "openExternally", 20 | "pattern": "^\\s*Now listening on:\\s+(https?://\\S+)" 21 | }, 22 | "env": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | }, 25 | "sourceFileMap": { 26 | "/Views": "${workspaceFolder}/Views" 27 | } 28 | }, 29 | { 30 | "name": ".NET Core Attach", 31 | "type": "coreclr", 32 | "request": "attach", 33 | "processId": "${command:pickProcess}" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /RUS_ALEXANDRU/Lab2/WebApi/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to find out which attributes exist for C# debugging 3 | // Use hover for the description of the existing attributes 4 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": ".NET Core Launch (web)", 9 | "type": "coreclr", 10 | "request": "launch", 11 | "preLaunchTask": "build", 12 | // If you have changed target frameworks, make sure to update the program path. 13 | "program": "${workspaceFolder}/bin/Debug/netcoreapp2.0/DATC_lab2.dll", 14 | "args": [], 15 | "cwd": "${workspaceFolder}", 16 | "stopAtEntry": false, 17 | // Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser 18 | "serverReadyAction": { 19 | "action": "openExternally", 20 | "pattern": "^\\s*Now listening on:\\s+(https?://\\S+)" 21 | }, 22 | "env": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | }, 25 | "sourceFileMap": { 26 | "/Views": "${workspaceFolder}/Views" 27 | } 28 | }, 29 | { 30 | "name": ".NET Core Attach", 31 | "type": "coreclr", 32 | "request": "attach", 33 | "processId": "${command:pickProcess}" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /_Exemple/AzureFunc-WebApi/WebApi/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to find out which attributes exist for C# debugging 3 | // Use hover for the description of the existing attributes 4 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": ".NET Core Launch (web)", 9 | "type": "coreclr", 10 | "request": "launch", 11 | "preLaunchTask": "build", 12 | // If you have changed target frameworks, make sure to update the program path. 13 | "program": "${workspaceFolder}/bin/Debug/netcoreapp2.0/WebApi.dll", 14 | "args": [], 15 | "cwd": "${workspaceFolder}", 16 | "stopAtEntry": false, 17 | // Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser 18 | "serverReadyAction": { 19 | "action": "openExternally", 20 | "pattern": "^\\s*Now listening on:\\s+(https?://\\S+)" 21 | }, 22 | "env": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | }, 25 | "sourceFileMap": { 26 | "/Views": "${workspaceFolder}/Views" 27 | } 28 | }, 29 | { 30 | "name": ".NET Core Attach", 31 | "type": "coreclr", 32 | "request": "attach", 33 | "processId": "${command:pickProcess}" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator2/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Builder; 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.AspNetCore.HttpsPolicy; 8 | using Microsoft.AspNetCore.Mvc; 9 | using Microsoft.Extensions.Configuration; 10 | using Microsoft.Extensions.DependencyInjection; 11 | using Microsoft.Extensions.Logging; 12 | using Microsoft.Extensions.Options; 13 | 14 | namespace Laborator2 15 | { 16 | public class Startup 17 | { 18 | public Startup(IConfiguration configuration) 19 | { 20 | Configuration = configuration; 21 | } 22 | 23 | public IConfiguration Configuration { get; } 24 | 25 | // This method gets called by the runtime. Use this method to add services to the container. 26 | public void ConfigureServices(IServiceCollection services) 27 | { 28 | services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); 29 | } 30 | 31 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 32 | public void Configure(IApplicationBuilder app, IHostingEnvironment env) 33 | { 34 | if (env.IsDevelopment()) 35 | { 36 | app.UseDeveloperExceptionPage(); 37 | } 38 | else 39 | { 40 | app.UseHsts(); 41 | } 42 | 43 | //app.UseHttpsRedirection(); 44 | app.UseMvc(); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/build/static/js/runtime-main.297d04f9.js: -------------------------------------------------------------------------------- 1 | !function(e){function r(r){for(var n,i,l=r[0],a=r[1],c=r[2],p=0,s=[];p _studentList = new List(); 13 | 14 | public StudentController() 15 | { 16 | } 17 | 18 | // GET api/values 19 | [HttpGet] 20 | public IEnumerable Get() 21 | { 22 | return _studentList; 23 | } 24 | 25 | [HttpGet("{id}")] 26 | public Student Get(int id) 27 | { 28 | return _studentList.ElementAt(id); 29 | } 30 | 31 | // POST api/values 32 | [HttpPost] 33 | public void Post([FromBody]Student student) 34 | { 35 | _studentList.Add(student); 36 | } 37 | 38 | // PUT api/values/5 39 | [HttpPut("{id}")] 40 | public void Put(int id, [FromBody]Student student) 41 | { 42 | if(_studentList.Count > id) 43 | { 44 | _studentList[id] = student; 45 | } 46 | } 47 | 48 | // DELETE api/values/5 49 | [HttpDelete("{id}")] 50 | public void Delete(int id) 51 | { 52 | if(_studentList.Count > id) 53 | { 54 | _studentList.Remove(_studentList.ElementAt(id)); 55 | } 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /_Exemple/AzureFunc-WebApi/AzureFunction/ServiceBusQueueTriggerCSharp.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using AzureFunction.Models; 3 | using AzureFunction.Storage; 4 | using Microsoft.Azure.WebJobs; 5 | using Microsoft.Extensions.Logging; 6 | using Newtonsoft.Json; 7 | 8 | namespace DATC.AzureFunction 9 | { 10 | public static class ServiceBusQueueTriggerCSharp 11 | { 12 | private const string TableStorageConnectionString = ""; 13 | private const string MyValuesTableName = "MyValuesTable"; 14 | private const string MySumTableName = "MySumTable"; 15 | 16 | [FunctionName("ServiceBusQueueTriggerCSharp")] 17 | public static void Run([ServiceBusTrigger("myqueue-1", Connection = "ConnectionStringKey")]string myQueueItem, ILogger log) 18 | { 19 | log.LogInformation($"C# ServiceBus queue trigger function processed message: {myQueueItem}"); 20 | 21 | var myValuesRepository = new TableStorageService(log, TableStorageConnectionString, MyValuesTableName); 22 | var mySumRepository = new TableStorageService(log, TableStorageConnectionString, MySumTableName); 23 | 24 | var myValue = JsonConvert.DeserializeObject(myQueueItem); 25 | myValuesRepository.InsertOrUpdateEntry(myValue); 26 | 27 | // this is not memory efficient 28 | var latestValues = myValuesRepository.GetAllEntries().OrderBy(v => v.Timestamp).TakeLast(10); 29 | var totalSum = latestValues.Sum(v => v.Value); 30 | 31 | var myNewestSum = new MyValue() 32 | { 33 | Value = totalSum 34 | }; 35 | 36 | mySumRepository.InsertOrUpdateEntry(myNewestSum); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/AnimalDanger.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29509.3 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AnimalDangerApi", "AnimalDanger\AnimalDangerApi.csproj", "{CF7098D2-4253-4ABA-8762-51991217129F}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BackgroundWorker", "BackgroundWorker\BackgroundWorker.csproj", "{7404DBD1-9974-47B6-843D-2F7438592B1E}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {CF7098D2-4253-4ABA-8762-51991217129F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {CF7098D2-4253-4ABA-8762-51991217129F}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {CF7098D2-4253-4ABA-8762-51991217129F}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {CF7098D2-4253-4ABA-8762-51991217129F}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {7404DBD1-9974-47B6-843D-2F7438592B1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {7404DBD1-9974-47B6-843D-2F7438592B1E}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {7404DBD1-9974-47B6-843D-2F7438592B1E}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {7404DBD1-9974-47B6-843D-2F7438592B1E}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {71B4B6CD-5EF0-4162-90E2-539928456D6A} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator5WebJob/StudentsAPI/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Builder; 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.AspNetCore.HttpsPolicy; 8 | using Microsoft.AspNetCore.Mvc; 9 | using Microsoft.Extensions.Configuration; 10 | using Microsoft.Extensions.DependencyInjection; 11 | using Microsoft.Extensions.Logging; 12 | using Microsoft.Extensions.Options; 13 | 14 | namespace StudentsAPI 15 | { 16 | public class Startup 17 | { 18 | public Startup(IConfiguration configuration) 19 | { 20 | Configuration = configuration; 21 | } 22 | 23 | public IConfiguration Configuration { get; } 24 | 25 | // This method gets called by the runtime. Use this method to add services to the container. 26 | public void ConfigureServices(IServiceCollection services) 27 | { 28 | services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); 29 | } 30 | 31 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 32 | public void Configure(IApplicationBuilder app, IHostingEnvironment env) 33 | { 34 | if (env.IsDevelopment()) 35 | { 36 | app.UseDeveloperExceptionPage(); 37 | } 38 | else 39 | { 40 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 41 | // app.UseHsts(); 42 | } 43 | 44 | // app.UseHttpsRedirection(); 45 | app.UseMvc(); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator6WebQueue/StudentsAPI/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Builder; 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.AspNetCore.HttpsPolicy; 8 | using Microsoft.AspNetCore.Mvc; 9 | using Microsoft.Extensions.Configuration; 10 | using Microsoft.Extensions.DependencyInjection; 11 | using Microsoft.Extensions.Logging; 12 | using Microsoft.Extensions.Options; 13 | 14 | namespace StudentsAPI 15 | { 16 | public class Startup 17 | { 18 | public Startup(IConfiguration configuration) 19 | { 20 | Configuration = configuration; 21 | } 22 | 23 | public IConfiguration Configuration { get; } 24 | 25 | // This method gets called by the runtime. Use this method to add services to the container. 26 | public void ConfigureServices(IServiceCollection services) 27 | { 28 | services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); 29 | } 30 | 31 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 32 | public void Configure(IApplicationBuilder app, IHostingEnvironment env) 33 | { 34 | if (env.IsDevelopment()) 35 | { 36 | app.UseDeveloperExceptionPage(); 37 | } 38 | else 39 | { 40 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 41 | // app.UseHsts(); 42 | } 43 | 44 | // app.UseHttpsRedirection(); 45 | app.UseMvc(); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/src/components/NavMenu.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { Collapse, Container, Navbar, NavbarBrand, NavbarToggler, NavItem, NavLink } from 'reactstrap'; 3 | import { Link } from 'react-router-dom'; 4 | import './NavMenu.css'; 5 | 6 | export class NavMenu extends Component { 7 | static displayName = NavMenu.name; 8 | 9 | constructor (props) { 10 | super(props); 11 | 12 | this.toggleNavbar = this.toggleNavbar.bind(this); 13 | this.state = { 14 | collapsed: true 15 | }; 16 | } 17 | 18 | toggleNavbar () { 19 | this.setState({ 20 | collapsed: !this.state.collapsed 21 | }); 22 | } 23 | 24 | render () { 25 | return ( 26 |
27 | 28 | 29 | Animal danger 30 | 31 | 32 |
    33 | 34 | Home 35 | 36 | 37 | Add an Animal 38 | 39 | 40 | View animals 41 | 42 |
43 |
44 |
45 |
46 |
47 | ); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/src/components/Intro.css: -------------------------------------------------------------------------------- 1 | .form-dark .font-small { 2 | font-size: 0.8rem; } 3 | 4 | .form-dark [type="radio"] + label, 5 | .form-dark [type="checkbox"] + label { 6 | font-size: 0.8rem; } 7 | 8 | .form-dark [type="checkbox"] + label:before { 9 | top: 2px; 10 | width: 15px; 11 | height: 15px; } 12 | 13 | .form-dark .md-form label { 14 | color: #fff; } 15 | 16 | .form-dark input[type=text]:focus:not([readonly]) { 17 | border-bottom: 1px solid #00C851; 18 | -webkit-box-shadow: 0 1px 0 0 #00C851; 19 | box-shadow: 0 1px 0 0 #00C851; } 20 | 21 | .form-dark input[type=text]:focus:not([readonly]) + label { 22 | color: #fff; } 23 | 24 | .form-dark input[type=password]:focus:not([readonly]) { 25 | border-bottom: 1px solid #00C851; 26 | -webkit-box-shadow: 0 1px 0 0 #00C851; 27 | box-shadow: 0 1px 0 0 #00C851; } 28 | 29 | .form-dark input[type=password]:focus:not([readonly]) + label { 30 | color: #fff; } 31 | 32 | .form-dark input[type="checkbox"] + label:before { 33 | content: ''; 34 | position: absolute; 35 | top: 0; 36 | left: 0; 37 | width: 17px; 38 | height: 17px; 39 | z-index: 0; 40 | border: 1.5px solid #fff; 41 | border-radius: 1px; 42 | margin-top: 2px; 43 | -webkit-transition: 0.2s; 44 | transition: 0.2s; } 45 | 46 | .form-dark input[type="checkbox"]:checked + label:before { 47 | top: -4px; 48 | left: -3px; 49 | width: 12px; 50 | height: 22px; 51 | border-style: solid; 52 | border-width: 2px; 53 | border-color: transparent #00c851 #00c851 transparent; 54 | -webkit-transform: rotate(40deg); 55 | -ms-transform: rotate(40deg); 56 | transform: rotate(40deg); 57 | -webkit-backface-visibility: hidden; 58 | -webkit-transform-origin: 100% 100%; 59 | -ms-transform-origin: 100% 100%; 60 | transform-origin: 100% 100%; } -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/build/asset-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": { 3 | "main.css": "/DATC-2019/Andricsak/Proiect/AnimalDanger/react-client/static/css/main.a8cd3667.chunk.css", 4 | "main.js": "/DATC-2019/Andricsak/Proiect/AnimalDanger/react-client/static/js/main.767cb65b.chunk.js", 5 | "main.js.map": "/DATC-2019/Andricsak/Proiect/AnimalDanger/react-client/static/js/main.767cb65b.chunk.js.map", 6 | "runtime-main.js": "/DATC-2019/Andricsak/Proiect/AnimalDanger/react-client/static/js/runtime-main.297d04f9.js", 7 | "runtime-main.js.map": "/DATC-2019/Andricsak/Proiect/AnimalDanger/react-client/static/js/runtime-main.297d04f9.js.map", 8 | "static/css/2.833dd627.chunk.css": "/DATC-2019/Andricsak/Proiect/AnimalDanger/react-client/static/css/2.833dd627.chunk.css", 9 | "static/js/2.08cb4003.chunk.js": "/DATC-2019/Andricsak/Proiect/AnimalDanger/react-client/static/js/2.08cb4003.chunk.js", 10 | "static/js/2.08cb4003.chunk.js.map": "/DATC-2019/Andricsak/Proiect/AnimalDanger/react-client/static/js/2.08cb4003.chunk.js.map", 11 | "index.html": "/DATC-2019/Andricsak/Proiect/AnimalDanger/react-client/index.html", 12 | "precache-manifest.33e5e80196ca2f57e47bf86f453e2024.js": "/DATC-2019/Andricsak/Proiect/AnimalDanger/react-client/precache-manifest.33e5e80196ca2f57e47bf86f453e2024.js", 13 | "service-worker.js": "/DATC-2019/Andricsak/Proiect/AnimalDanger/react-client/service-worker.js", 14 | "static/css/2.833dd627.chunk.css.map": "/DATC-2019/Andricsak/Proiect/AnimalDanger/react-client/static/css/2.833dd627.chunk.css.map", 15 | "static/css/main.a8cd3667.chunk.css.map": "/DATC-2019/Andricsak/Proiect/AnimalDanger/react-client/static/css/main.a8cd3667.chunk.css.map" 16 | }, 17 | "entrypoints": [ 18 | "static/js/runtime-main.297d04f9.js", 19 | "static/css/2.833dd627.chunk.css", 20 | "static/js/2.08cb4003.chunk.js", 21 | "static/css/main.a8cd3667.chunk.css", 22 | "static/js/main.767cb65b.chunk.js" 23 | ] 24 | } -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/BackgroundWorker/Operations/AreaOperations.cs: -------------------------------------------------------------------------------- 1 | using BackgroundWorker.Models; 2 | using BackgroundWorker.Repositories; 3 | using Nest; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace BackgroundWorker.Operations 10 | { 11 | class AreaOperations 12 | { 13 | // the coordinates that define the safe area 14 | GeoCoordinate topLeft = new GeoCoordinate(45.751714, 21.219859); 15 | GeoCoordinate topRight = new GeoCoordinate(45.750864, 21.233672); 16 | GeoCoordinate bottomLeft = new GeoCoordinate(45.742850, 21.219516); 17 | GeoCoordinate bottomRight = new GeoCoordinate(45.743676, 21.236074); 18 | 19 | 20 | public async Task CheckAnimalsInZoneAsync(IEnumerable animals, AlertRepo repo) 21 | { 22 | int counter = 0; 23 | 24 | Alert newAlert = new Alert(); 25 | List animalsNames = new List(); 26 | foreach (var animal in animals) 27 | { 28 | GeoCoordinate animalLocation = new GeoCoordinate(animal.Lat, animal.Long); 29 | if (isWithin(animalLocation, bottomLeft, topRight)) 30 | { 31 | counter++; 32 | animalsNames.Add(animal.Name); 33 | } 34 | 35 | } 36 | if (counter > 0) 37 | { 38 | newAlert.Description = $"{counter} animals are inside the area!"; 39 | newAlert.Id = 1; 40 | newAlert.City = "Timisoara"; 41 | newAlert.PartitionKey = "Timisoara"; 42 | newAlert.RowKey = "1"; 43 | 44 | await repo.InsertOrUpdate(newAlert); 45 | } 46 | else 47 | { 48 | await repo.DeleteEnetityAsync("Timisoara", "1"); 49 | } 50 | 51 | foreach (var elem in animalsNames) 52 | { 53 | Console.WriteLine(elem); 54 | } 55 | } 56 | 57 | public Boolean isWithin(GeoCoordinate pt, GeoCoordinate sw, GeoCoordinate ne) 58 | { 59 | return pt.Latitude >= sw.Latitude && 60 | pt.Latitude <= ne.Latitude && 61 | pt.Longitude >= sw.Longitude && 62 | pt.Longitude <= ne.Longitude; 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /_Exemple/AzureFunc-WebApi/WebApi/Controllers/ValuesController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Mvc; 7 | using Microsoft.Azure.ServiceBus; 8 | using Microsoft.Extensions.Logging; 9 | using Models; 10 | using Newtonsoft.Json; 11 | using WebApi.Storage; 12 | 13 | namespace DATC_lab2.Controllers 14 | { 15 | [Route("api/[controller]")] 16 | public class ValuesController : Controller 17 | { 18 | private TableStorageService valuesRepository; 19 | private const string TableStorageConnectionString = ""; 20 | private const string ServiceBusConnectionString = ""; 21 | private const string TableName = "MySumTable"; 22 | private const string QueueName = "myqueue-1"; 23 | private ILogger _logger; 24 | 25 | public ValuesController(ILogger logger) 26 | { 27 | this._logger = logger; 28 | valuesRepository = new TableStorageService(logger, TableStorageConnectionString, TableName); 29 | } 30 | 31 | // GET api/values 32 | [HttpGet] 33 | public IEnumerable Get() 34 | { 35 | return valuesRepository.GetAllEntries(); 36 | } 37 | 38 | [HttpGet("latest")] 39 | public MyValue GetLatestValue() 40 | { 41 | // this is very inefficient 42 | return valuesRepository.GetAllEntries().OrderBy(v => v.Timestamp).Last(); 43 | } 44 | 45 | // POST api/values 46 | [HttpPost] 47 | public async Task Post([FromBody]MyValue value) 48 | { 49 | var queueClient = new QueueClient(ServiceBusConnectionString, QueueName); 50 | var queueMessage = new Message(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(value))); 51 | _logger.LogInformation($"Sending message:\n{value.ToString()}"); 52 | await queueClient.SendAsync(queueMessage); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /_Exemple/Lab 5/AzureFunction/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "clean", 6 | "command": "dotnet", 7 | "args": [ 8 | "clean", 9 | "/property:GenerateFullPaths=true", 10 | "/consoleloggerparameters:NoSummary" 11 | ], 12 | "type": "process", 13 | "problemMatcher": "$msCompile" 14 | }, 15 | { 16 | "label": "build", 17 | "command": "dotnet", 18 | "args": [ 19 | "build", 20 | "/property:GenerateFullPaths=true", 21 | "/consoleloggerparameters:NoSummary" 22 | ], 23 | "type": "process", 24 | "dependsOn": "clean", 25 | "group": { 26 | "kind": "build", 27 | "isDefault": true 28 | }, 29 | "problemMatcher": "$msCompile" 30 | }, 31 | { 32 | "label": "clean release", 33 | "command": "dotnet", 34 | "args": [ 35 | "clean", 36 | "--configuration", 37 | "Release", 38 | "/property:GenerateFullPaths=true", 39 | "/consoleloggerparameters:NoSummary" 40 | ], 41 | "type": "process", 42 | "problemMatcher": "$msCompile" 43 | }, 44 | { 45 | "label": "publish", 46 | "command": "dotnet", 47 | "args": [ 48 | "publish", 49 | "--configuration", 50 | "Release", 51 | "/property:GenerateFullPaths=true", 52 | "/consoleloggerparameters:NoSummary" 53 | ], 54 | "type": "process", 55 | "dependsOn": "clean release", 56 | "problemMatcher": "$msCompile" 57 | }, 58 | { 59 | "type": "func", 60 | "dependsOn": "build", 61 | "options": { 62 | "cwd": "${workspaceFolder}/bin/Debug/netcoreapp2.1" 63 | }, 64 | "command": "host start", 65 | "isBackground": true, 66 | "problemMatcher": "$func-watch" 67 | } 68 | ] 69 | } -------------------------------------------------------------------------------- /_Exemple/Lab 6/AzureFunction/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "clean", 6 | "command": "dotnet", 7 | "args": [ 8 | "clean", 9 | "/property:GenerateFullPaths=true", 10 | "/consoleloggerparameters:NoSummary" 11 | ], 12 | "type": "process", 13 | "problemMatcher": "$msCompile" 14 | }, 15 | { 16 | "label": "build", 17 | "command": "dotnet", 18 | "args": [ 19 | "build", 20 | "/property:GenerateFullPaths=true", 21 | "/consoleloggerparameters:NoSummary" 22 | ], 23 | "type": "process", 24 | "dependsOn": "clean", 25 | "group": { 26 | "kind": "build", 27 | "isDefault": true 28 | }, 29 | "problemMatcher": "$msCompile" 30 | }, 31 | { 32 | "label": "clean release", 33 | "command": "dotnet", 34 | "args": [ 35 | "clean", 36 | "--configuration", 37 | "Release", 38 | "/property:GenerateFullPaths=true", 39 | "/consoleloggerparameters:NoSummary" 40 | ], 41 | "type": "process", 42 | "problemMatcher": "$msCompile" 43 | }, 44 | { 45 | "label": "publish", 46 | "command": "dotnet", 47 | "args": [ 48 | "publish", 49 | "--configuration", 50 | "Release", 51 | "/property:GenerateFullPaths=true", 52 | "/consoleloggerparameters:NoSummary" 53 | ], 54 | "type": "process", 55 | "dependsOn": "clean release", 56 | "problemMatcher": "$msCompile" 57 | }, 58 | { 59 | "type": "func", 60 | "dependsOn": "build", 61 | "options": { 62 | "cwd": "${workspaceFolder}/bin/Debug/netcoreapp2.1" 63 | }, 64 | "command": "host start", 65 | "isBackground": true, 66 | "problemMatcher": "$func-watch" 67 | } 68 | ] 69 | } -------------------------------------------------------------------------------- /_Exemple/AzureFunc-WebApi/AzureFunction/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "clean", 6 | "command": "dotnet", 7 | "args": [ 8 | "clean", 9 | "/property:GenerateFullPaths=true", 10 | "/consoleloggerparameters:NoSummary" 11 | ], 12 | "type": "process", 13 | "problemMatcher": "$msCompile" 14 | }, 15 | { 16 | "label": "build", 17 | "command": "dotnet", 18 | "args": [ 19 | "build", 20 | "/property:GenerateFullPaths=true", 21 | "/consoleloggerparameters:NoSummary" 22 | ], 23 | "type": "process", 24 | "dependsOn": "clean", 25 | "group": { 26 | "kind": "build", 27 | "isDefault": true 28 | }, 29 | "problemMatcher": "$msCompile" 30 | }, 31 | { 32 | "label": "clean release", 33 | "command": "dotnet", 34 | "args": [ 35 | "clean", 36 | "--configuration", 37 | "Release", 38 | "/property:GenerateFullPaths=true", 39 | "/consoleloggerparameters:NoSummary" 40 | ], 41 | "type": "process", 42 | "problemMatcher": "$msCompile" 43 | }, 44 | { 45 | "label": "publish", 46 | "command": "dotnet", 47 | "args": [ 48 | "publish", 49 | "--configuration", 50 | "Release", 51 | "/property:GenerateFullPaths=true", 52 | "/consoleloggerparameters:NoSummary" 53 | ], 54 | "type": "process", 55 | "dependsOn": "clean release", 56 | "problemMatcher": "$msCompile" 57 | }, 58 | { 59 | "type": "func", 60 | "dependsOn": "build", 61 | "options": { 62 | "cwd": "${workspaceFolder}/bin/Debug/netcoreapp2.1" 63 | }, 64 | "command": "host start", 65 | "isBackground": true, 66 | "problemMatcher": "$func-watch" 67 | } 68 | ] 69 | } -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator5WebJob/WebJob/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | using Microsoft.WindowsAzure.Storage; 5 | using Microsoft.WindowsAzure.Storage.Table; 6 | 7 | 8 | namespace WebJob 9 | { 10 | class Program 11 | { 12 | private static string storageConnectionString = "DefaultEndpointsProtocol=https;" 13 | + "AccountName=" 14 | + ";AccountKey=" 15 | + ";EndpointSuffix=core.windows.net"; 16 | static void Main(string[] args) 17 | { 18 | Task.Run( async () => await initialize()).GetAwaiter().GetResult(); 19 | } 20 | 21 | static async Task initialize() 22 | { 23 | var account = CloudStorageAccount.Parse(storageConnectionString); 24 | var tableClient = account.CreateCloudTableClient(); 25 | 26 | CloudTable studentsTable = tableClient.GetTableReference("StudentiAA"); 27 | await CreatePeopleTableAsync(studentsTable); 28 | await getCount(studentsTable); 29 | } 30 | 31 | static async Task getCount(CloudTable studentsTable) 32 | { 33 | int count = 0; 34 | TableQuery query = new TableQuery(); 35 | 36 | // Print the fields for each customer. 37 | TableContinuationToken token = null; 38 | do 39 | { 40 | TableQuerySegment resultSegment = await studentsTable.ExecuteQuerySegmentedAsync(query, token); 41 | token = resultSegment.ContinuationToken; 42 | 43 | foreach (StudentEntity entity in resultSegment.Results) 44 | { 45 | count++; 46 | } 47 | } while (token != null); 48 | 49 | Console.WriteLine("Number of students: " + count); 50 | } 51 | 52 | static public async Task CreatePeopleTableAsync(CloudTable metricsTable) 53 | { 54 | // Create the CloudTable if it does not exist 55 | await metricsTable.CreateIfNotExistsAsync(); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 16 | 17 | 18 | 22 | 23 | 32 | Animal danger 33 | 34 | 35 | 36 |
37 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/src/App.js: -------------------------------------------------------------------------------- 1 | import {Login} from './components/Login'; 2 | import React, {Component} from 'react'; 3 | import { Layout } from './components/Layout'; 4 | import { Home } from './components/Home'; 5 | import { AddAnimal } from './components/AddAnimal'; 6 | import { ViewAnimals } from './components/ViewAnimals'; 7 | import { Route,Redirect } from 'react-router'; 8 | import { GoogleLogin,GoogleLogout } from 'react-google-login'; 9 | import PrivateRoute from './components/PrivateRoute'; 10 | import nature from './components/nature.jpeg'; 11 | 12 | 13 | 14 | export default class App extends React.Component { 15 | constructor(props) { 16 | super(props); 17 | this.state = { 18 | isLoggedIn: false, 19 | } 20 | } 21 | 22 | render (){ 23 | const responseGoogle = (response) => { 24 | console.log("Setting loggedin to true"); 25 | this.setState({isLoggedIn: true}) 26 | } 27 | const logout = (e) => 28 | { 29 | this.setState({isLoggedIn: false}) 30 | } 31 | 32 | console.log(this.state.isLoggedIn); 33 | 34 | if(this.state.isLoggedIn === true) 35 | { 36 | return( 37 |
38 | 39 | 40 | 41 | 42 | 47 | 48 | 49 |
50 | ) 51 | }else{ 52 | return( 53 |
54 |

Welcome to animal danger administrator application!

55 | 61 |
62 | ); 63 | } 64 | } 65 | } 66 | 67 | 68 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/AnimalDanger/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Web.Http.Cors; 6 | using AnimalDangerApi.Repositories; 7 | using Microsoft.AspNetCore.Builder; 8 | using Microsoft.AspNetCore.Hosting; 9 | using Microsoft.AspNetCore.HttpsPolicy; 10 | using Microsoft.AspNetCore.Mvc; 11 | using Microsoft.Extensions.Configuration; 12 | using Microsoft.Extensions.DependencyInjection; 13 | using Microsoft.Extensions.Hosting; 14 | using Microsoft.Extensions.Logging; 15 | using Microsoft.WindowsAzure.Storage; 16 | 17 | namespace AnimalDanger 18 | { 19 | public class Startup 20 | { 21 | 22 | public Startup(IConfiguration configuration) 23 | { 24 | Configuration = configuration; 25 | } 26 | 27 | public IConfiguration Configuration { get; } 28 | 29 | // This method gets called by the runtime. Use this method to add services to the container. 30 | public void ConfigureServices(IServiceCollection services) 31 | { 32 | services.AddControllers(); 33 | services.AddCors(o => o.AddPolicy("MyPolicy", builder => 34 | { 35 | builder.AllowAnyOrigin() 36 | .AllowAnyMethod() 37 | .AllowAnyHeader(); 38 | })); 39 | 40 | services.AddTransient(); 41 | services.AddTransient(); 42 | services.AddSingleton(CloudStorageAccount.Parse(Configuration.GetConnectionString("AzureConnectionString"))); 43 | } 44 | 45 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 46 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 47 | { 48 | if (env.IsDevelopment()) 49 | { 50 | app.UseDeveloperExceptionPage(); 51 | } 52 | app.UseCors("MyPolicy"); 53 | app.UseHttpsRedirection(); 54 | 55 | app.UseRouting(); 56 | 57 | app.UseAuthorization(); 58 | 59 | app.UseEndpoints(endpoints => 60 | { 61 | endpoints.MapControllers(); 62 | }); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/src/components/ViewAnimals.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { Map, TileLayer, Marker, Popup,Polygon } from 'react-leaflet'; 3 | 4 | // default safe zone 5 | const polygon = [ 6 | [45.751714,21.219859], 7 | [45.742850,21.219516], 8 | [45.743676,21.236074], 9 | [45.750864,21.233672], 10 | ] 11 | 12 | export class ViewAnimals extends Component { 13 | 14 | constructor(props) { 15 | super(props); 16 | this.state = { animalList: [], loading: true ,zoom: 13,alertsList: [],alert:false}; 17 | } 18 | 19 | componentDidMount() { 20 | this.populateAnimalData(); 21 | // setInterval(this.populateAnimalData,10000); 22 | // setInterval(this._handleAlert,1000); 23 | } 24 | 25 | populateAnimalData = async()=> { 26 | const response = await fetch('https://animaldangerapi.azurewebsites.net/api/Animal'); 27 | const data = await response.json(); 28 | console.log(data); 29 | this.setState({ animalList: data, loading: false }); 30 | } 31 | 32 | _showAlert=(description)=>{ 33 | 34 | if(this.state.alert === false){ 35 | 36 | alert(`DANGER :${description}!`); 37 | } 38 | }; 39 | 40 | // get the animals present in the area 41 | _handleAlert=async()=>{ 42 | const response = await fetch('https://animaldangerapi.azurewebsites.net/api/Animal/Alerts'); 43 | const data = await response.json(); 44 | console.log(data); 45 | if(data != null){ 46 | this._showAlert(data[0].description); 47 | this.setState({alert:true}); 48 | } 49 | else 50 | { 51 | this.setState({alert:false}) 52 | } 53 | }; 54 | 55 | 56 | render() { 57 | const centerPos = [45.748871,21.208679]; 58 | console.log(this.state.animalList) 59 | return ( 60 | 62 | 65 | {this.state.animalList.map(animal => 66 | 67 | 68 | Id: {animal.id}
Name: {animal.name}, Type: {animal.partitionKey} 69 |
70 |
71 | )} 72 | 73 |
74 | ) 75 | } 76 | } 77 | 78 | -------------------------------------------------------------------------------- /_Exemple/Lab 6/QueueConsoleApp/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.ServiceBus; 2 | using Newtonsoft.Json; 3 | using QueueConsoleApp.Models; 4 | using System; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace QueueConsoleApp 9 | { 10 | class Program 11 | { 12 | public const string SERVICE_BUS_CONNECTION_STRING = ""; 13 | public const string QUEUE_NAME = "myqueue-1"; 14 | 15 | static void Main(string[] args) 16 | { 17 | while (true) 18 | { 19 | MainAsync().GetAwaiter().GetResult(); 20 | Console.ReadLine(); 21 | } 22 | } 23 | 24 | private static async Task MainAsync() 25 | { 26 | var queueClient = new QueueClient(SERVICE_BUS_CONNECTION_STRING, QUEUE_NAME); 27 | 28 | var randomNumber = new Random().Next(1, 100); 29 | var message = new QueueMessage() 30 | { 31 | SenderName = GetSenderName(randomNumber), 32 | Ammount = randomNumber, 33 | DestinationAccount = Guid.NewGuid().ToString(), 34 | DestinationName = GetDestinationName(randomNumber) 35 | }; 36 | 37 | var queueMessage = new Message(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(message))); 38 | Console.WriteLine($"Sending message:\n{message.ToString()}"); 39 | await queueClient.SendAsync(queueMessage); 40 | } 41 | 42 | private static string GetSenderName(int randomNumber) 43 | { 44 | switch(randomNumber % 3) 45 | { 46 | case 0: 47 | return "Amanda Jefferson"; 48 | case 1: 49 | return "Elton James"; 50 | default: 51 | return "John Smith"; 52 | } 53 | } 54 | 55 | private static string GetDestinationName(int randomNumber) 56 | { 57 | switch (randomNumber % 3) 58 | { 59 | case 0: 60 | return (randomNumber / 10) % 2 == 0 ? "Elton" : "John"; 61 | case 1: 62 | return (randomNumber / 10 % 2) == 0 ? "Amanda" : "John"; 63 | default: 64 | return (randomNumber / 10 % 2) == 0 ? "Elton" : "Amanda"; 65 | } 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/src/components/Login.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import 'react-google-login'; 3 | 4 | var isLoggedIn = false; 5 | 6 | export const isLogged = () =>{ 7 | return isLoggedIn; 8 | }; 9 | 10 | export class Login extends Component{ 11 | constructor(props) { 12 | super(props); 13 | 14 | this.state = { 15 | isSignedIn: false, 16 | } 17 | 18 | } 19 | componentDidMount() { 20 | 21 | const successCallback = this.onSuccess.bind(this); 22 | 23 | window.gapi.load('auth2', () => { 24 | this.auth2 = window.gapi.auth2.init({ 25 | client_id: '707554693086-onkdae6efl5saje0jj6n1h089n0j4ger.apps.googleusercontent.com', 26 | }) 27 | 28 | // this.auth2.attachClickHandler(document.querySelector('#loginButton'), {}, this.onLoginSuccessful.bind(this)) 29 | 30 | this.auth2.then(() => { 31 | console.log('on init'); 32 | this.setState({ 33 | isSignedIn: this.auth2.isSignedIn.get(), 34 | }); 35 | }); 36 | }); 37 | 38 | window.gapi.load('signin2', function() { 39 | // Method 3: render a sign in button 40 | // using this method will show Signed In if the user is already signed in 41 | var opts = { 42 | width: 200, 43 | height: 50, 44 | client_id: '707554693086-onkdae6efl5saje0jj6n1h089n0j4ger.apps.googleusercontent.com', 45 | onsuccess: successCallback 46 | } 47 | window.gapi.signin2.render('loginButton', opts) 48 | }) 49 | } 50 | 51 | onSuccess() { 52 | console.log('on success') 53 | isLoggedIn = true; 54 | this.setState({ 55 | isSignedIn: true, 56 | err: null 57 | }) 58 | } 59 | 60 | onLoginFailed(err) { 61 | this.setState({ 62 | isSignedIn: false, 63 | error: err, 64 | }) 65 | } 66 | 67 | getContent() { 68 | if (this.state.isSignedIn) { 69 | return

hello user, you're signed in

70 | } else { 71 | return ( 72 |
73 |

You are not signed in. Click here to sign in.

74 | 75 |
76 | ) 77 | } 78 | 79 | } 80 | 81 | render() { 82 | return ( 83 |
84 |
85 |

Login with google

86 | {this.getContent()} 87 |
88 |
89 | ); 90 | } 91 | } -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator5WebJob/StudentsAPI/Controllers/StudentsController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Models; 7 | using Services; 8 | 9 | namespace StudentsAPI.Controllers 10 | { 11 | [Route("api/[controller]")] 12 | [ApiController] 13 | public class StudentsController : ControllerBase 14 | { 15 | // GET api/students 16 | [HttpGet] 17 | public async Task>> Get() 18 | { 19 | using (var service = new StudentsService()) 20 | { 21 | await service.Initialize(); 22 | return await service.GetStudents(); 23 | } 24 | } 25 | 26 | // GET api/students/5 27 | [HttpGet("{id}")] 28 | public ActionResult Get(int id) 29 | { 30 | // Must be implemented 31 | return null; 32 | } 33 | 34 | // POST api/students 35 | [HttpPost] 36 | public async Task Post([FromBody] StudentModel student) 37 | { 38 | if (string.IsNullOrEmpty(student.University) || string.IsNullOrEmpty(student.CNP)) 39 | { 40 | throw new Exception("The student does not have university or CNP set!"); 41 | } 42 | 43 | var studentEntity = new StudentEntity(student.University, student.CNP) 44 | { 45 | Email = student.Email, 46 | Faculty = student.Faculty, 47 | FirstName = student.FirstName, 48 | LastName = student.LastName, 49 | PhoneNumber = student.PhoneNumber, 50 | Year = student.Year 51 | }; 52 | 53 | using (var service = new StudentsService()) 54 | { 55 | await service.Initialize(); 56 | await service.AddStudent(studentEntity); 57 | } 58 | } 59 | 60 | // PUT api/students/5 61 | [HttpPut("{id}")] 62 | public void Put(int id, [FromBody] string value) 63 | { 64 | // Must be implemented 65 | } 66 | 67 | // DELETE api/students/5 68 | [HttpDelete("{id}")] 69 | public void Delete(int id) 70 | { 71 | // Must be implemented 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /_Exemple/Lab 6/AzureFunction/BankTransactionQueueFunction.cs: -------------------------------------------------------------------------------- 1 | using AzureFunction.Models; 2 | using AzureFunction.Storage; 3 | using Microsoft.Azure.WebJobs; 4 | using Microsoft.Extensions.Logging; 5 | using Newtonsoft.Json; 6 | using System; 7 | using System.Linq; 8 | 9 | namespace AzureFunction 10 | { 11 | public static class BankTransactionQueueFunction 12 | { 13 | public const string QUEUE_NAME = "myqueue-1"; 14 | 15 | public const string TABLE_STORAGE_CONNECTION_STRING = ""; 16 | //public const string SERVICE_BUS_CONNECTION_STRING = ""; 17 | 18 | public const string MY_NAME = "AlexandruRus"; 19 | 20 | [FunctionName("BankTransactionQueueFunction")] 21 | public static void Run([ServiceBusTrigger(QUEUE_NAME, Connection = "ConnectionStringKey")]string myQueueItem, ILogger log) 22 | { 23 | log.LogInformation($"C# ServiceBus queue trigger function processed message: {myQueueItem}"); 24 | 25 | var bankTransactionRepository = new TableStorageService(log, TABLE_STORAGE_CONNECTION_STRING, $"{MY_NAME}BankTransaction"); 26 | var bankTransactionStatisticsRepository = new TableStorageService(log, TABLE_STORAGE_CONNECTION_STRING, $"{MY_NAME}BankTransactionStatistics"); 27 | 28 | var queueMessage = JsonConvert.DeserializeObject(myQueueItem); 29 | var transaction = new BankTransaction(queueMessage); 30 | 31 | bankTransactionRepository.InsertOrUpdateEntry(transaction); 32 | 33 | var transactions = bankTransactionRepository.GetByPartitionId(transaction.PartitionKey); 34 | var totalAmmount = transactions.Sum(t => t.Ammount); 35 | 36 | var existingBankTransactionStatistics = bankTransactionStatisticsRepository.GetByPartitionId(transaction.PartitionKey).FirstOrDefault(); 37 | 38 | if (existingBankTransactionStatistics != null) 39 | { 40 | existingBankTransactionStatistics.Ammount = totalAmmount; 41 | } 42 | else 43 | { 44 | existingBankTransactionStatistics = new BankTransactionStatistics(Guid.NewGuid().ToString(), transaction.PartitionKey) 45 | { 46 | Ammount = totalAmmount 47 | }; 48 | } 49 | 50 | bankTransactionStatisticsRepository.InsertOrUpdateEntry(existingBankTransactionStatistics); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator6WebQueue/StudentsAPI/StudentsService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | using Microsoft.WindowsAzure.Storage; 5 | using Microsoft.WindowsAzure.Storage.Table; 6 | using Models; 7 | 8 | namespace Services 9 | { 10 | public class StudentsService : IDisposable 11 | { 12 | private CloudTable studentsTable; 13 | 14 | public StudentsService() 15 | { 16 | string storageConnectionString = "DefaultEndpointsProtocol=https;" 17 | + "AccountName=" 18 | + ";AccountKey=" 19 | + ";EndpointSuffix=core.windows.net"; 20 | 21 | var account = CloudStorageAccount.Parse(storageConnectionString); 22 | var tableClient = account.CreateCloudTableClient(); 23 | 24 | studentsTable = tableClient.GetTableReference("StudentiAA"); 25 | } 26 | 27 | public async Task Initialize() 28 | { 29 | await studentsTable.CreateIfNotExistsAsync(); 30 | } 31 | 32 | public async Task> GetStudents() 33 | { 34 | if (studentsTable == null) 35 | { 36 | throw new Exception(); 37 | } 38 | 39 | var students = new List(); 40 | TableQuery query = new TableQuery(); //.Where(TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, "Smith")); 41 | 42 | TableContinuationToken token = null; 43 | do 44 | { 45 | TableQuerySegment resultSegment = await studentsTable.ExecuteQuerySegmentedAsync(query, token); 46 | token = resultSegment.ContinuationToken; 47 | students.AddRange(resultSegment.Results); 48 | } while (token != null); 49 | 50 | return students; 51 | } 52 | 53 | public async Task AddStudent(StudentEntity student) 54 | { 55 | if (studentsTable == null) 56 | { 57 | throw new Exception(); 58 | } 59 | 60 | var insertOperation = TableOperation.Insert(student); 61 | return await studentsTable.ExecuteAsync(insertOperation); 62 | } 63 | 64 | public void UpdateStudent(StudentEntity student) 65 | { 66 | // Must be implemented 67 | } 68 | 69 | public void DeleteStudent(StudentEntity student) 70 | { 71 | // Must be implemented 72 | } 73 | 74 | public void Dispose() 75 | { 76 | GC.SuppressFinalize(this); 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator5WebJob/StudentsAPI/StudentsService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | using Microsoft.WindowsAzure.Storage; 5 | using Microsoft.WindowsAzure.Storage.Table; 6 | using Models; 7 | 8 | namespace Services 9 | { 10 | public class StudentsService : IDisposable 11 | { 12 | private CloudTable studentsTable; 13 | 14 | public StudentsService() 15 | { 16 | string storageConnectionString = "DefaultEndpointsProtocol=https;" 17 | + "AccountName=" 18 | + ";AccountKey=" 19 | + ";EndpointSuffix=core.windows.net"; 20 | 21 | var account = CloudStorageAccount.Parse(storageConnectionString); 22 | var tableClient = account.CreateCloudTableClient(); 23 | 24 | studentsTable = tableClient.GetTableReference("StudentiAA"); 25 | } 26 | 27 | public async Task Initialize() 28 | { 29 | await studentsTable.CreateIfNotExistsAsync(); 30 | } 31 | 32 | public async Task> GetStudents() 33 | { 34 | if (studentsTable == null) 35 | { 36 | throw new Exception(); 37 | } 38 | 39 | var students = new List(); 40 | TableQuery query = new TableQuery(); //.Where(TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, "Smith")); 41 | 42 | TableContinuationToken token = null; 43 | do 44 | { 45 | TableQuerySegment resultSegment = await studentsTable.ExecuteQuerySegmentedAsync(query, token); 46 | token = resultSegment.ContinuationToken; 47 | students.AddRange(resultSegment.Results); 48 | } while (token != null); 49 | 50 | return students; 51 | } 52 | 53 | public async Task AddStudent(StudentEntity student) 54 | { 55 | if (studentsTable == null) 56 | { 57 | throw new Exception(); 58 | } 59 | 60 | var insertOperation = TableOperation.Insert(student); 61 | return await studentsTable.ExecuteAsync(insertOperation); 62 | } 63 | 64 | public void UpdateStudent(StudentEntity student) 65 | { 66 | // Must be implemented 67 | } 68 | 69 | public void DeleteStudent(StudentEntity student) 70 | { 71 | // Must be implemented 72 | } 73 | 74 | public void Dispose() 75 | { 76 | GC.SuppressFinalize(this); 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /RUS_ALEXANDRU/Lab2/WebApi/Controllers/StudentController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using DATC_lab2.Models; 4 | using Microsoft.AspNetCore.Mvc; 5 | 6 | namespace DATC_lab2.Controllers 7 | { 8 | [Route("api/[controller]")] 9 | public class StudentController : Controller 10 | { 11 | private static List _studentList = new List(); 12 | 13 | // GET api/values 14 | [HttpGet] 15 | public ActionResult Get() 16 | { 17 | return Ok(_studentList); 18 | } 19 | 20 | [HttpGet("{id}")] 21 | public ActionResult Get(int id) 22 | { 23 | var student = _studentList.Where(s => s.Id == id).FirstOrDefault(); 24 | 25 | if(student != null) 26 | { 27 | return Ok(student); 28 | } 29 | else 30 | { 31 | return NotFound(); 32 | } 33 | } 34 | 35 | // POST api/values 36 | [HttpPost] 37 | public ActionResult Post([FromBody]Student student) 38 | { 39 | if(_studentList.Where(s => s.Id == student.Id).FirstOrDefault() != null) 40 | { 41 | return BadRequest($"Id {student.Id} is already used for a different Student"); 42 | } 43 | else 44 | { 45 | _studentList.Add(student); 46 | return Created(student.Id.ToString(), student); 47 | } 48 | } 49 | 50 | // PUT api/values/5 51 | [HttpPut("{id}")] 52 | public ActionResult Put(int id, [FromBody]Student student) 53 | { 54 | if(student.Id == 0) 55 | { 56 | student.Id = id; 57 | } 58 | 59 | var existingStudent = _studentList.Where(s => s.Id == student.Id).FirstOrDefault(); 60 | 61 | if(existingStudent != null) 62 | { 63 | var index = _studentList.IndexOf(existingStudent); 64 | _studentList[index] = student; 65 | return Accepted(student); 66 | } 67 | else 68 | { 69 | _studentList.Add(student); 70 | return Created(student.Id.ToString(), student); 71 | } 72 | } 73 | 74 | // DELETE api/values/5 75 | [HttpDelete("{id}")] 76 | public ActionResult Delete(int id) 77 | { 78 | var existingStudent = _studentList.Where(s => s.Id == id).FirstOrDefault(); 79 | 80 | if(existingStudent != null) 81 | { 82 | _studentList.Remove(existingStudent); 83 | return Accepted(); 84 | } 85 | else 86 | { 87 | return NotFound(); 88 | } 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/AnimalDanger/Controllers/AnimalController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using AnimalDangerApi.Models; 7 | using AnimalDangerApi.Repositories; 8 | using Microsoft.AspNetCore.Http; 9 | using Microsoft.AspNetCore.Mvc; 10 | using Microsoft.Azure.ServiceBus; 11 | using Newtonsoft.Json; 12 | 13 | namespace AnimalDangerApi.Controllers 14 | { 15 | [Route("api/[controller]")] 16 | [ApiController] 17 | public class AnimalController : ControllerBase 18 | { 19 | private readonly IAnimalRepo _animalsRepo; 20 | private readonly AlertRepo _alertsRepo; 21 | public AnimalController(IAnimalRepo animalsRepo,AlertRepo alertsRepo) 22 | { 23 | _animalsRepo = animalsRepo; 24 | _alertsRepo = alertsRepo; 25 | } 26 | // GET: api/Animal 27 | [HttpGet] 28 | public Task> Get() 29 | { 30 | return _animalsRepo.GetAllAnimals(); 31 | } 32 | 33 | // GET: api/Animal/5 34 | [HttpGet("{id}", Name = "Get")] 35 | public Task Get(int id) 36 | { 37 | return _animalsRepo.RetrieveSingleEntity(Convert.ToString(id)); 38 | } 39 | 40 | // POST: api/Animal 41 | [HttpPost] 42 | public void Post([FromBody] Animal value) 43 | { 44 | value.PartitionKey =Convert.ToString(value.Type); 45 | value.RowKey = Convert.ToString(value.Id); 46 | if(value == null) 47 | { 48 | return; 49 | } 50 | try 51 | { 52 | //var resultConverted = JsonConvert.DeserializeObject(value); 53 | _animalsRepo.InsertOrUpdate(value); 54 | } 55 | catch(Exception) 56 | { 57 | Console.WriteLine("Not a valid response received."); 58 | } 59 | } 60 | 61 | // POST: api/Animal 62 | [HttpPost] 63 | [Route("PostAlert")] 64 | public async Task PostAlert([FromBody] Alert value) 65 | { 66 | if (value == null) 67 | return; 68 | else 69 | { 70 | value.PartitionKey = value.City; 71 | value.RowKey = Convert.ToString(value.Id); 72 | 73 | await _alertsRepo.InsertOrUpdate(value); 74 | } 75 | } 76 | // GET: api/Animal/Alerts 77 | [HttpGet] 78 | [Route("Alerts")] 79 | public Task> GetAlerts() 80 | { 81 | return _alertsRepo.GetAllAlerts(); 82 | } 83 | 84 | // PUT: api/Animal/5 85 | [HttpPut("{id}")] 86 | public void Put(int id, [FromBody] string value) 87 | { 88 | } 89 | 90 | // DELETE: api/ApiWithActions/5 91 | [HttpDelete("{id}")] 92 | public void Delete(int id) 93 | { 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /_Exemple/Lab 2/WebApi/Controllers/Student2Controller.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using DATC_lab2.Models; 4 | using Microsoft.AspNetCore.Mvc; 5 | 6 | namespace DATC_lab2.Controllers 7 | { 8 | [Route("api/[controller]")] 9 | // This controller returns ActionResult objects. This allows us more control over the returned status code: NotFound, Created, etc 10 | public class Student2Controller : Controller 11 | { 12 | private static List _studentList = new List(); 13 | 14 | public Student2Controller() 15 | { 16 | } 17 | 18 | // GET api/values 19 | [HttpGet] 20 | public ActionResult Get() 21 | { 22 | return Ok(_studentList); 23 | } 24 | 25 | [HttpGet("{id}")] 26 | public ActionResult Get(int id) 27 | { 28 | var student = _studentList.Where(s => s.Id == id).FirstOrDefault(); 29 | 30 | if(student != null) 31 | { 32 | return Ok(student); 33 | } 34 | else 35 | { 36 | return NotFound(); 37 | } 38 | } 39 | 40 | // POST api/values 41 | [HttpPost] 42 | public ActionResult Post([FromBody]Student student) 43 | { 44 | if(_studentList.Where(s => s.Id == student.Id).FirstOrDefault() != null) 45 | { 46 | return BadRequest($"Id {student.Id} is already used for a different Student"); 47 | } 48 | else 49 | { 50 | _studentList.Add(student); 51 | return Created(student.Id.ToString(), student); 52 | } 53 | } 54 | 55 | // PUT api/values/5 56 | [HttpPut("{id}")] 57 | public ActionResult Put(int id, [FromBody]Student student) 58 | { 59 | if(student.Id == 0) 60 | { 61 | student.Id = id; 62 | } 63 | 64 | var existingStudent = _studentList.Where(s => s.Id == student.Id).FirstOrDefault(); 65 | 66 | if(existingStudent != null) 67 | { 68 | var index = _studentList.IndexOf(existingStudent); 69 | _studentList[index] = student; 70 | return Accepted(student); 71 | } 72 | else 73 | { 74 | _studentList.Add(student); 75 | return Created(student.Id.ToString(), student); 76 | } 77 | } 78 | 79 | // DELETE api/values/5 80 | [HttpDelete("{id}")] 81 | public ActionResult Delete(int id) 82 | { 83 | var existingStudent = _studentList.Where(s => s.Id == id).FirstOrDefault(); 84 | 85 | if(existingStudent != null) 86 | { 87 | _studentList.Remove(existingStudent); 88 | return Accepted(); 89 | } 90 | else 91 | { 92 | return NotFound(); 93 | } 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/AnimalDanger/Repositories/AnimalRepo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using AnimalDangerApi.Models; 6 | using Microsoft.WindowsAzure.Storage; 7 | using Microsoft.WindowsAzure.Storage.Table; 8 | 9 | namespace AnimalDangerApi.Repositories 10 | { 11 | public class AnimalRepo : IAnimalRepo 12 | { 13 | private CloudTable animalsTable; 14 | public AnimalRepo() 15 | { 16 | string storageConnectionString = "DefaultEndpointsProtocol=https;AccountName=animaldanger;AccountKey=eu+i0X92PnCCcrPXYdEfzo/onHrgZheCxZY3xsO5mj4Amm1zwF2bEIYpVY7aknILcZETcysR5hDHtN3qokhoXg==;EndpointSuffix=core.windows.net"; 17 | 18 | var account = CloudStorageAccount.Parse(storageConnectionString); 19 | var tableClient = account.CreateCloudTableClient(); 20 | animalsTable = tableClient.GetTableReference("Animals"); 21 | } 22 | 23 | public async Task> GetAllAnimals() 24 | { 25 | if (animalsTable == null) 26 | { 27 | throw new Exception(); 28 | } 29 | 30 | var animals = new List(); 31 | TableQuery query = new TableQuery(); //.Where(TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, "Smith")); 32 | 33 | TableContinuationToken token = null; 34 | do 35 | { 36 | TableQuerySegment resultSegment = await animalsTable.ExecuteQuerySegmentedAsync(query, token); 37 | token = resultSegment.ContinuationToken; 38 | animals.AddRange(resultSegment.Results); 39 | } while (token != null); 40 | 41 | return animals; 42 | } 43 | 44 | public async Task InsertOrUpdate(Animal animal) 45 | { 46 | if (animalsTable == null) 47 | { 48 | Console.WriteLine("Table doesn't exist!"); 49 | throw new Exception(); 50 | } 51 | var insertOperation = TableOperation.InsertOrMerge(animal); 52 | return await animalsTable.ExecuteAsync(insertOperation); 53 | } 54 | 55 | public async Task RetrieveSingleEntity(string id) 56 | { 57 | TableOperation retrieveOperation = TableOperation.Retrieve(AnimalType.Bear.ToString(),id); 58 | 59 | // Execute the retrieve operation. 60 | TableResult retrievedResult = await animalsTable.ExecuteAsync(retrieveOperation); 61 | 62 | // Print the phone number of the result. 63 | if (retrievedResult.Result != null) 64 | { 65 | Console.WriteLine("Result was not null"); 66 | Console.WriteLine(((Animal)retrievedResult.Result).Name); 67 | var retrievedAnimal = (Animal)retrievedResult.Result; 68 | return retrievedAnimal; 69 | } 70 | else 71 | { 72 | Console.WriteLine("The Name could not be retrieved."); 73 | throw new Exception(); 74 | } 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/AnimalDanger/Repositories/AlertRepo.cs: -------------------------------------------------------------------------------- 1 | using AnimalDangerApi.Models; 2 | using Microsoft.WindowsAzure.Storage; 3 | using Microsoft.WindowsAzure.Storage.Table; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Threading.Tasks; 8 | 9 | namespace AnimalDangerApi.Repositories 10 | { 11 | public class AlertRepo 12 | { 13 | private CloudTable alertsTable; 14 | public AlertRepo() 15 | { 16 | string storageConnectionString = "DefaultEndpointsProtocol=https;AccountName=animaldanger;AccountKey=eu+i0X92PnCCcrPXYdEfzo/onHrgZheCxZY3xsO5mj4Amm1zwF2bEIYpVY7aknILcZETcysR5hDHtN3qokhoXg==;EndpointSuffix=core.windows.net"; 17 | 18 | var account = CloudStorageAccount.Parse(storageConnectionString); 19 | var tableClient = account.CreateCloudTableClient(); 20 | alertsTable = tableClient.GetTableReference("Alerts"); 21 | alertsTable.CreateIfNotExistsAsync(); 22 | } 23 | 24 | public async Task> GetAllAlerts() 25 | { 26 | if (alertsTable == null) 27 | { 28 | throw new Exception(); 29 | } 30 | 31 | var animals = new List(); 32 | TableQuery query = new TableQuery(); //.Where(TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, "Smith")); 33 | 34 | TableContinuationToken token = null; 35 | do 36 | { 37 | TableQuerySegment resultSegment = await alertsTable.ExecuteQuerySegmentedAsync(query, token); 38 | token = resultSegment.ContinuationToken; 39 | animals.AddRange(resultSegment.Results); 40 | } while (token != null); 41 | 42 | return animals; 43 | } 44 | 45 | public async Task InsertOrUpdate(Alert alert) 46 | { 47 | if (alertsTable == null) 48 | { 49 | Console.WriteLine("Table doesn't exist!"); 50 | throw new Exception(); 51 | } 52 | var insertOperation = TableOperation.InsertOrMerge(alert); 53 | return await alertsTable.ExecuteAsync(insertOperation); 54 | } 55 | 56 | public async Task RetrieveSingleEntity(string partitionKey,string rowKey) 57 | { 58 | TableOperation retrieveOperation = TableOperation.Retrieve(partitionKey,rowKey); 59 | 60 | // Execute the retrieve operation. 61 | TableResult retrievedResult = await alertsTable.ExecuteAsync(retrieveOperation); 62 | 63 | // Print the phone number of the result. 64 | if (retrievedResult.Result != null) 65 | { 66 | Console.WriteLine("Result was not null"); 67 | Console.WriteLine(((Alert)retrievedResult.Result).City); 68 | var retrievedAlert = (Alert)retrievedResult.Result; 69 | return retrievedAlert; 70 | } 71 | else 72 | { 73 | Console.WriteLine("The Name could not be retrieved."); 74 | throw new Exception(); 75 | } 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator6WebQueue/StudentsAPI/Controllers/StudentsController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Models; 7 | using Services; 8 | using System.Text; 9 | using System.Threading; 10 | using Microsoft.Azure.ServiceBus; 11 | using Newtonsoft.Json; 12 | 13 | namespace StudentsAPI.Controllers 14 | { 15 | [Route("api/[controller]")] 16 | [ApiController] 17 | public class StudentsController : ControllerBase 18 | { 19 | 20 | const string ServiceBusConnectionString = ""; 21 | const string QueueName = "queue-3"; 22 | static IQueueClient queueClient; 23 | // GET api/students 24 | [HttpGet] 25 | public async Task>> Get() 26 | { 27 | using (var service = new StudentsService()) 28 | { 29 | await service.Initialize(); 30 | return await service.GetStudents(); 31 | } 32 | } 33 | 34 | // GET api/students/5 35 | [HttpGet("{id}")] 36 | public ActionResult Get(int id) 37 | { 38 | return null; 39 | } 40 | 41 | // POST api/students 42 | [HttpPost] 43 | public async Task Post([FromBody] StudentModel student) 44 | { 45 | queueClient = new QueueClient(ServiceBusConnectionString, QueueName); 46 | if (string.IsNullOrEmpty(student.University) || string.IsNullOrEmpty(student.CNP)) 47 | { 48 | throw new Exception("The student does not have university or CNP set!"); 49 | } 50 | 51 | var studentEntity = new StudentEntity(student.University, student.CNP) 52 | { 53 | Email = student.Email, 54 | Faculty = student.Faculty, 55 | FirstName = student.FirstName, 56 | LastName = student.LastName, 57 | PhoneNumber = student.PhoneNumber, 58 | Year = student.Year 59 | }; 60 | 61 | await SendMessagesAsync(studentEntity); 62 | await queueClient.CloseAsync(); 63 | } 64 | 65 | static async Task SendMessagesAsync(StudentEntity student) 66 | { 67 | try{ 68 | string studentSerialized = JsonConvert.SerializeObject(student); 69 | 70 | var studentEncoded = new Message(Encoding.UTF8.GetBytes(studentSerialized)); 71 | Console.WriteLine($"Sending student: {studentEncoded}"); 72 | 73 | await queueClient.SendAsync(studentEncoded); 74 | } 75 | catch(Exception ex) 76 | { 77 | Console.WriteLine($"{DateTime.Now} :: Exception: {ex.Message}"); 78 | } 79 | } 80 | 81 | 82 | // PUT api/students/5 83 | [HttpPut("{id}")] 84 | public void Put(int id, [FromBody] string value) 85 | { 86 | // Must be implemented 87 | } 88 | 89 | // DELETE api/students/5 90 | [HttpDelete("{id}")] 91 | public void Delete(int id) 92 | { 93 | // Must be implemented 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator3/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Google.Apis.Auth.OAuth2; 3 | using Google.Apis.Drive.v3; 4 | using Google.Apis.Drive.v3.Data; 5 | using Google.Apis.Services; 6 | using Google.Apis.Util.Store; 7 | using System.Threading; 8 | using System.Collections.Generic; 9 | using System.Net; 10 | using System.IO; 11 | namespace Laborator2 12 | { 13 | class Program 14 | { 15 | static string[] scopes = {DriveService.Scope.Drive,DriveService.Scope.DriveFile}; 16 | private static string _token; 17 | static void Main(string[] args) 18 | { 19 | init(); 20 | } 21 | 22 | static void init() 23 | { 24 | 25 | 26 | var credential = GoogleWebAuthorizationBroker.AuthorizeAsync( 27 | new ClientSecrets{ 28 | ClientId = credentials[0], 29 | ClientSecret = credentials[1] 30 | }, 31 | scopes, 32 | Environment.UserName, 33 | CancellationToken.None, 34 | new FileDataStore("Credential",false) 35 | ).Result; 36 | 37 | //Token created 38 | Console.WriteLine("Token is "+ credential.Token.AccessToken); 39 | 40 | GetMyFiles(credential); 41 | //UploadFile(credential); 42 | } 43 | 44 | static void GetMyFiles(UserCredential credential){ 45 | 46 | // create new driver service 47 | var service = new DriveService(new BaseClientService.Initializer(){ 48 | HttpClientInitializer = credential, 49 | ApplicationName = "DATC" 50 | }); 51 | FilesResource.ListRequest listRequest = service.Files.List(); 52 | listRequest.PageSize = 10; 53 | listRequest.Fields = "nextPageToken, files(id, name)"; 54 | 55 | // List files. 56 | IList files = listRequest.Execute() 57 | .Files; 58 | Console.WriteLine("Files: "); 59 | if (files != null && files.Count > 0) 60 | { 61 | foreach (var file in files) 62 | { 63 | Console.WriteLine("{0} ({1})", file.Name); 64 | } 65 | } 66 | else 67 | { 68 | Console.WriteLine("No files found."); 69 | } 70 | Console.Read(); 71 | } 72 | static void UploadFile(UserCredential credential) 73 | { 74 | var service = new DriveService(new BaseClientService.Initializer(){ 75 | HttpClientInitializer = credential, 76 | ApplicationName = "DATC" 77 | }); 78 | 79 | var fileMetaData = new Google.Apis.Drive.v3.Data.File() 80 | { 81 | Name = "MyFolder", 82 | MimeType = "application/vnd.google-apps.folder" 83 | }; 84 | 85 | FilesResource.CreateMediaUpload request; 86 | 87 | using (var stream = new FileStream(("./test.txt"),System.IO.FileMode.Open)) 88 | { 89 | request = service.Files.Create( 90 | fileMetaData, stream, "test"); 91 | request.Fields = "id"; 92 | request.Upload(); 93 | }; 94 | var file = request.ResponseBody; 95 | //Console.WriteLine("File ID: " + file.Id); 96 | } 97 | } 98 | 99 | 100 | } 101 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/src/components/AddAnimal.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { 3 | Container, Col, Form, 4 | FormGroup, Label, Input, 5 | Button, 6 | } from 'reactstrap'; 7 | import axios from 'axios'; 8 | 9 | export class AddAnimal extends React.Component { 10 | constructor(props) { 11 | super(props); 12 | 13 | this.handleChange = this.handleChange.bind(this); 14 | this.handleSubmit = this.handleSubmit.bind(this); 15 | } 16 | 17 | handleChange(event){ 18 | this.setState({value: event.target.value}); 19 | } 20 | 21 | handleSubmit(event){ 22 | const form = event.target; 23 | const dataToPost = new FormData(form); 24 | 25 | // empty object 26 | var object = {}; 27 | dataToPost.forEach(function (value,key) { 28 | if(key == "name") 29 | { 30 | object[key] = value; 31 | } 32 | else 33 | { 34 | object[key] = Number(value); 35 | } 36 | 37 | console.log(key +": " + value) 38 | }); 39 | 40 | var json =JSON.stringify(object); 41 | console.log(json) 42 | axios({ 43 | method: 'post', 44 | url: 'https://animaldangerapi.azurewebsites.net/api/Animal', 45 | headers:{'Content-Type': 'application/json; charset=utf-8'}, 46 | data: json 47 | }) 48 | .then(function (response) { 49 | console.log("The response of the server: "+response.data); 50 | }) 51 | .catch(function (error) { 52 | // handle error 53 | console.log(error); 54 | }) 55 | .finally(function () { 56 | // 57 | }); 58 | 59 | } 60 | 61 | render() { 62 | return ( 63 | 64 |

Add an animal

65 |
66 | 67 | 68 | 69 | 75 | 76 | 77 | 78 | 79 | 80 | 86 | 87 | 88 | 89 | 90 | 91 | 97 | 98 | 99 | 100 | 101 | 102 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 |
122 |
123 | ); 124 | } 125 | } -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/BackgroundWorker/Repositories/AlertRepo.cs: -------------------------------------------------------------------------------- 1 | using BackgroundWorker.Models; 2 | using Microsoft.WindowsAzure.Storage; 3 | using Microsoft.WindowsAzure.Storage.Table; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Threading.Tasks; 8 | 9 | namespace BackgroundWorker.Repositories 10 | { 11 | public class AlertRepo 12 | { 13 | private CloudTable alertsTable; 14 | public AlertRepo() 15 | { 16 | string storageConnectionString = "DefaultEndpointsProtocol=https;AccountName=animaldanger;AccountKey=eu+i0X92PnCCcrPXYdEfzo/onHrgZheCxZY3xsO5mj4Amm1zwF2bEIYpVY7aknILcZETcysR5hDHtN3qokhoXg==;EndpointSuffix=core.windows.net"; 17 | 18 | var account = CloudStorageAccount.Parse(storageConnectionString); 19 | var tableClient = account.CreateCloudTableClient(); 20 | alertsTable = tableClient.GetTableReference("Alerts"); 21 | alertsTable.CreateIfNotExistsAsync(); 22 | } 23 | 24 | public async Task> GetAllAlerts() 25 | { 26 | if (alertsTable == null) 27 | { 28 | throw new Exception(); 29 | } 30 | 31 | var animals = new List(); 32 | TableQuery query = new TableQuery(); //.Where(TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, "Smith")); 33 | 34 | TableContinuationToken token = null; 35 | do 36 | { 37 | TableQuerySegment resultSegment = await alertsTable.ExecuteQuerySegmentedAsync(query, token); 38 | token = resultSegment.ContinuationToken; 39 | animals.AddRange(resultSegment.Results); 40 | } while (token != null); 41 | 42 | return animals; 43 | } 44 | 45 | public async Task InsertOrUpdate(Alert alert) 46 | { 47 | if (alertsTable == null) 48 | { 49 | Console.WriteLine("Table doesn't exist!"); 50 | throw new Exception(); 51 | } 52 | var insertOperation = TableOperation.InsertOrMerge(alert); 53 | return await alertsTable.ExecuteAsync(insertOperation); 54 | } 55 | 56 | public async Task RetrieveSingleEntity(string partitionKey,string rowKey) 57 | { 58 | TableOperation retrieveOperation = TableOperation.Retrieve(partitionKey,rowKey); 59 | 60 | // Execute the retrieve operation. 61 | TableResult retrievedResult = await alertsTable.ExecuteAsync(retrieveOperation); 62 | 63 | // Print the phone number of the result. 64 | if (retrievedResult.Result != null) 65 | { 66 | Console.WriteLine("Result was not null"); 67 | Console.WriteLine(((Alert)retrievedResult.Result).City); 68 | var retrievedAlert = (Alert)retrievedResult.Result; 69 | return retrievedAlert; 70 | } 71 | else 72 | { 73 | Console.WriteLine("The Name could not be retrieved."); 74 | throw new Exception(); 75 | } 76 | } 77 | 78 | public async Task DeleteEnetityAsync(string partitionKey, string rowKey) 79 | { 80 | TableOperation retrieveOperation = TableOperation.Retrieve(partitionKey, rowKey); 81 | 82 | // Execute the operation. 83 | TableResult retrievedResult = await alertsTable.ExecuteAsync(retrieveOperation); 84 | 85 | // Assign the result to a CustomerEntity object. 86 | Alert deleteEntity = (Alert)retrievedResult.Result; 87 | 88 | // Create the Delete TableOperation and then execute it. 89 | if (deleteEntity != null) 90 | { 91 | TableOperation deleteOperation = TableOperation.Delete(deleteEntity); 92 | 93 | // Execute the operation. 94 | await alertsTable.ExecuteAsync(deleteOperation); 95 | 96 | Console.WriteLine("Entity deleted."); 97 | } 98 | 99 | else 100 | Console.WriteLine("Couldn't delete the entity."); 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/build/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Animal danger 18 | 20 | 22 | 23 | 24 | 25 |
26 | 102 | 103 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /_Exemple/Lab 5/AzureFunction/TableStorageAzureFunction.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using AzureFunction.Models; 4 | using AzureFunction.Storage; 5 | using Microsoft.Azure.WebJobs; 6 | using Microsoft.Extensions.Logging; 7 | 8 | namespace AzureFunction 9 | { 10 | public static class TableStorageAzureFunction 11 | { 12 | public static string ConnectionString = ""; 13 | public static string My_Name = "AlexandruRus"; 14 | 15 | [FunctionName("TimerTriggerCSharp")] 16 | public static void Run([TimerTrigger("0 * * * * *")]TimerInfo myTimer, ILogger log) 17 | { 18 | log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}"); 19 | 20 | var bankTransactionRepository = new TableStorageService(log, ConnectionString, $"{My_Name}BankTransaction"); 21 | var bankTransactionStatisticsRepository = new TableStorageService(log, ConnectionString, $"{My_Name}BankTransactionStatistics"); 22 | 23 | SeedData(bankTransactionRepository); 24 | 25 | // Generate BankTransactionStatistics from all senders by aggregating the total sum of their transactions 26 | 27 | var entities = bankTransactionRepository.GetAllEntries(); 28 | var senders = entities.Select(e => e.PartitionKey).Distinct(); 29 | 30 | foreach(var sender in senders) 31 | { 32 | var transactions = bankTransactionRepository.GetByPartitionId(sender); 33 | var totalAmmount = transactions.Sum(t => t.Ammount); 34 | 35 | var existingBankTransactionStatistics = bankTransactionStatisticsRepository.GetByPartitionId(sender).FirstOrDefault(); 36 | 37 | if(existingBankTransactionStatistics != null) 38 | { 39 | existingBankTransactionStatistics.Ammount = totalAmmount; 40 | } 41 | else 42 | { 43 | existingBankTransactionStatistics = new BankTransactionStatistics(Guid.NewGuid().ToString(), sender) 44 | { 45 | Ammount = totalAmmount 46 | }; 47 | } 48 | 49 | bankTransactionStatisticsRepository.InsertOrUpdateEntry(existingBankTransactionStatistics); 50 | } 51 | } 52 | 53 | private static void SeedData(TableStorageService tableStorageService) 54 | { 55 | var transactions = new BankTransaction[] 56 | { 57 | new BankTransaction("1", "John Smith") 58 | { 59 | Ammount = new Random().Next(1, 100), 60 | DestinationAccount = Guid.NewGuid().ToString(), 61 | DestinationName = "Amanda" 62 | }, 63 | new BankTransaction("2", "John Smith") 64 | { 65 | Ammount = new Random().Next(1, 100), 66 | DestinationAccount = Guid.NewGuid().ToString(), 67 | DestinationName = "Elton" 68 | }, 69 | new BankTransaction("3", "Elton James") 70 | { 71 | Ammount = new Random().Next(1, 100), 72 | DestinationAccount = Guid.NewGuid().ToString(), 73 | DestinationName = "Amanda" 74 | }, 75 | new BankTransaction("4", "John Smith") 76 | { 77 | Ammount = new Random().Next(1, 100), 78 | DestinationAccount = Guid.NewGuid().ToString(), 79 | DestinationName = "Elton" 80 | }, 81 | new BankTransaction("5", "Elton James") 82 | { 83 | Ammount = new Random().Next(1, 100), 84 | DestinationAccount = Guid.NewGuid().ToString(), 85 | DestinationName = "Amanda" 86 | }, 87 | new BankTransaction("6", "Amanda Jefferson") 88 | { 89 | Ammount = new Random().Next(1, 100), 90 | DestinationAccount = Guid.NewGuid().ToString(), 91 | DestinationName = "John" 92 | }, 93 | new BankTransaction("7", "Amanda Jefferson") 94 | { 95 | Ammount = new Random().Next(1, 100), 96 | DestinationAccount = Guid.NewGuid().ToString(), 97 | DestinationName = "Elton" 98 | }, 99 | new BankTransaction("8", "John Smith") 100 | { 101 | Ammount = new Random().Next(1, 100), 102 | DestinationAccount = Guid.NewGuid().ToString(), 103 | DestinationName = "Elton" 104 | }, 105 | new BankTransaction("9", "Amanda Jefferson") 106 | { 107 | Ammount = new Random().Next(1, 100), 108 | DestinationAccount = Guid.NewGuid().ToString(), 109 | DestinationName = "Elton" 110 | }, 111 | }; 112 | 113 | foreach(var transaction in transactions) 114 | { 115 | tableStorageService.InsertOrUpdateEntry(transaction); 116 | } 117 | } 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /_Exemple/Lab 6/AzureFunction/TableStorageAzureFunction.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using AzureFunction.Models; 4 | using AzureFunction.Storage; 5 | using Microsoft.Azure.WebJobs; 6 | using Microsoft.Extensions.Logging; 7 | 8 | namespace AzureFunction 9 | { 10 | public static class TableStorageAzureFunction 11 | { 12 | public static string ConnectionString = ""; 13 | public static string My_Name = "AlexandruRus"; 14 | 15 | //[FunctionName("TimerTriggerCSharp")] 16 | public static void Run([TimerTrigger("0 * * * * *")]TimerInfo myTimer, ILogger log) 17 | { 18 | log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}"); 19 | 20 | var bankTransactionRepository = new TableStorageService(log, ConnectionString, $"{My_Name}BankTransaction"); 21 | var bankTransactionStatisticsRepository = new TableStorageService(log, ConnectionString, $"{My_Name}BankTransactionStatistics"); 22 | 23 | SeedData(bankTransactionRepository); 24 | 25 | // Generate BankTransactionStatistics from all senders by aggregating the total sum of their transactions 26 | 27 | var entities = bankTransactionRepository.GetAllEntries(); 28 | var senders = entities.Select(e => e.PartitionKey).Distinct(); 29 | 30 | foreach(var sender in senders) 31 | { 32 | var transactions = bankTransactionRepository.GetByPartitionId(sender); 33 | var totalAmmount = transactions.Sum(t => t.Ammount); 34 | 35 | var existingBankTransactionStatistics = bankTransactionStatisticsRepository.GetByPartitionId(sender).FirstOrDefault(); 36 | 37 | if(existingBankTransactionStatistics != null) 38 | { 39 | existingBankTransactionStatistics.Ammount = totalAmmount; 40 | } 41 | else 42 | { 43 | existingBankTransactionStatistics = new BankTransactionStatistics(Guid.NewGuid().ToString(), sender) 44 | { 45 | Ammount = totalAmmount 46 | }; 47 | } 48 | 49 | bankTransactionStatisticsRepository.InsertOrUpdateEntry(existingBankTransactionStatistics); 50 | } 51 | } 52 | 53 | private static void SeedData(TableStorageService tableStorageService) 54 | { 55 | var transactions = new BankTransaction[] 56 | { 57 | new BankTransaction("1", "John Smith") 58 | { 59 | Ammount = new Random().Next(1, 100), 60 | DestinationAccount = Guid.NewGuid().ToString(), 61 | DestinationName = "Amanda" 62 | }, 63 | new BankTransaction("2", "John Smith") 64 | { 65 | Ammount = new Random().Next(1, 100), 66 | DestinationAccount = Guid.NewGuid().ToString(), 67 | DestinationName = "Elton" 68 | }, 69 | new BankTransaction("3", "Elton James") 70 | { 71 | Ammount = new Random().Next(1, 100), 72 | DestinationAccount = Guid.NewGuid().ToString(), 73 | DestinationName = "Amanda" 74 | }, 75 | new BankTransaction("4", "John Smith") 76 | { 77 | Ammount = new Random().Next(1, 100), 78 | DestinationAccount = Guid.NewGuid().ToString(), 79 | DestinationName = "Elton" 80 | }, 81 | new BankTransaction("5", "Elton James") 82 | { 83 | Ammount = new Random().Next(1, 100), 84 | DestinationAccount = Guid.NewGuid().ToString(), 85 | DestinationName = "Amanda" 86 | }, 87 | new BankTransaction("6", "Amanda Jefferson") 88 | { 89 | Ammount = new Random().Next(1, 100), 90 | DestinationAccount = Guid.NewGuid().ToString(), 91 | DestinationName = "John" 92 | }, 93 | new BankTransaction("7", "Amanda Jefferson") 94 | { 95 | Ammount = new Random().Next(1, 100), 96 | DestinationAccount = Guid.NewGuid().ToString(), 97 | DestinationName = "Elton" 98 | }, 99 | new BankTransaction("8", "John Smith") 100 | { 101 | Ammount = new Random().Next(1, 100), 102 | DestinationAccount = Guid.NewGuid().ToString(), 103 | DestinationName = "Elton" 104 | }, 105 | new BankTransaction("9", "Amanda Jefferson") 106 | { 107 | Ammount = new Random().Next(1, 100), 108 | DestinationAccount = Guid.NewGuid().ToString(), 109 | DestinationName = "Elton" 110 | }, 111 | }; 112 | 113 | foreach(var transaction in transactions) 114 | { 115 | tableStorageService.InsertOrUpdateEntry(transaction); 116 | } 117 | } 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator6WebQueue/Receive/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | using Microsoft.Azure.ServiceBus; 4 | using System.Threading.Tasks; 5 | using System.Text; 6 | using Microsoft.WindowsAzure.Storage; 7 | using Microsoft.WindowsAzure.Storage.Table; 8 | using Newtonsoft.Json; 9 | 10 | namespace Receive 11 | { 12 | class Program 13 | { 14 | static private CloudTable studentsTable; 15 | const string ServiceBusConnectionString = ""; 16 | const string QueueName = "queue-3"; 17 | static IQueueClient queueClient; 18 | 19 | 20 | static void Main(string[] args) 21 | { 22 | InitializeTable(); 23 | MainAsync().GetAwaiter().GetResult(); 24 | } 25 | 26 | static async Task InitializeTable() 27 | { 28 | string storageConnectionString = "DefaultEndpointsProtocol=https;" 29 | + "AccountName=" 30 | + ";AccountKey=" 31 | + ";EndpointSuffix=core.windows.net"; 32 | 33 | var account = CloudStorageAccount.Parse(storageConnectionString); 34 | var tableClient = account.CreateCloudTableClient(); 35 | 36 | studentsTable = tableClient.GetTableReference("StudentiAA"); 37 | await studentsTable.CreateIfNotExistsAsync(); 38 | } 39 | static async Task MainAsync() 40 | { 41 | 42 | queueClient = new QueueClient(ServiceBusConnectionString, QueueName); 43 | 44 | Console.WriteLine("======================================================"); 45 | Console.WriteLine("Press ENTER key to exit after sending all the messages."); 46 | Console.WriteLine("======================================================"); 47 | 48 | // Receive Messages 49 | RegisterOnMessageHandlerAndReceiveMessages(); 50 | 51 | Console.ReadKey(); 52 | 53 | await queueClient.CloseAsync(); 54 | } 55 | 56 | static void RegisterOnMessageHandlerAndReceiveMessages() 57 | { 58 | // Configure the MessageHandler Options in terms of exception handling, number of concurrent messages to deliver etc. 59 | var messageHandlerOptions = new MessageHandlerOptions(ExceptionReceivedHandler) 60 | { 61 | // Maximum number of Concurrent calls to the callback `ProcessMessagesAsync`, set to 1 for simplicity. 62 | // Set it according to how many messages the application wants to process in parallel. 63 | MaxConcurrentCalls = 1, 64 | 65 | // Indicates whether MessagePump should automatically complete the messages after returning from User Callback. 66 | // False below indicates the Complete will be handled by the User Callback as in `ProcessMessagesAsync` below. 67 | AutoComplete = false 68 | }; 69 | 70 | // Register the function that will process messages 71 | queueClient.RegisterMessageHandler(ProcessMessagesAsync, messageHandlerOptions); 72 | } 73 | static async Task ProcessMessagesAsync(Message message, CancellationToken token) 74 | { 75 | // Process the message 76 | Console.WriteLine($"Received message: SequenceNumber:{message.SystemProperties.SequenceNumber} Body:{Encoding.UTF8.GetString(message.Body)}"); 77 | 78 | // Complete the message so that it is not received again. 79 | // This can be done only if the queueClient is created in ReceiveMode.PeekLock mode (which is default). 80 | await queueClient.CompleteAsync(message.SystemProperties.LockToken); 81 | 82 | StudentEntity student = JsonConvert.DeserializeObject(Encoding.UTF8.GetString(message.Body)); 83 | 84 | Console.WriteLine($"Student name is: {student.FirstName} and it's faculty is: {student.Faculty}"); 85 | 86 | await AddStudent(student); 87 | // Note: Use the cancellationToken passed as necessary to determine if the queueClient has already been closed. 88 | // If queueClient has already been Closed, you may chose to not call CompleteAsync() or AbandonAsync() etc. calls 89 | // to avoid unnecessary exceptions. 90 | } 91 | 92 | static public async Task AddStudent(StudentEntity student) 93 | { 94 | if (studentsTable == null) 95 | { 96 | throw new Exception(); 97 | } 98 | 99 | var insertOperation = TableOperation.Insert(student); 100 | return await studentsTable.ExecuteAsync(insertOperation); 101 | } 102 | 103 | 104 | static Task ExceptionReceivedHandler(ExceptionReceivedEventArgs exceptionReceivedEventArgs) 105 | { 106 | Console.WriteLine($"Message handler encountered an exception {exceptionReceivedEventArgs.Exception}."); 107 | var context = exceptionReceivedEventArgs.ExceptionReceivedContext; 108 | Console.WriteLine("Exception context for troubleshooting:"); 109 | Console.WriteLine($"- Endpoint: {context.Endpoint}"); 110 | Console.WriteLine($"- Entity Path: {context.EntityPath}"); 111 | Console.WriteLine($"- Executing Action: {context.Action}"); 112 | return Task.CompletedTask; 113 | } 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/src/serviceWorker.js: -------------------------------------------------------------------------------- 1 | // This optional code is used to register a service worker. 2 | // register() is not called by default. 3 | 4 | // This lets the app load faster on subsequent visits in production, and gives 5 | // it offline capabilities. However, it also means that developers (and users) 6 | // will only see deployed updates on subsequent visits to a page, after all the 7 | // existing tabs open on the page have been closed, since previously cached 8 | // resources are updated in the background. 9 | 10 | // To learn more about the benefits of this model and instructions on how to 11 | // opt-in, read https://bit.ly/CRA-PWA 12 | 13 | const isLocalhost = Boolean( 14 | window.location.hostname === 'localhost' || 15 | // [::1] is the IPv6 localhost address. 16 | window.location.hostname === '[::1]' || 17 | // 127.0.0.1/8 is considered localhost for IPv4. 18 | window.location.hostname.match( 19 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ 20 | ) 21 | ); 22 | 23 | export function register(config) { 24 | if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { 25 | // The URL constructor is available in all browsers that support SW. 26 | const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href); 27 | if (publicUrl.origin !== window.location.origin) { 28 | // Our service worker won't work if PUBLIC_URL is on a different origin 29 | // from what our page is served on. This might happen if a CDN is used to 30 | // serve assets; see https://github.com/facebook/create-react-app/issues/2374 31 | return; 32 | } 33 | 34 | window.addEventListener('load', () => { 35 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; 36 | 37 | if (isLocalhost) { 38 | // This is running on localhost. Let's check if a service worker still exists or not. 39 | checkValidServiceWorker(swUrl, config); 40 | 41 | // Add some additional logging to localhost, pointing developers to the 42 | // service worker/PWA documentation. 43 | navigator.serviceWorker.ready.then(() => { 44 | console.log( 45 | 'This web app is being served cache-first by a service ' + 46 | 'worker. To learn more, visit https://bit.ly/CRA-PWA' 47 | ); 48 | }); 49 | } else { 50 | // Is not localhost. Just register service worker 51 | registerValidSW(swUrl, config); 52 | } 53 | }); 54 | } 55 | } 56 | 57 | function registerValidSW(swUrl, config) { 58 | navigator.serviceWorker 59 | .register(swUrl) 60 | .then(registration => { 61 | registration.onupdatefound = () => { 62 | const installingWorker = registration.installing; 63 | if (installingWorker == null) { 64 | return; 65 | } 66 | installingWorker.onstatechange = () => { 67 | if (installingWorker.state === 'installed') { 68 | if (navigator.serviceWorker.controller) { 69 | // At this point, the updated precached content has been fetched, 70 | // but the previous service worker will still serve the older 71 | // content until all client tabs are closed. 72 | console.log( 73 | 'New content is available and will be used when all ' + 74 | 'tabs for this page are closed. See https://bit.ly/CRA-PWA.' 75 | ); 76 | 77 | // Execute callback 78 | if (config && config.onUpdate) { 79 | config.onUpdate(registration); 80 | } 81 | } else { 82 | // At this point, everything has been precached. 83 | // It's the perfect time to display a 84 | // "Content is cached for offline use." message. 85 | console.log('Content is cached for offline use.'); 86 | 87 | // Execute callback 88 | if (config && config.onSuccess) { 89 | config.onSuccess(registration); 90 | } 91 | } 92 | } 93 | }; 94 | }; 95 | }) 96 | .catch(error => { 97 | console.error('Error during service worker registration:', error); 98 | }); 99 | } 100 | 101 | function checkValidServiceWorker(swUrl, config) { 102 | // Check if the service worker can be found. If it can't reload the page. 103 | fetch(swUrl) 104 | .then(response => { 105 | // Ensure service worker exists, and that we really are getting a JS file. 106 | const contentType = response.headers.get('content-type'); 107 | if ( 108 | response.status === 404 || 109 | (contentType != null && contentType.indexOf('javascript') === -1) 110 | ) { 111 | // No service worker found. Probably a different app. Reload the page. 112 | navigator.serviceWorker.ready.then(registration => { 113 | registration.unregister().then(() => { 114 | window.location.reload(); 115 | }); 116 | }); 117 | } else { 118 | // Service worker found. Proceed as normal. 119 | registerValidSW(swUrl, config); 120 | } 121 | }) 122 | .catch(() => { 123 | console.log( 124 | 'No internet connection found. App is running in offline mode.' 125 | ); 126 | }); 127 | } 128 | 129 | export function unregister() { 130 | if ('serviceWorker' in navigator) { 131 | navigator.serviceWorker.ready.then(registration => { 132 | registration.unregister(); 133 | }); 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /Andricsak/Laborator/Laborator4Azure/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.WindowsAzure.Storage; 3 | using Microsoft.WindowsAzure.Storage.Table; 4 | using System.Threading.Tasks; 5 | 6 | 7 | namespace Andricsak 8 | { 9 | class Program 10 | { 11 | 12 | 13 | static void Main(string[] args) 14 | { 15 | Task.Run( async () => await initialize()).GetAwaiter().GetResult(); 16 | } 17 | 18 | static async Task initialize() 19 | { 20 | CloudStorageAccount storageAccount = new CloudStorageAccount( 21 | new Microsoft.WindowsAzure.Storage.Auth.StorageCredentials(projectName,m_accountKey),true); 22 | 23 | CloudTableClient tableClient = storageAccount.CreateCloudTableClient(); 24 | 25 | CloudTable studentsTable = tableClient.GetTableReference("StudentiAA"); 26 | //await CreatePeopleTableAsync(studentsTable); 27 | 28 | // StudentEntity student = new StudentEntity("UPT-AC", "12345678"); 29 | // //await insertIntoTableAsync(studentsTable,student); 30 | 31 | StudentEntity student1 = new StudentEntity("UPT-AC","2345678"); 32 | student1.Name="Gheorghe"; 33 | //await insertIntoTableAsync(studentsTable,student1); 34 | //await GetSingleEntityAsync(studentsTable); 35 | await GetAllEntitiesAsync(studentsTable); 36 | await UpdateEntityAsync(studentsTable,student1.PartitionKey,student1.RowKey); 37 | await GetAllEntitiesAsync(studentsTable); 38 | //await DeleteEnetityAsync(studentsTable,student1.PartitionKey,student1.RowKey); 39 | 40 | 41 | } 42 | 43 | static async Task insertIntoTableAsync(CloudTable studentsTable,StudentEntity student) 44 | { 45 | // Create the TableOperation that inserts the customer entity. 46 | TableOperation insertOperation = TableOperation.Insert(student); 47 | 48 | // Execute the insert operation. 49 | await studentsTable.ExecuteAsync(insertOperation); 50 | } 51 | static public async Task CreatePeopleTableAsync(CloudTable studentsTable) 52 | { 53 | // Create the CloudTable if it does not exist 54 | await studentsTable.CreateIfNotExistsAsync(); 55 | } 56 | 57 | static async Task GetSingleEntityAsync(CloudTable studentsTable) 58 | { 59 | TableOperation retrieveOperation = TableOperation.Retrieve("UPT-AC","12345678"); 60 | 61 | // Execute the retrieve operation. 62 | TableResult retrievedResult = await studentsTable.ExecuteAsync(retrieveOperation); 63 | 64 | // Print the phone number of the result. 65 | if (retrievedResult.Result != null) 66 | { 67 | Console.WriteLine("Result was not null"); 68 | Console.WriteLine(((StudentEntity)retrievedResult.Result).Name); 69 | } 70 | else 71 | Console.WriteLine("The Name could not be retrieved."); 72 | } 73 | 74 | static async Task GetAllEntitiesAsync(CloudTable studentsTable) 75 | { 76 | TableQuery query = new TableQuery().Where(TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, "UPT-AC")); 77 | 78 | // Print the fields for each customer. 79 | TableContinuationToken token = null; 80 | do 81 | { 82 | TableQuerySegment resultSegment = await studentsTable.ExecuteQuerySegmentedAsync(query, token); 83 | token = resultSegment.ContinuationToken; 84 | 85 | foreach (StudentEntity entity in resultSegment.Results) 86 | { 87 | Console.WriteLine("{0}, {1}\t{2}", entity.PartitionKey, entity.RowKey, 88 | entity.Name); 89 | } 90 | } while (token != null); 91 | } 92 | 93 | static async Task DeleteEnetityAsync(CloudTable studentsTable,string partitionKey,string rowKey) 94 | { 95 | TableOperation retrieveOperation = TableOperation.Retrieve(partitionKey, rowKey); 96 | 97 | // Execute the operation. 98 | TableResult retrievedResult = await studentsTable.ExecuteAsync(retrieveOperation); 99 | 100 | // Assign the result to a CustomerEntity object. 101 | StudentEntity deleteEntity = (StudentEntity)retrievedResult.Result; 102 | 103 | // Create the Delete TableOperation and then execute it. 104 | if (deleteEntity != null) 105 | { 106 | TableOperation deleteOperation = TableOperation.Delete(deleteEntity); 107 | 108 | // Execute the operation. 109 | await studentsTable.ExecuteAsync(deleteOperation); 110 | 111 | Console.WriteLine("Entity deleted."); 112 | } 113 | 114 | else 115 | Console.WriteLine("Couldn't delete the entity."); 116 | } 117 | 118 | 119 | static async Task UpdateEntityAsync(CloudTable studentsTable,string partitionKey,string rowKey) 120 | { 121 | TableOperation retrieveOperation = TableOperation.Retrieve(partitionKey, rowKey); 122 | 123 | // Execute the operation. 124 | TableResult retrievedResult = await studentsTable.ExecuteAsync(retrieveOperation); 125 | 126 | StudentEntity updateEntity = (StudentEntity)retrievedResult.Result; 127 | 128 | updateEntity.Name="NotGheorghe"; 129 | // Create the Delete TableOperation and then execute it. 130 | if (updateEntity != null) 131 | { 132 | TableOperation updateOperation = TableOperation.Merge(updateEntity); 133 | await studentsTable.ExecuteAsync(updateOperation); 134 | 135 | Console.WriteLine("Entity updated"); 136 | } 137 | else{ 138 | Console.WriteLine("Entity not found"); 139 | } 140 | } 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /Andricsak/Proiect/AnimalDanger/react-client/build/static/js/main.767cb65b.chunk.js: -------------------------------------------------------------------------------- 1 | (this["webpackJsonpreact-client"]=this["webpackJsonpreact-client"]||[]).push([[0],{53:function(e,a,t){e.exports=t(91)},59:function(e,a,t){},60:function(e,a,t){},91:function(e,a,t){"use strict";t.r(a);t(54);var n=t(0),l=t.n(n),r=t(24),c=t.n(r),i=(t(59),t(15)),o=t(16),m=t(18),s=t(17),u=t(19),d=t(20),p=t(94),h=t(9),b=t(93),E=t(95),f=t(96),g=t(106),v=t(97),y=t(98),j=t(23),O=(t(60),function(e){function a(e){var t;return Object(i.a)(this,a),(t=Object(m.a)(this,Object(s.a)(a).call(this,e))).toggleNavbar=t.toggleNavbar.bind(Object(h.a)(t)),t.state={collapsed:!0},t}return Object(u.a)(a,e),Object(o.a)(a,[{key:"toggleNavbar",value:function(){this.setState({collapsed:!this.state.collapsed})}},{key:"render",value:function(){return l.a.createElement("header",null,l.a.createElement(b.a,{className:"navbar-expand-sm navbar-toggleable-sm ng-white border-bottom box-shadow mb-3",light:!0},l.a.createElement(p.a,null,l.a.createElement(E.a,{tag:j.b,to:"/"},"Animal danger"),l.a.createElement(f.a,{onClick:this.toggleNavbar,className:"mr-2"}),l.a.createElement(g.a,{className:"d-sm-inline-flex flex-sm-row-reverse",isOpen:!this.state.collapsed,navbar:!0},l.a.createElement("ul",{className:"navbar-nav flex-grow"},l.a.createElement(v.a,null,l.a.createElement(y.a,{tag:j.b,className:"text-dark",to:"/"},"Home")),l.a.createElement(v.a,null,l.a.createElement(y.a,{tag:j.b,className:"text-dark",to:"/AddAnimal"},"Add an Animal")),l.a.createElement(v.a,null,l.a.createElement(y.a,{tag:j.b,className:"text-dark",to:"/ViewAnimals"},"View animals")))))))}}]),a}(n.Component));O.displayName=O.name;var A=function(e){function a(){return Object(i.a)(this,a),Object(m.a)(this,Object(s.a)(a).apply(this,arguments))}return Object(u.a)(a,e),Object(o.a)(a,[{key:"render",value:function(){return l.a.createElement("div",null,l.a.createElement(O,null),l.a.createElement(p.a,null,this.props.children))}}]),a}(n.Component);A.displayName=A.name;var N=function(e){function a(){return Object(i.a)(this,a),Object(m.a)(this,Object(s.a)(a).apply(this,arguments))}return Object(u.a)(a,e),Object(o.a)(a,[{key:"render",value:function(){return l.a.createElement("div",null,l.a.createElement("h1",null,"Welcome to animal danger website!"),l.a.createElement("p",null,"Here you can view if dangerous animals are inside your city!"))}}]),a}(n.Component);N.displayName=N.name;var w=t(99),k=t(100),x=t(101),C=t(102),S=t(103),z=t(104),L=t(51),T=t.n(L),B=function(e){function a(e){var t;return Object(i.a)(this,a),(t=Object(m.a)(this,Object(s.a)(a).call(this,e))).handleChange=t.handleChange.bind(Object(h.a)(t)),t.handleSubmit=t.handleSubmit.bind(Object(h.a)(t)),t}return Object(u.a)(a,e),Object(o.a)(a,[{key:"handleChange",value:function(e){this.setState({value:e.target.value})}},{key:"handleSubmit",value:function(e){var a=e.target,t=new FormData(a),n={};t.forEach((function(e,a){n[a]="name"==a?e:Number(e),console.log(a+": "+e)}));var l=JSON.stringify(n);console.log(l),T()({method:"post",url:"https://animaldangerapi.azurewebsites.net/api/Animal",headers:{"Content-Type":"application/json; charset=utf-8"},data:l}).then((function(e){console.log("The response of the server: "+e.data)})).catch((function(e){console.log(e)})).finally((function(){}))}},{key:"render",value:function(){return l.a.createElement(p.a,{className:"AddAnimal"},l.a.createElement("h2",null,"Add an animal"),l.a.createElement(w.a,{className:"form",onSubmit:this.handleSubmit},l.a.createElement(k.a,null,l.a.createElement(x.a,null,l.a.createElement(C.a,null,"Animal id"),l.a.createElement(S.a,{type:"number",name:"id",id:"animalId",placeholder:"1"}))),l.a.createElement(k.a,null,l.a.createElement(x.a,null,l.a.createElement(C.a,null,"Latitude"),l.a.createElement(S.a,{type:"number",name:"lat",placeholder:"latitude...",step:"any"}))),l.a.createElement(k.a,null,l.a.createElement(x.a,null,l.a.createElement(C.a,null,"Longitude"),l.a.createElement(S.a,{type:"number",name:"long",placeholder:"longitutde...",step:"any"}))),l.a.createElement(k.a,null,l.a.createElement(x.a,null,l.a.createElement(C.a,{for:"AnimalName"},"Animal name"),l.a.createElement(S.a,{type:"text",name:"name",id:"animalName",placeholder:"Animal name"}))),l.a.createElement(k.a,null,l.a.createElement(x.a,null,l.a.createElement(C.a,{for:"AnimalType"},"Animal type"),l.a.createElement(S.a,{type:"select",name:"type",id:"animalType"},l.a.createElement("option",{value:"0"},"Bear"),l.a.createElement("option",{value:"1"},"Fox"),l.a.createElement("option",{value:"2"},"Wolf")))),l.a.createElement(z.a,null,"Submit")))}}]),a}(l.a.Component),D=t(34),W=t.n(D),I=t(52),J=t(107),V=t(108),F=t(105),H=t(109),K=function(e){function a(e){var t;return Object(i.a)(this,a),(t=Object(m.a)(this,Object(s.a)(a).call(this,e))).state={animalList:[],loading:!0,zoom:13},t}return Object(u.a)(a,e),Object(o.a)(a,[{key:"componentDidMount",value:function(){this.populateAnimalData()}},{key:"populateAnimalData",value:function(){var e=Object(I.a)(W.a.mark((function e(){var a,t;return W.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("https://animaldangerapi.azurewebsites.net/api/Animal");case 2:return a=e.sent,e.next=5,a.json();case 5:t=e.sent,console.log(t),this.setState({animalList:t,loading:!1});case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){return console.log(this.state.animalList),l.a.createElement(J.a,{center:[45.748871,21.208679],zoom:this.state.zoom,style:{height:"88vh"}},l.a.createElement(V.a,{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),this.state.animalList.map((function(e){return l.a.createElement(F.a,{position:[e.lat,e.long],key:e.id},l.a.createElement(H.a,null,"Id: ",e.id," ",l.a.createElement("br",null)," Name: ",e.name,", Type: ",e.partitionKey))})))}}]),a}(n.Component),M=function(e){function a(){return Object(i.a)(this,a),Object(m.a)(this,Object(s.a)(a).apply(this,arguments))}return Object(u.a)(a,e),Object(o.a)(a,[{key:"render",value:function(){return l.a.createElement(A,null,l.a.createElement(d.a,{exact:!0,path:"/",component:N}),l.a.createElement(d.a,{path:"/AddAnimal",component:B}),l.a.createElement(d.a,{path:"/ViewAnimals",component:K}))}}]),a}(l.a.Component);M.displayName=M.name;Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));var $=document.getElementsByTagName("base")[0].getAttribute("href"),q=document.getElementById("root");c.a.render(l.a.createElement(j.a,{basename:$},l.a.createElement(M,null)),q),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()}))}},[[53,1,2]]]); 2 | //# sourceMappingURL=main.767cb65b.chunk.js.map --------------------------------------------------------------------------------