54 lines
1.6 KiB
C#
54 lines
1.6 KiB
C#
using Newtonsoft.Json;
|
|
using SecuringWebApiUsingApiKey.Middleware;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Configuration;
|
|
using System.Data.SqlClient;
|
|
using System.Linq;
|
|
using System.Runtime.Remoting.Messaging;
|
|
using System.Web;
|
|
using System.Web.Services;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using WebApp;
|
|
|
|
namespace WebApp
|
|
{
|
|
public partial class DocTester : System.Web.UI.Page
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
[WebMethod]
|
|
public static object GetJson(string tableKey, string id, string mode)
|
|
{
|
|
string _connectionString = StringCipher.Decrypt(ConfigurationManager.ConnectionStrings["DocTesterconnectionstring"].ConnectionString, "i%!k!7pab%bNLdA5hE4pkR4XaB%E^jB3d9tHuQ4pbF&BZjF7SB#WBWit5#HrbJiLrLVm");
|
|
string json;
|
|
|
|
if (mode == "prov")
|
|
{
|
|
using (SqlConnection con = new SqlConnection(_connectionString))
|
|
using (SqlCommand cmd = new SqlCommand(
|
|
"SELECT JavaScriptObject FROM ProvDokuments WHERE ProvDokumentid = @key", con))
|
|
{
|
|
cmd.Parameters.AddWithValue("@key", id);
|
|
con.Open();
|
|
json = cmd.ExecuteScalar()?.ToString();
|
|
}
|
|
|
|
if (json == null)
|
|
return "";
|
|
}
|
|
json = "";
|
|
return json;
|
|
|
|
}
|
|
|
|
|
|
protected void LoadJson(object sender, EventArgs e)
|
|
{
|
|
string a = "1";
|
|
}
|
|
}
|
|
} |