Update vor Clone

This commit is contained in:
2021-12-18 11:01:04 +01:00
parent 70148e63ce
commit c05d1ac4e2
612 changed files with 72932 additions and 2064 deletions

View File

@@ -26,6 +26,13 @@ namespace BlazorApp.Controller
dbh.Get_Tabledata("Select * from AspNetRoles where id=" + ID.ToString(), false, true);
return dbh.ConvertDataTable<AspNetRoles>(dbh.dsdaten.Tables[0]);
}
public static List<AspNetRoles> GetByName(string Name)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabledata("Select * from AspNetRoles where name='"+Name+"'", false, true);
return dbh.ConvertDataTable<AspNetRoles>(dbh.dsdaten.Tables[0]);
}
public static List<AspNetRoles> GetLast()
{

View File

@@ -50,7 +50,7 @@ namespace BlazorApp.Controller
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);
dbh.Get_Tabeldata_for_Update("Select top 1 * from [AspNetUserRoles] where userid='-1'", false, true);
DataRow dr = dbh.dsdaten.Tables[0].NewRow();
AspNetUserRolesdata.GetType().GetProperties().ToList().ForEach(f =>
{

View File

@@ -27,6 +27,18 @@ namespace BlazorApp.Controller
return dbh.ConvertDataTable<AspNetUsers>(dbh.dsdaten.Tables[0]);
}
public static List<AspNetUsers> GetByUserName(string UserName)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabledata("Select * from AspNetUsers where UserName='" + UserName+"'", false, true);
return dbh.ConvertDataTable<AspNetUsers>(dbh.dsdaten.Tables[0]);
}
public static List<AspNetUsers> GetByEMail(string EMail)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabledata("Select * from AspNetUsers where EMail='" + EMail + "'", false, true);
return dbh.ConvertDataTable<AspNetUsers>(dbh.dsdaten.Tables[0]);
}
public static List<AspNetUsers> GetLast()
{
dbhelper dbh = new dbhelper();
@@ -50,7 +62,7 @@ namespace BlazorApp.Controller
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);
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 =>
{
@@ -59,7 +71,6 @@ namespace BlazorApp.Controller
if (f.PropertyType == typeof(DateTime))
{
dr[f.Name] = (DateTime)f.GetValue(AspNetUsersdata, null);
}
else
{
@@ -68,6 +79,7 @@ namespace BlazorApp.Controller
}
catch (Exception ex) { string s = ex.Message; }
});
dbh.dsdaten.Tables[0].Rows.Add(dr);
dbh.Update_Tabeldata();

View File

@@ -30,7 +30,7 @@ namespace BlazorApp.Controller
public static List<SchuelerBeruf> GetBySchuelerID(int ID)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabledata("Select * from SchuelerBeruf where aktiv=1 and schuelerid=" + ID.ToString(), false, true);
dbh.Get_Tabledata("Select * from SchuelerBeruf where aktiv=1 and schuelerid=" + ID.ToString()+" order by prioritaet asc", false, true);
return dbh.ConvertDataTable<SchuelerBeruf>(dbh.dsdaten.Tables[0]);
}
public static List<SchuelerBeruf> GetLast()

View File

@@ -20,13 +20,25 @@ namespace BlazorApp.Controller
return dbh.ConvertDataTable<Lehrer>(dbh.dsdaten.Tables[0]);
}
public static List<Lehrer> GetAllActiveData()
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabledata("Select * from Lehrer where aktiv=1", false, true);
return dbh.ConvertDataTable<Lehrer>(dbh.dsdaten.Tables[0]);
}
public static List<Lehrer> GetByID(int ID)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabledata("Select * from Lehrer where id=" + ID.ToString(), false, true);
return dbh.ConvertDataTable<Lehrer>(dbh.dsdaten.Tables[0]);
}
public static List<Lehrer> GetByEMail(string EMail)
{
dbhelper dbh = new dbhelper();
dbh.Get_Tabledata("Select * from Lehrer where aktiv=1 and EMail='" + EMail+"'", false, true);
return dbh.ConvertDataTable<Lehrer>(dbh.dsdaten.Tables[0]);
}
public static List<Lehrer> GetByUserID(string UserID)
{
dbhelper dbh = new dbhelper();

View File

@@ -19,6 +19,16 @@ namespace BlazorApp.Controller
}
public static List<User> GetByEmail()
{
Helper.HttpClientHelper httpcli = new Helper.HttpClientHelper();
httpcli.CallService("user", "", "GET", null);
return JsonConvert.DeserializeObject<List<User>>(httpcli.Results.daten);
}
public static void savedata( User userdata)
{
Helper.HttpClientHelper httpcli = new Helper.HttpClientHelper();
@@ -26,7 +36,13 @@ namespace BlazorApp.Controller
}
public static void Insertdata(User userdata)
{
Helper.HttpClientHelper httpcli = new Helper.HttpClientHelper();
httpcli.CallService("user", userdata.ID.ToString(), "POST", userdata);
}
}
}