Update vor Blazorise
This commit is contained in:
@@ -14,7 +14,7 @@ namespace BlazorApp
|
||||
new MenuItem()
|
||||
{ Name = "Home", Path = "/", Icon = "home" },
|
||||
new MenuItem()
|
||||
{ Name = "Dashboard", Path = "/Admin/Dashboard", Icon = "dashboard" },
|
||||
{ Name = "Dashboard", Path = "/Company/Dashboard", Icon = "dashboard" },
|
||||
new MenuItem()
|
||||
{ Name = "Firmen-Daten", Path = "/Company/Company", Icon = "account_balance" },
|
||||
new MenuItem()
|
||||
|
||||
@@ -17,11 +17,16 @@ namespace BlazorApp.Helper
|
||||
//SqlConnection con;
|
||||
string connectionstring;
|
||||
public DataSet dsdaten = new DataSet();
|
||||
private static DataTable SP_Parameters = new DataTable();
|
||||
private SqlDataAdapter dadaten;
|
||||
public dbhelper()
|
||||
{
|
||||
var configuation = GetConfiguration();
|
||||
connectionstring = configuation.GetSection("ConnectionStrings").GetSection("BlazorAppContextConnection").Value;
|
||||
SP_Parameters.Rows.Clear();
|
||||
SP_Parameters.Columns.Clear();
|
||||
SP_Parameters.Columns.Add("Paramname");
|
||||
SP_Parameters.Columns.Add("Paramvalue");
|
||||
}
|
||||
|
||||
public string Get_Option(int ID)
|
||||
@@ -49,6 +54,14 @@ namespace BlazorApp.Helper
|
||||
return "";
|
||||
}
|
||||
}
|
||||
public void add_sp_param(string paramname, string paramvalue)
|
||||
{
|
||||
DataRow r = SP_Parameters.NewRow();
|
||||
r[0] = paramname;
|
||||
r[1] = paramvalue;
|
||||
SP_Parameters.Rows.Add(r);
|
||||
|
||||
}
|
||||
|
||||
public static DataTable ObjectToDataTable(object o)
|
||||
{
|
||||
@@ -69,7 +82,7 @@ namespace BlazorApp.Helper
|
||||
return builder.Build();
|
||||
}
|
||||
|
||||
public DataTable Get_Tabledata(string Tablename, bool StoredProc = false, bool is_SQL_String = false)
|
||||
public DataTable Get_Tabledata(string Tablename, bool StoredProc = false, bool is_SQL_String = false, DataTable sp_params = null )
|
||||
{
|
||||
SqlConnection sqlconnect = new SqlConnection();
|
||||
DataSet ds = new DataSet();
|
||||
@@ -79,12 +92,20 @@ namespace BlazorApp.Helper
|
||||
SqlDataAdapter da = new SqlDataAdapter("", sqlconnect);
|
||||
SqlCommand sqlcmd = new SqlCommand();
|
||||
sqlcmd.Connection = sqlconnect;
|
||||
|
||||
|
||||
|
||||
if (StoredProc == true)
|
||||
{
|
||||
sqlcmd.CommandType = CommandType.StoredProcedure;
|
||||
if (Tablename.IndexOf("@@Mandantnr@@") > 0)
|
||||
Tablename = Tablename.Replace("@@Mandantnr@@", "");
|
||||
sqlcmd.CommandText = Tablename;
|
||||
foreach (DataRow r in SP_Parameters.Rows)
|
||||
{
|
||||
sqlcmd.Parameters.Add(r["Paramname"].ToString(), SqlDbType.VarChar);
|
||||
sqlcmd.Parameters[sqlcmd.Parameters.Count - 1].Value = r["Paramvalue"].ToString();
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user