Update 07082021

This commit is contained in:
2021-08-07 09:44:37 +02:00
parent 1ff218a129
commit 4d443fdfd4
5663 changed files with 6581858 additions and 1321 deletions

View File

@@ -1,39 +1,108 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using BWPMModels;
using BlazorApp.Helper;
using Newtonsoft.Json;
using System.Data;
using Microsoft.AspNetCore.Mvc;
namespace BlazorApp.Controller
{
public class AspNetRolesController
public class AspNetRolesController : ControllerBase
{
public static List<AspNetRoles> GetAllData()
{
Helper.HttpClientHelper httpcli = new Helper.HttpClientHelper();
httpcli.CallService("AspNetRoles", "", "GET", null);
return JsonConvert.DeserializeObject<List<AspNetRoles>>(httpcli.Results.daten);
dbhelper dbh = new dbhelper();
dbh.Get_Tabledata("Select * from AspNetRoles", false, true);
return dbh.ConvertDataTable<AspNetRoles>(dbh.dsdaten.Tables[0]);
}
public static void savedata(BWPMModels.AspNetRoles AspNetRolesdata)
public static List<AspNetRoles> GetByID(int ID)
{
Helper.HttpClientHelper httpcli = new Helper.HttpClientHelper();
httpcli.CallService("AspNetRoles", AspNetRolesdata.Id.ToString(), "PUT", AspNetRolesdata);
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 int InsertData(BWPMModels.AspNetRoles AspNetRolesdata)
public static List<AspNetRoles> GetLast()
{
Helper.HttpClientHelper httpcli = new Helper.HttpClientHelper();
httpcli.CallService("AspNetRoles", "", "POST", AspNetRolesdata);
List<BWPMModels.AspNetRoles> LastAspNetRoles = new List<BWPMModels.AspNetRoles>();
return 0;
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);
}
}
}
}