fixingthisshit

This commit is contained in:
Lendaia Mirai
2026-01-08 01:22:28 +01:00
parent d82decbfa2
commit 04fc53bbc7
15 changed files with 2 additions and 1037 deletions

View File

@@ -7,10 +7,4 @@
<RootNamespace>OE.ALGA</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.10" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
</ItemGroup>
</Project>

View File

@@ -1,5 +1,4 @@
using System;
using System.Drawing;
namespace OE.ALGA;

View File

@@ -1,11 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System;
using System.Collections.Generic;
using static System.Net.Mime.MediaTypeNames;
namespace OE.ALGA.Adatszerkezetek
{

View File

@@ -1,6 +1,5 @@
using System;
using System.Data.Common;
using Newtonsoft.Json.Converters;
namespace OE.ALGA.Adatszerkezetek
{

View File

@@ -1,89 +0,0 @@
using System;
using System.Collections.Generic;
namespace OE.ALGA;
public static class Class1
{
public static void Cheatsheet()
{
//deklaráció
int asd;
//értékadás
asd = 2;
//egyben
int lol = 2;
//adat típusok
int egesz = 1;
double tort = 2.2;
string szoveg = "gooning";
bool eldontendo = true;
int[] tomb; //ez egy int típusú tömb de lehet bármi
tomb = [1, 2, 3];
List<int> lista = new List<int>(); // ez egy int típusú lista de lehet bármi
lista.Add(1); // listához így tudsz új elemet adni
// side note, a lista egy dinamikus tömbb, érettségin azt használd
//kapuk
if (eldontendo)
{
//ha az állítás igaz ez történik.. pl
egesz++;
}
else if (egesz == 1)
{
//ha az előző nem teljesül megnézzük ezt. Ha ez teljesül akkor pl
lista.Add(5);
}
else
{
//bármilyen más esetben ez teljesül pl
Console.WriteLine("Send nudes"); //képernyőre kiírás
string user = Console.ReadLine(); // képernyőről beolvasás. Ez mindog string lesz szóval sztringbe tudod elmenteni
}
switch (lol) // a megadott változót vizsgáljuk
{
case (2): //ha ez az érték kettő akkor pl
int elem = tomb[1]; // a tömb második elemét kimentjük egy azonos típusú változóba
break;
case (3):
Random rnd = new Random(); // random szám generátor létrehozása
int randomnumber = rnd.Next(10); //új random szám generálása az end generátoron keresztül
break;
}
//loopok
for (int i = 0; i < 3; i++) //az i létrehozott intet egyesével növeljük amíg el nem éri a hármat
{
Console.WriteLine(tomb[i]);
// ez azt jelenti hogy az i először nulla lesz, ez kissebb mint három így belép a kódblokkba és végrehajtja azt. tehát kiírja a tömb i-edik azaz először
//nulladik elemét. Majd hozzáad az ihez egyet. Így az i = 1. Még ez is kissebb mint 3 ezért ismét belép. És így tovább.
}
foreach (int i in lista) // ezt csak tömbök vagy listák bejárására használjuk
{
//fontos hogy a meghatározott elem típúsa azonos egyen a lista vagy tömb típúsával. A foreach egyesével minden elemmet egyenlővé tesz az i vel
// és be fog lépni a kódblokkba
if (i == 2) //tehát itt az i először egyenlő a listánk első elemével.
{
eldontendo = false;
}
}
while (eldontendo) //ez azt jelenti hogy amíg a zárójelben lévő kijelentés teljesül
{
//addig belép az alábbi kódblokkba
// figyelj hogy csak olyan dolgot írj a zárójelbe ami változik mert különben örökké a ciklusba maradunk muhaha
int[] xd = new int[5]; //létrehozunk egy 5 elem hosszú tömböt
int hovarakjuk = Convert.ToInt16(Console.ReadLine()); //a Convert beépített metódust tudod használni a típúsok megváltoztatására
// a zárójelben lévő elemet itt inté alakítjuk. De ez lehet .ToString vagy ToBool vagy bármi egyéb logikus lépés
if (hovarakjuk < xd.Length) // a .Lenghtet tömbök hosszának meghatározására tudod használni
{
xd[hovarakjuk] = 1; // itt az xd tömbünk "hovarakjuk"adik elemét egyenlővé tesszük 1el
}
}
}
}

View File

@@ -1,57 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json;
namespace OE.ALGA;
public class Employee
{
int Id { get; set; }
string Name { get; set; }
string Position { get; set; }
List<Project> Projects { get; set; } = new List<Project>();
}
public class Project
{
int Id { get; set; }
string ProjectName { get; set; }
DateOnly StartDate { get; set; }
DateOnly EndDate { get; set; }
List<Task> Tasks { get; set; } = new List<Task>();
}
public class Task
{
int Id { get; set; }
string TaskName { get; set; }
int HoursSpent { get; set; }
}
public class Workers : DbContext
{
public DbSet<Employee> Employees { get; set; }
public DbSet<Project> Projects { get; set; }
public DbSet<Task> Tasks { get; set; }
public Workers()
{
Database.EnsureDeleted();
Database.EnsureCreated();
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlServer(@"Data Source=(LocalDB)\MSSQLLocalDB;Initial Catalog=workerdb;Integrated Security=True;MultipleActiveResultSets=true");
base.OnConfiguring(optionsBuilder);
}
}
public class Launch
{
static void ThatsAMain()
{
string json = File.ReadAllText("/home/mirai/alga/ALGA/workers.json");
List<Employee> employees = JsonConvert.DeserializeObject<List<Employee>>(json);
Workers context = new Workers();
context.Employees.AddRange(employees);
context.SaveChanges();
}
}

View File

@@ -1,7 +1,5 @@
using System;
using System.ComponentModel;
using System.Linq;
using System.Runtime.InteropServices;
namespace OE.ALGA.Optimalizalas
{

View File

@@ -1,7 +1,5 @@
using System;
using System.Globalization;
using System.Linq;
using System.Runtime.InteropServices;
namespace OE.ALGA.Optimalizalas
{

View File

@@ -1,7 +1,4 @@
using System;
using System.Formats.Asn1;
using System.Linq;
using Microsoft.Identity.Client;
namespace OE.ALGA.Optimalizalas
{

View File

@@ -1,102 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
namespace OE.ALGA;
public class Product
{
[Validation(AttributeValidation.NotEmpty)]
public string Name { get; }
[Validation(AttributeValidation.PositiveNumber)]
public decimal Price { get; }
[Validation(AttributeValidation.NonNegative)]
public int Quantity { get; }
[Validation(AttributeValidation.FutureDate)]
public DateTime? Experiation { get; }
public Product(string name, decimal price, int quantity, DateTime? experiarion)
{
Name = name;
Price = price;
Quantity = quantity;
Experiation = experiarion;
}
}
public enum AttributeValidation
{
NotEmpty,
PositiveNumber,
NonNegative,
FutureDate
}
public class ValidationAttribute : Attribute
{
public AttributeValidation Rule { get; }
public ValidationAttribute(AttributeValidation rule)
{
Rule = rule;
}
}
public static class Validator
{
public static void Validate(Product product)
{
bool flag = false;
var t = product.GetType();
foreach (var p in t.GetProperties())
{
var value = p.GetValue(product);
switch (p.GetCustomAttribute<ValidationAttribute>().Rule)
{
case AttributeValidation.NotEmpty:
if (Convert.ToString(value) == "")
{
flag = true;
}
break;
case AttributeValidation.PositiveNumber:
if (Convert.ToInt32(value) <= 0)
{
flag = true;
}
break;
case AttributeValidation.NonNegative:
if (Convert.ToInt32(value) < 0)
{
flag = true;
}
break;
case AttributeValidation.FutureDate:
if (Convert.ToDateTime(value) < DateTime.Now)
{
flag = true;
}
break;
}
}
if (flag)
{
throw new WrongProductException();
}
else
{
Console.WriteLine("Product added successfuly");
}
}
}
public class WrongProductException : Exception
{
}

View File

@@ -1,470 +0,0 @@
[
{
"name": "Kiss Péter",
"position": "Fejlesztő",
"projects": [
{
"projectName": "Webalkalmazás fejlesztés",
"startDate": "2023-01-15",
"endDate": "2023-03-20",
"tasks": [
{ "taskName": "Front-end implementáció", "hoursSpent": 40 },
{ "taskName": "Back-end implementáció", "hoursSpent": 60 }
]
},
{
"projectName": "Mobilalkalmazás fejlesztés",
"startDate": "2023-04-10",
"endDate": "2023-06-30",
"tasks": [
{ "taskName": "UI tervezés", "hoursSpent": 20 },
{ "taskName": "API integráció", "hoursSpent": 50 }
]
}
]
},
{
"name": "Nagy Anna",
"position": "Projektmenedzser",
"projects": [
{
"projectName": "Szoftver tesztelés",
"startDate": "2023-02-01",
"endDate": "2023-03-10",
"tasks": [
{ "taskName": "Tesztelési terv készítése", "hoursSpent": 15 },
{ "taskName": "Automatizált tesztek", "hoursSpent": 45 }
]
}
]
},
{
"name": "Szabó László",
"position": "Elemző",
"projects": [
{
"projectName": "Adatgyűjtés",
"startDate": "2023-01-20",
"endDate": "2023-04-05",
"tasks": [
{ "taskName": "Adattisztítás", "hoursSpent": 30 },
{ "taskName": "Adatvizualizáció", "hoursSpent": 25 }
]
}
]
},
{
"name": "Horváth Emese",
"position": "Marketing szakértő",
"projects": [
{
"projectName": "Kampánytervezés",
"startDate": "2023-03-01",
"endDate": "2023-05-15",
"tasks": [
{ "taskName": "Célcsoport elemzés", "hoursSpent": 10 },
{ "taskName": "Kampány kivitelezés", "hoursSpent": 35 }
]
}
]
},
{
"name": "Molnár Zoltán",
"position": "Backend fejlesztő",
"projects": [
{
"projectName": "Adatbázis optimalizáció",
"startDate": "2023-02-10",
"endDate": "2023-03-30",
"tasks": [
{ "taskName": "Lekérdezések optimalizálása", "hoursSpent": 25 },
{ "taskName": "Indexek készítése", "hoursSpent": 20 }
]
}
]
},
{
"name": "Kovács Gábor",
"position": "Frontend fejlesztő",
"projects": [
{
"projectName": "UI fejlesztés",
"startDate": "2023-01-05",
"endDate": "2023-02-15",
"tasks": [
{ "taskName": "HTML/CSS fejlesztés", "hoursSpent": 35 },
{ "taskName": "JavaScript implementáció", "hoursSpent": 30 }
]
}
]
},
{
"name": "Tóth Erika",
"position": "Tesztmérnök",
"projects": [
{
"projectName": "Szoftver minőségbiztosítás",
"startDate": "2023-04-01",
"endDate": "2023-06-01",
"tasks": [
{ "taskName": "Tesztelés", "hoursSpent": 50 },
{ "taskName": "Hibajavítás", "hoursSpent": 20 }
]
}
]
},
{
"name": "Varga András",
"position": "Projektmenedzser",
"projects": [
{
"projectName": "Agilis fejlesztés",
"startDate": "2023-01-15",
"endDate": "2023-04-20",
"tasks": [
{ "taskName": "Csapat koordinálás", "hoursSpent": 30 },
{ "taskName": "Időterv készítés", "hoursSpent": 25 }
]
}
]
},
{
"name": "Bognár Rita",
"position": "Adatbányász",
"projects": [
{
"projectName": "Piackutatás",
"startDate": "2023-03-10",
"endDate": "2023-05-20",
"tasks": [
{ "taskName": "Adatgyűjtés", "hoursSpent": 40 },
{ "taskName": "Elemzés", "hoursSpent": 30 }
]
}
]
},
{
"name": "Szilágyi Tamás",
"position": "DevOps mérnök",
"projects": [
{
"projectName": "Infrastruktúra automatizálás",
"startDate": "2023-02-15",
"endDate": "2023-03-30",
"tasks": [
{ "taskName": "CI/CD pipeline fejlesztés", "hoursSpent": 60 },
{ "taskName": "Deploy folyamatok optimalizálása", "hoursSpent": 30 }
]
}
]
},
{
"name": "Kiss Júlia",
"position": "Szoftverfejlesztő",
"projects": [
{
"projectName": "E-kereskedelmi platform fejlesztés",
"startDate": "2023-01-25",
"endDate": "2023-04-15",
"tasks": [
{ "taskName": "Backend logika", "hoursSpent": 45 },
{ "taskName": "Frontend integráció", "hoursSpent": 35 }
]
}
]
},
{
"name": "Tóth László",
"position": "Full Stack fejlesztő",
"projects": [
{
"projectName": "Mobilalkalmazás UI/UX fejlesztés",
"startDate": "2023-02-01",
"endDate": "2023-05-01",
"tasks": [
{ "taskName": "UI tervezés", "hoursSpent": 40 },
{ "taskName": "Backend integráció", "hoursSpent": 50 }
]
}
]
},
{
"name": "Farkas János",
"position": "Adatbiztonsági szakértő",
"projects": [
{
"projectName": "Biztonsági audit",
"startDate": "2023-03-05",
"endDate": "2023-06-10",
"tasks": [
{ "taskName": "Sebezhetőségek felderítése", "hoursSpent": 20 },
{ "taskName": "Javítási javaslatok", "hoursSpent": 30 }
]
}
]
},
{
"name": "Nagy Attila",
"position": "Tesztelő",
"projects": [
{
"projectName": "Mobilalkalmazás tesztelés",
"startDate": "2023-01-20",
"endDate": "2023-02-25",
"tasks": [
{ "taskName": "Automatizált tesztelés", "hoursSpent": 25 },
{ "taskName": "Kézi tesztelés", "hoursSpent": 40 }
]
}
]
},
{
"name": "Kovács Róbert",
"position": "Üzleti elemző",
"projects": [
{
"projectName": "Folyamat elemzés",
"startDate": "2023-01-10",
"endDate": "2023-04-10",
"tasks": [
{ "taskName": "Folyamat elemzése", "hoursSpent": 30 },
{ "taskName": "Dokumentáció", "hoursSpent": 15 }
]
}
]
}
]