Merge branch 'master' of gitlab.com:zd-team/tb/tb320eva_zd
This commit is contained in:
@@ -15,6 +15,7 @@ using TodoAPI2.Models;
|
|||||||
using System.Data;
|
using System.Data;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
namespace TodoAPI2.Controllers
|
namespace TodoAPI2.Controllers
|
||||||
{
|
{
|
||||||
@@ -94,11 +95,14 @@ namespace TodoAPI2.Controllers
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||||
var httpclient = MyHelper.getHttpClient(Configuration);
|
//var httpclient = MyHelper.getHttpClient(Configuration);
|
||||||
|
var httpclient = new WebClient();
|
||||||
string mainurl = Configuration["JasperReportServer:MainURL"];
|
string mainurl = Configuration["JasperReportServer:MainURL"];
|
||||||
string reportsite = Configuration["JasperReportServer:reportsite"];
|
string reportsite = Configuration["JasperReportServer:reportsite"];
|
||||||
|
string username = Configuration["JasperReportServer:username"];
|
||||||
|
string password = Configuration["JasperReportServer:password"];
|
||||||
|
|
||||||
string url = $"{mainurl}{reportsite}/rep_eva01.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}";
|
string url = $"{mainurl}{reportsite}/rep_eva01.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}&j_username={username}&j_password={password}";
|
||||||
|
|
||||||
var data = httpclient.DownloadData(url);
|
var data = httpclient.DownloadData(url);
|
||||||
var stream = new MemoryStream(data);
|
var stream = new MemoryStream(data);
|
||||||
|
|||||||
@@ -97,8 +97,10 @@ namespace TodoAPI2.Controllers
|
|||||||
var httpclient = MyHelper.getHttpClient(Configuration);
|
var httpclient = MyHelper.getHttpClient(Configuration);
|
||||||
string mainurl = Configuration["JasperReportServer:MainURL"];
|
string mainurl = Configuration["JasperReportServer:MainURL"];
|
||||||
string reportsite = Configuration["JasperReportServer:reportsite"];
|
string reportsite = Configuration["JasperReportServer:reportsite"];
|
||||||
|
string username = Configuration["JasperReportServer:username"];
|
||||||
|
string password = Configuration["JasperReportServer:password"];
|
||||||
|
|
||||||
string url = $"{mainurl}{reportsite}/rep_eva02.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}";
|
string url = $"{mainurl}{reportsite}/rep_eva02.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}&j_username={username}&j_password={password}";
|
||||||
|
|
||||||
var data = httpclient.DownloadData(url);
|
var data = httpclient.DownloadData(url);
|
||||||
var stream = new MemoryStream(data);
|
var stream = new MemoryStream(data);
|
||||||
|
|||||||
@@ -96,8 +96,10 @@ namespace TodoAPI2.Controllers
|
|||||||
var httpclient = MyHelper.getHttpClient(Configuration);
|
var httpclient = MyHelper.getHttpClient(Configuration);
|
||||||
string mainurl = Configuration["JasperReportServer:MainURL"];
|
string mainurl = Configuration["JasperReportServer:MainURL"];
|
||||||
string reportsite = Configuration["JasperReportServer:reportsite"];
|
string reportsite = Configuration["JasperReportServer:reportsite"];
|
||||||
|
string username = Configuration["JasperReportServer:username"];
|
||||||
|
string password = Configuration["JasperReportServer:password"];
|
||||||
|
|
||||||
string url = $"{mainurl}{reportsite}/rep_eva03.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}";
|
string url = $"{mainurl}{reportsite}/rep_eva03.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}&j_username={username}&j_password={password}";
|
||||||
|
|
||||||
var data = httpclient.DownloadData(url);
|
var data = httpclient.DownloadData(url);
|
||||||
var stream = new MemoryStream(data);
|
var stream = new MemoryStream(data);
|
||||||
|
|||||||
@@ -251,7 +251,8 @@ public class MyHelper
|
|||||||
string password = Configuration["JasperReportServer:password"];
|
string password = Configuration["JasperReportServer:password"];
|
||||||
|
|
||||||
WebClient httpclient = new WebClient();
|
WebClient httpclient = new WebClient();
|
||||||
var result = httpclient.DownloadString($"{loginurl}?j_username={username}&j_password={password}");
|
string login_url = $"{loginurl}?j_username={username}&j_password={password}";
|
||||||
|
var result = httpclient.DownloadString(loginurl);
|
||||||
string session = httpclient.ResponseHeaders.Get("Set-Cookie");
|
string session = httpclient.ResponseHeaders.Get("Set-Cookie");
|
||||||
httpclient.Headers.Add("Cookie", session);
|
httpclient.Headers.Add("Cookie", session);
|
||||||
return httpclient;
|
return httpclient;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"connectionStrings": {
|
"connectionStrings": {
|
||||||
"mainDBConnectionString": "Server=appgek.com;Port=15432;Database=tb320_hr;User ID=zerpa;Password=zerpa1234;",
|
"mainDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320dev;User ID=postgres;Password=project0*;",
|
||||||
"externalDBConnectionString": "Server=appgek.com;Port=15432;Database=tb320_hr;User ID=zerpa;Password=zerpa1234;"
|
"externalDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320dev;User ID=postgres;Password=project0*;"
|
||||||
},
|
},
|
||||||
"IdentityServer": {
|
"IdentityServer": {
|
||||||
"url": "",
|
"url": "",
|
||||||
@@ -27,17 +27,17 @@
|
|||||||
"From": ""
|
"From": ""
|
||||||
},
|
},
|
||||||
"JasperReportServer": {
|
"JasperReportServer": {
|
||||||
"MainURL": "http://jasper.appgek.com:8480/jasperserver/rest_v2/reports",
|
"MainURL": "http://tb320.zd.co.th/jasperserver/rest_v2/reports",
|
||||||
"LoginURL": "http://jasper.appgek.com:8480/jasperserver/rest/login",
|
"LoginURL": "http://tb320.zd.co.th/jasperserver/rest_v2/login",
|
||||||
"username": "jasperadmin",
|
"username": "jasper",
|
||||||
"password": "jasperadmin",
|
"password": "ZdPr0jects",
|
||||||
"reportsite": "/tb320hr"
|
"reportsite": "/tb320hr"
|
||||||
},
|
},
|
||||||
"SiteInformation": {
|
"SiteInformation": {
|
||||||
"appsite": "/eva",
|
"appsite": "/eva",
|
||||||
"apisite": "/eva",
|
"apisite": "/eva",
|
||||||
"mainsite": "https://tb320.dev.appgek.com",
|
"mainsite": "http://tb320dev.zd.co.th",
|
||||||
"modulesite": "https://tb320.dev.appgek.com/menu/evaluation",
|
"modulesite": "http://tb320dev.zd.co.th/menu/evaluation",
|
||||||
"sitename": "เนติบัณฑิตยสภา ในพระบรมราชูปถัมภ์",
|
"sitename": "เนติบัณฑิตยสภา ในพระบรมราชูปถัมภ์",
|
||||||
"modulename": "ระบบประวัติเงินเดือนและการเลื่อนเงินเดือน",
|
"modulename": "ระบบประวัติเงินเดือนและการเลื่อนเงินเดือน",
|
||||||
"chatsite": "http://chat.rmutto.ac.th"
|
"chatsite": "http://chat.rmutto.ac.th"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"connectionStrings": {
|
"connectionStrings": {
|
||||||
"mainDBConnectionString": "Server=appgek.com;Port=15432;Database=tb320_hr_site2;User ID=zerpa;Password=zerpa1234;",
|
"mainDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320dev;User ID=postgres;Password=project0*;",
|
||||||
"externalDBConnectionString": "Server=appgek.com;Port=15432;Database=tb320_hr_site2;User ID=zerpa;Password=zerpa1234;"
|
"externalDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320dev;User ID=postgres;Password=project0*;"
|
||||||
},
|
},
|
||||||
"IdentityServer": {
|
"IdentityServer": {
|
||||||
"url": "",
|
"url": "",
|
||||||
@@ -27,17 +27,17 @@
|
|||||||
"From": ""
|
"From": ""
|
||||||
},
|
},
|
||||||
"JasperReportServer": {
|
"JasperReportServer": {
|
||||||
"MainURL": "http://jasper.appgek.com:8480/jasperserver/rest_v2/reports",
|
"MainURL": "http://tb320.zd.co.th/jasperserver/rest_v2/reports",
|
||||||
"LoginURL": "http://jasper.appgek.com:8480/jasperserver/rest/login",
|
"LoginURL": "http://tb320.zd.co.th/jasperserver/rest_v2/login",
|
||||||
"username": "jasperadmin",
|
"username": "jasper",
|
||||||
"password": "jasperadmin",
|
"password": "ZdPr0jects",
|
||||||
"reportsite": "/tb320hrsite2"
|
"reportsite": "/tb320hr"
|
||||||
},
|
},
|
||||||
"SiteInformation": {
|
"SiteInformation": {
|
||||||
"appsite": "/eva",
|
"appsite": "/eva",
|
||||||
"apisite": "/eva",
|
"apisite": "/eva",
|
||||||
"mainsite": "https://tb320site2.dev.appgek.com",
|
"mainsite": "http://tb320dev.zd.co.th",
|
||||||
"modulesite": "https://tb320site2.dev.appgek.com/menu/evaluation",
|
"modulesite": "http://tb320dev.zd.co.th/menu/evaluation",
|
||||||
"sitename": "เนติบัณฑิตยสภา ในพระบรมราชูปถัมภ์",
|
"sitename": "เนติบัณฑิตยสภา ในพระบรมราชูปถัมภ์",
|
||||||
"modulename": "ระบบประวัติเงินเดือนและการเลื่อนเงินเดือน",
|
"modulename": "ระบบประวัติเงินเดือนและการเลื่อนเงินเดือน",
|
||||||
"chatsite": "http://chat.rmutto.ac.th"
|
"chatsite": "http://chat.rmutto.ac.th"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"connectionStrings": {
|
"connectionStrings": {
|
||||||
"mainDBConnectionString": "Server=appgek.com;Port=15432;Database=tb320_hr;User ID=zerpa;Password=zerpa1234;",
|
"mainDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320dev;User ID=postgres;Password=project0*;",
|
||||||
"externalDBConnectionString": "Server=appgek.com;Port=15432;Database=tb320_hr;User ID=zerpa;Password=zerpa1234;"
|
"externalDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320dev;User ID=postgres;Password=project0*;"
|
||||||
},
|
},
|
||||||
"IdentityServer": {
|
"IdentityServer": {
|
||||||
"url": "",
|
"url": "",
|
||||||
@@ -27,17 +27,17 @@
|
|||||||
"From": ""
|
"From": ""
|
||||||
},
|
},
|
||||||
"JasperReportServer": {
|
"JasperReportServer": {
|
||||||
"MainURL": "http://jasper.appgek.com:8480/jasperserver/rest_v2/reports",
|
"MainURL": "http://tb320.zd.co.th/jasperserver/rest_v2/reports",
|
||||||
"LoginURL": "http://jasper.appgek.com:8480/jasperserver/rest/login",
|
"LoginURL": "http://tb320.zd.co.th/jasperserver/rest_v2/login",
|
||||||
"username": "jasperadmin",
|
"username": "jasper",
|
||||||
"password": "jasperadmin",
|
"password": "ZdPr0jects",
|
||||||
"reportsite": "/tb320hr"
|
"reportsite": "/tb320hr"
|
||||||
},
|
},
|
||||||
"SiteInformation": {
|
"SiteInformation": {
|
||||||
"appsite": "/eva",
|
"appsite": "/eva",
|
||||||
"apisite": "/eva",
|
"apisite": "/eva",
|
||||||
"mainsite": "https://tb320.dev.appgek.com",
|
"mainsite": "http://tb320dev.zd.co.th",
|
||||||
"modulesite": "https://tb320.dev.appgek.com/menu/evaluation",
|
"modulesite": "http://tb320dev.zd.co.th/menu/evaluation",
|
||||||
"sitename": "เนติบัณฑิตยสภา ในพระบรมราชูปถัมภ์",
|
"sitename": "เนติบัณฑิตยสภา ในพระบรมราชูปถัมภ์",
|
||||||
"modulename": "ระบบประวัติเงินเดือนและการเลื่อนเงินเดือน",
|
"modulename": "ระบบประวัติเงินเดือนและการเลื่อนเงินเดือน",
|
||||||
"chatsite": "http://chat.rmutto.ac.th"
|
"chatsite": "http://chat.rmutto.ac.th"
|
||||||
|
|||||||
Reference in New Issue
Block a user