update nach Schuelererfassung

This commit is contained in:
2021-08-10 16:53:27 +02:00
parent 595cd0edea
commit e16ec943e1
1318 changed files with 1538825 additions and 389 deletions

View File

@@ -0,0 +1,108 @@
using System;
using System.Collections.Generic;
using System.Linq;
using BWPMModels;
using BlazorApp.Helper;
using Newtonsoft.Json;
using System.Data;
using Microsoft.AspNetCore.Mvc;
namespace BlazorApp.Controller
{
public class AspNetRolesController : ControllerBase
{
public static List<AspNetRoles> GetAllData()
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabledata("Select * from AspNetRoles", false, true);
return dbh.ConvertDataTable<AspNetRoles>(dbh.dsdaten.Tables[0]);
}
public static List<AspNetRoles> GetByID(int ID)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabledata("Select * from AspNetRoles where id=" + ID.ToString(), false, true);
return dbh.ConvertDataTable<AspNetRoles>(dbh.dsdaten.Tables[0]);
}
public static List<AspNetRoles> GetLast()
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabledata("Select top 1 * from AspNetRoles order by mutiert_am desc", false, true);
return dbh.ConvertDataTable<AspNetRoles>(dbh.dsdaten.Tables[0]);
}
public static List<AspNetRoles> GetLastByMutierer(string Mutierer)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabledata("Select top 1 * from AspNetRoles where mutierer='" + Mutierer + "' order by mutiert_am desc", false, true);
return dbh.ConvertDataTable<AspNetRoles>(dbh.dsdaten.Tables[0]);
}
public static List<AspNetRoles> GetbyUserSQL(string SQL)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabledata(SQL, false, true);
return dbh.ConvertDataTable<AspNetRoles>(dbh.dsdaten.Tables[0]);
}
public static void POST(AspNetRoles AspNetRolesdata)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabeldata_for_Update("Select top 1 * from [AspNetRoles] where id=-1", false, true);
DataRow dr = dbh.dsdaten.Tables[0].NewRow();
AspNetRolesdata.GetType().GetProperties().ToList().ForEach(f =>
{
try
{
if (f.PropertyType == typeof(DateTime))
{
dr[f.Name] = (DateTime)f.GetValue(AspNetRolesdata, null);
}
else
{
dr[f.Name] = f.GetValue(AspNetRolesdata, null);
}
}
catch (Exception ex) { string s = ex.Message; }
});
dbh.dsdaten.Tables[0].Rows.Add(dr);
dbh.Update_Tabeldata();
}
public static void PUT(AspNetRoles AspNetRolesdata)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabeldata_for_Update("Select top 1 * from [AspNetRoles] where id=" + AspNetRolesdata.Id.ToString(), false, true);
DataRow dr = dbh.dsdaten.Tables[0].Rows[0];
AspNetRolesdata.GetType().GetProperties().ToList().ForEach(f =>
{
try
{
if (f.PropertyType == typeof(DateTime))
{
dr[f.Name] = (DateTime)f.GetValue(AspNetRolesdata, null);
}
else
{
dr[f.Name] = f.GetValue(AspNetRolesdata, null);
}
}
catch (Exception ex) { string s = ex.Message; }
});
dbh.Update_Tabeldata();
}
public static void DELETE(AspNetRoles AspNetRolesdata)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabeldata_for_Update("delete from [AspNetRoles] where id=" + AspNetRolesdata.Id.ToString(), false, true);
}
}
}

View File

@@ -0,0 +1,108 @@
using System;
using System.Collections.Generic;
using System.Linq;
using BWPMModels;
using BlazorApp.Helper;
using Newtonsoft.Json;
using System.Data;
using Microsoft.AspNetCore.Mvc;
namespace BlazorApp.Controller
{
public class AspNetUserRolesController : ControllerBase
{
public static List<AspNetUserRoles> GetAllData()
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabledata("Select * from AspNetUserRoles", false, true);
return dbh.ConvertDataTable<AspNetUserRoles>(dbh.dsdaten.Tables[0]);
}
public static List<AspNetUserRoles> GetByID(int ID)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabledata("Select * from AspNetUserRoles where id=" + ID.ToString(), false, true);
return dbh.ConvertDataTable<AspNetUserRoles>(dbh.dsdaten.Tables[0]);
}
public static List<AspNetUserRoles> GetLast()
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabledata("Select top 1 * from AspNetUserRoles order by mutiert_am desc", false, true);
return dbh.ConvertDataTable<AspNetUserRoles>(dbh.dsdaten.Tables[0]);
}
public static List<AspNetUserRoles> GetLastByMutierer(string Mutierer)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabledata("Select top 1 * from AspNetUserRoles where mutierer='" + Mutierer + "' order by mutiert_am desc", false, true);
return dbh.ConvertDataTable<AspNetUserRoles>(dbh.dsdaten.Tables[0]);
}
public static List<AspNetUserRoles> GetbyUserSQL(string SQL)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabledata(SQL, false, true);
return dbh.ConvertDataTable<AspNetUserRoles>(dbh.dsdaten.Tables[0]);
}
public static void POST(AspNetUserRoles AspNetUserRolesdata)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabeldata_for_Update("Select top 1 * from [AspNetUserRoles] where id=-1", false, true);
DataRow dr = dbh.dsdaten.Tables[0].NewRow();
AspNetUserRolesdata.GetType().GetProperties().ToList().ForEach(f =>
{
try
{
if (f.PropertyType == typeof(DateTime))
{
dr[f.Name] = (DateTime)f.GetValue(AspNetUserRolesdata, null);
}
else
{
dr[f.Name] = f.GetValue(AspNetUserRolesdata, null);
}
}
catch (Exception ex) { string s = ex.Message; }
});
dbh.dsdaten.Tables[0].Rows.Add(dr);
dbh.Update_Tabeldata();
}
public static void PUT(AspNetUserRoles AspNetUserRolesdata)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabeldata_for_Update("Select top 1 * from [AspNetUserRoles] where userid='" + AspNetUserRolesdata.UserId.ToString()+"'", false, true);
DataRow dr = dbh.dsdaten.Tables[0].Rows[0];
AspNetUserRolesdata.GetType().GetProperties().ToList().ForEach(f =>
{
try
{
if (f.PropertyType == typeof(DateTime))
{
dr[f.Name] = (DateTime)f.GetValue(AspNetUserRolesdata, null);
}
else
{
dr[f.Name] = f.GetValue(AspNetUserRolesdata, null);
}
}
catch (Exception ex) { string s = ex.Message; }
});
dbh.Update_Tabeldata();
}
public static void DELETE(AspNetUserRoles AspNetUserRolesdata)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabeldata_for_Update("delete from [AspNetUserRoles] where id=" + AspNetUserRolesdata.UserId.ToString(), false, true);
}
}
}

View File

@@ -0,0 +1,121 @@
using System;
using System.Collections.Generic;
using System.Linq;
using BWPMModels;
using BlazorApp.Helper;
using Newtonsoft.Json;
using System.Data;
using Microsoft.AspNetCore.Mvc;
namespace BlazorApp.Controller
{
public class AspNetUserRolleController : ControllerBase
{
public static List<AspNetUserRolle> GetAllData()
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabledata("Select * from AspNetUserRolle", false, true);
return dbh.ConvertDataTable<AspNetUserRolle>(dbh.dsdaten.Tables[0]);
}
public static List<AspNetUserRolle> GetByID(int ID)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabledata("Select * from AspNetUserRolle where id=" + ID.ToString(), false, true);
return dbh.ConvertDataTable<AspNetUserRolle>(dbh.dsdaten.Tables[0]);
}
public static List<AspNetUserRolle> GetLast()
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabledata("Select top 1 * from AspNetUserRolle order by mutiert_am desc", false, true);
return dbh.ConvertDataTable<AspNetUserRolle>(dbh.dsdaten.Tables[0]);
}
public static List<AspNetUserRolle> GetLastByMutierer(string Mutierer)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabledata("Select top 1 * from AspNetUserRolle where mutierer='" + Mutierer + "' order by mutiert_am desc", false, true);
return dbh.ConvertDataTable<AspNetUserRolle>(dbh.dsdaten.Tables[0]);
}
public static List<AspNetUserRolle> GetbyUserSQL(string SQL)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabledata(SQL, false, true);
return dbh.ConvertDataTable<AspNetUserRolle>(dbh.dsdaten.Tables[0]);
}
public static void POST(AspNetUserRolle AspNetUserRolledata)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabeldata_for_Update("Select top 1 * from [AspNetUserRolle] where id=-1", false, true);
DataRow dr = dbh.dsdaten.Tables[0].NewRow();
AspNetUserRolledata.GetType().GetProperties().ToList().ForEach(f =>
{
try
{
if (f.PropertyType == typeof(DateTime))
{
dr[f.Name] = (DateTime)f.GetValue(AspNetUserRolledata, null);
}
else
{
dr[f.Name] = f.GetValue(AspNetUserRolledata, null);
}
}
catch (Exception ex) { string s = ex.Message; }
});
dbh.dsdaten.Tables[0].Rows.Add(dr);
dbh.Update_Tabeldata();
}
public static void PUT(AspNetUserRolle AspNetUserRolledata)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabeldata_for_Update("Select top 1 * from [AspNetUserRolle] where id=" + AspNetUserRolledata.Id.ToString(), false, true);
DataRow dr = dbh.dsdaten.Tables[0].Rows[0];
AspNetUserRolledata.GetType().GetProperties().ToList().ForEach(f =>
{
try
{
if (f.PropertyType == typeof(DateTime))
{
dr[f.Name] = (DateTime)f.GetValue(AspNetUserRolledata, null);
}
else
{
dr[f.Name] = f.GetValue(AspNetUserRolledata, null);
}
}
catch (Exception ex) { string s = ex.Message; }
});
dbh.Update_Tabeldata();
}
public static void PUTPassword(AspNetUsers aspNetUser)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabeldata_for_Update("Select top 1 * from [AspNetUsers] where id='" +aspNetUser.Id + "'", false, true);
DataRow dr = dbh.dsdaten.Tables[0].Rows[0];
dr["PasswordHash"] = aspNetUser.PasswordHash;
dbh.Update_Tabeldata();
}
public static void DELETE(AspNetUserRolle AspNetUserRolledata)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabeldata_for_Update("delete from [AspNetUserRolle] where id=" + AspNetUserRolledata.Id.ToString(), false, true);
}
}
}

View File

@@ -0,0 +1,109 @@
using System;
using System.Collections.Generic;
using System.Linq;
using BWPMModels;
using BlazorApp.Helper;
using Newtonsoft.Json;
using System.Data;
using Microsoft.AspNetCore.Mvc;
namespace BlazorApp.Controller
{
public class AspNetUsersController : ControllerBase
{
public static List<AspNetUsers> GetAllData()
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabledata("Select * from AspNetUsers", false, true);
return dbh.ConvertDataTable<AspNetUsers>(dbh.dsdaten.Tables[0]);
}
public static List<AspNetUsers> GetByID(int ID)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabledata("Select * from AspNetUsers where id=" + ID.ToString(), false, true);
return dbh.ConvertDataTable<AspNetUsers>(dbh.dsdaten.Tables[0]);
}
public static List<AspNetUsers> GetLast()
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabledata("Select top 1 * from AspNetUsers order by mutiert_am desc", false, true);
return dbh.ConvertDataTable<AspNetUsers>(dbh.dsdaten.Tables[0]);
}
public static List<AspNetUsers> GetLastByMutierer(string Mutierer)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabledata("Select top 1 * from AspNetUsers where mutierer='" + Mutierer + "' order by mutiert_am desc", false, true);
return dbh.ConvertDataTable<AspNetUsers>(dbh.dsdaten.Tables[0]);
}
public static List<AspNetUsers> GetbyUserSQL(string SQL)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabledata(SQL, false, true);
return dbh.ConvertDataTable<AspNetUsers>(dbh.dsdaten.Tables[0]);
}
public static void POST(AspNetUsers AspNetUsersdata)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabeldata_for_Update("Select top 1 * from [AspNetUsers] where id=-1", false, true);
DataRow dr = dbh.dsdaten.Tables[0].NewRow();
AspNetUsersdata.GetType().GetProperties().ToList().ForEach(f =>
{
try
{
if (f.PropertyType == typeof(DateTime))
{
dr[f.Name] = (DateTime)f.GetValue(AspNetUsersdata, null);
}
else
{
dr[f.Name] = f.GetValue(AspNetUsersdata, null);
}
}
catch (Exception ex) { string s = ex.Message; }
});
dbh.dsdaten.Tables[0].Rows.Add(dr);
dbh.Update_Tabeldata();
}
public static void PUT(AspNetUsers AspNetUsersdata)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabeldata_for_Update("Select top 1 * from [AspNetUsers] where id=" + AspNetUsersdata.Id.ToString(), false, true);
DataRow dr = dbh.dsdaten.Tables[0].Rows[0];
AspNetUsersdata.GetType().GetProperties().ToList().ForEach(f =>
{
try
{
if (f.PropertyType == typeof(DateTime))
{
dr[f.Name] = (DateTime)f.GetValue(AspNetUsersdata, null);
}
else
{
dr[f.Name] = f.GetValue(AspNetUsersdata, null);
}
}
catch (Exception ex) { string s = ex.Message; }
});
dbh.Update_Tabeldata();
}
public static void DELETE(AspNetUsers AspNetUsersdata)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabeldata_for_Update("delete from [AspNetUsers] where id=" + AspNetUsersdata.Id.ToString(), false, true);
}
}
}