mirror of
https://github.com/SirLecram/HospitalServerManager
synced 2024-10-20 01:00:35 +02:00
069f0612da
A few models has been improved; New pages has been added; NewRecordDialog has been added; ViewNavigator was created; A type providers has been added; new interfaces has been added; New validator, which checks if interface is implemented has been added; The application can read data and add new record by API now.
38 lines
973 B
C#
38 lines
973 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace HospitalServerManager.Model.Controllers
|
|
{
|
|
internal static class ApiCommandProvider
|
|
{
|
|
public static string GetRecordHttpRequest(string tableName)
|
|
{
|
|
return @"/getfromdb/" + tableName;
|
|
}
|
|
public static string GetColumnNamesHttpRequest(string tableName)
|
|
{
|
|
return @"/getcolumnnames/" + tableName;
|
|
}
|
|
public static string GetColumnTypesHttpRequest(string tableName)
|
|
{
|
|
return @"/getcolumntypes/" + tableName;
|
|
}
|
|
public static string CreateNewRecordAsync(string tableName, List<string> valuesList)
|
|
{
|
|
string createRequest = "/insertrec/" + tableName + "/nr/" + valuesList.Count() + "/pk/" + valuesList[0];
|
|
for(int i = 1; i<8; i++)
|
|
{
|
|
var maxIndex = valuesList.Count();
|
|
if (i < maxIndex)
|
|
createRequest += "/" + valuesList[i];
|
|
else
|
|
createRequest += "/_";
|
|
}
|
|
return createRequest;
|
|
}
|
|
}
|
|
}
|