You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.7 KiB
47 lines
1.7 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using BWPMModels;
|
|
using BlazorApp.Helper;
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
namespace BlazorApp.Controller
|
|
{
|
|
public class SchulhausController
|
|
{
|
|
public static List<Schulhaus> GetAllData()
|
|
{
|
|
Helper.HttpClientHelper httpcli = new Helper.HttpClientHelper();
|
|
httpcli.CallService("Schulhaus", "", "GET", null);
|
|
return JsonConvert.DeserializeObject<List<Schulhaus>>(httpcli.Results.daten);
|
|
|
|
}
|
|
|
|
public static void savedata(Schulhaus Schulhausdata)
|
|
{
|
|
Helper.HttpClientHelper httpcli = new Helper.HttpClientHelper();
|
|
httpcli.CallService("Schulhaus", Schulhausdata.ID.ToString(), "PUT", Schulhausdata);
|
|
|
|
}
|
|
public static int InsertData(Schulhaus Schulhausdata)
|
|
{
|
|
Helper.HttpClientHelper httpcli = new Helper.HttpClientHelper();
|
|
httpcli.CallService("Schulhaus", "", "POST", Schulhausdata);
|
|
List<BWPMModels.Schulhaus> LastSchulhaus = new List<Schulhaus>();
|
|
LastSchulhaus = GetLast(Schulhausdata);
|
|
return LastSchulhaus.First<Schulhaus>().ID;
|
|
|
|
}
|
|
|
|
public static List<Schulhaus> GetLast(Schulhaus Schulhausdata)
|
|
{
|
|
Helper.HttpClientHelper httpcli = new Helper.HttpClientHelper();
|
|
string sql = "Select top 1 * from Schulhaus where mutierer='" + Schulhausdata.mutierer + "' order by erstellt_am desc";
|
|
httpcli.CallService("Schulhaus", "usersql/" + sql, "GET", Schulhausdata);
|
|
return JsonConvert.DeserializeObject<List<Schulhaus>>(httpcli.Results.daten);
|
|
}
|
|
|
|
}
|
|
} |