2023-09-26
This commit is contained in:
@@ -369,6 +369,24 @@ namespace FineUIPro.Web.SysManage
|
||||
{
|
||||
txtSerVerUrl.Text = sysSet9.SetValue;
|
||||
}
|
||||
var sysSet10 = (from x in Funs.DB.Sys_Const where x.ConstText == "集团ESB地址" select x).ToList().FirstOrDefault();
|
||||
if (sysSet10 != null)
|
||||
{
|
||||
txtESBSerVerUrl.Text = sysSet10.ConstValue;
|
||||
}
|
||||
var sysSet11 = (from x in Funs.DB.Sys_Const where x.ConstText == "ClientId" select x).ToList().FirstOrDefault();
|
||||
if (sysSet11 != null)
|
||||
{
|
||||
txtClientId.Text = sysSet11.ConstValue;
|
||||
}
|
||||
var sysSet18 = BLL.ConstValue.drpConstItemList(BLL.ConstValue.Group_SafeReferer).Select(x => new { x.ConstText, x.ConstValue }).ToList();
|
||||
var txtReferer = "";
|
||||
foreach (var item in sysSet18)
|
||||
{
|
||||
string a = item.ConstText + "|" + item.ConstValue;
|
||||
txtReferer += a + "&";
|
||||
}
|
||||
txtRefererWhitelist.Text = txtReferer;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -569,6 +587,68 @@ namespace FineUIPro.Web.SysManage
|
||||
Funs.DB.Sys_Set.InsertOnSubmit(newSysSet9);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
Model.Sys_Const sysSet10 = db.Sys_Const.FirstOrDefault(x => x.ConstText == "集团ESB地址");
|
||||
if (sysSet10 != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.txtESBSerVerUrl.Text.Trim()))
|
||||
{
|
||||
sysSet10.ConstValue = this.txtESBSerVerUrl.Text.Trim();
|
||||
}
|
||||
db.SubmitChanges();
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.Sys_Const newSysSet10 = new Model.Sys_Const();
|
||||
newSysSet10.ID = SQLHelper.GetNewID();
|
||||
if (!string.IsNullOrEmpty(this.txtESBSerVerUrl.Text.Trim()))
|
||||
{
|
||||
newSysSet10.ConstValue = this.txtESBSerVerUrl.Text.Trim();
|
||||
}
|
||||
newSysSet10.ConstText = "集团ESB地址";
|
||||
Funs.DB.Sys_Const.InsertOnSubmit(newSysSet10);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
Model.Sys_Const sysSet11 = db.Sys_Const.FirstOrDefault(x => x.ConstText == "ClientId");
|
||||
if (sysSet11 != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.txtClientId.Text.Trim()))
|
||||
{
|
||||
sysSet11.ConstValue = this.txtClientId.Text.Trim();
|
||||
}
|
||||
db.SubmitChanges();
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.Sys_Const newSysSet11 = new Model.Sys_Const();
|
||||
newSysSet11.ID = SQLHelper.GetNewID();
|
||||
if (!string.IsNullOrEmpty(this.txtClientId.Text.Trim()))
|
||||
{
|
||||
newSysSet11.ConstValue = this.txtClientId.Text.Trim();
|
||||
}
|
||||
newSysSet11.ConstText = "ClientId";
|
||||
Funs.DB.Sys_Const.InsertOnSubmit(newSysSet11);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
ConstValue.DeleteConstValueBygroupId(BLL.ConstValue.Group_SafeReferer);
|
||||
var q = txtRefererWhitelist.Text.Split('&');
|
||||
foreach (var item in q)
|
||||
{
|
||||
var detail = item.Split('|');
|
||||
if (detail.Length == 2)
|
||||
{
|
||||
Model.Sys_Const newSys_Const = new Model.Sys_Const()
|
||||
{
|
||||
ID = SQLHelper.GetNewID(typeof(Model.Sys_Const)),
|
||||
ConstText = detail[0].ToString(),
|
||||
ConstValue = detail[1].ToString(),
|
||||
SortIndex = 1,
|
||||
GroupId = ConstValue.Group_SafeReferer
|
||||
};
|
||||
Funs.DB.Sys_Const.InsertOnSubmit(newSys_Const);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, "修改系统环境设置!", string.Empty, BLL.Const.SysConstSetMenuId, BLL.Const.BtnModify);
|
||||
}
|
||||
@@ -944,6 +1024,94 @@ namespace FineUIPro.Web.SysManage
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region TabOnLine加载页面方法
|
||||
|
||||
private void LoadTabOnlineEditData()
|
||||
{
|
||||
var db = Funs.DB;
|
||||
var sysSet1 = (from x in db.Sys_Const where x.ConstText == "OnlineEditAppid" select x).ToList().FirstOrDefault();
|
||||
if (sysSet1 != null)
|
||||
{
|
||||
txtAppid.Text = sysSet1.ConstValue;
|
||||
}
|
||||
var sysSet2 = (from x in db.Sys_Const where x.ConstText == "OnlineEditAppkey" select x).ToList().FirstOrDefault();
|
||||
if (sysSet2 != null)
|
||||
{
|
||||
txtAppkey.Text = sysSet2.ConstValue;
|
||||
}
|
||||
var sysSet3 = (from x in db.Sys_Const where x.ConstText == "OnlineEditCallBackurl" select x).ToList().FirstOrDefault();
|
||||
if (sysSet3 != null)
|
||||
{
|
||||
txtCallBackapiurl.Text = sysSet3.ConstValue;
|
||||
}
|
||||
}
|
||||
protected void OnlineMenuSetSave_OnClick(object sender, EventArgs e)
|
||||
{
|
||||
var db = Funs.DB;
|
||||
Model.Sys_Const sysSey1 = db.Sys_Const.FirstOrDefault(x => x.ConstText == "OnlineEditAppid");
|
||||
if (sysSey1 != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.txtAppid.Text.Trim()))
|
||||
{
|
||||
sysSey1.ConstValue = this.txtAppid.Text.Trim();
|
||||
}
|
||||
db.SubmitChanges();
|
||||
}
|
||||
else
|
||||
{
|
||||
sysSey1 = new Model.Sys_Const();
|
||||
if (!string.IsNullOrEmpty(this.txtAppid.Text.Trim()))
|
||||
{
|
||||
sysSey1.ConstValue = this.txtAppid.Text.Trim();
|
||||
}
|
||||
sysSey1.ConstText = "OnlineEditAppid";
|
||||
Funs.DB.Sys_Const.InsertOnSubmit(sysSey1);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
Model.Sys_Const sysSey2 = db.Sys_Const.FirstOrDefault(x => x.ConstText == "OnlineEditAppkey");
|
||||
if (sysSey2 != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.txtAppkey.Text.Trim()))
|
||||
{
|
||||
sysSey2.ConstValue = this.txtAppkey.Text.Trim();
|
||||
}
|
||||
db.SubmitChanges();
|
||||
}
|
||||
else
|
||||
{
|
||||
sysSey2 = new Model.Sys_Const();
|
||||
if (!string.IsNullOrEmpty(this.txtAppkey.Text.Trim()))
|
||||
{
|
||||
sysSey2.ConstValue = this.txtAppkey.Text.Trim();
|
||||
}
|
||||
sysSey2.ConstText = "OnlineEditAppkey";
|
||||
Funs.DB.Sys_Const.InsertOnSubmit(sysSey2);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
Model.Sys_Const sysSet3 = db.Sys_Const.FirstOrDefault(x => x.ConstText == "OnlineEditCallBackurl");
|
||||
if (sysSet3 != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.txtCallBackapiurl.Text.Trim()))
|
||||
{
|
||||
sysSet3.ConstValue = this.txtCallBackapiurl.Text.Trim();
|
||||
}
|
||||
db.SubmitChanges();
|
||||
}
|
||||
else
|
||||
{
|
||||
sysSet3 = new Model.Sys_Const();
|
||||
if (!string.IsNullOrEmpty(this.txtCallBackapiurl.Text.Trim()))
|
||||
{
|
||||
sysSet3.ConstValue = this.txtCallBackapiurl.Text.Trim();
|
||||
}
|
||||
sysSet3.ConstText = "OnlineEditCallBackurl";
|
||||
Funs.DB.Sys_Const.InsertOnSubmit(sysSet3);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 选择菜单类型
|
||||
/// </summary>
|
||||
@@ -1181,5 +1349,26 @@ namespace FineUIPro.Web.SysManage
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected void txtTestPost_OnClick(object sender, EventArgs e)
|
||||
{
|
||||
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
|
||||
string CncecEsbPath = SysConstSetService.CncecEsbPath;
|
||||
string ClientId = SysConstSetService.ClientId;
|
||||
|
||||
string baseurl = CncecEsbPath + "/cn.cncec.group.qhsePROD.common.GetToken";
|
||||
var client = new RestClient(baseurl);
|
||||
client.Timeout = -1;
|
||||
var request = new RestRequest(Method.POST);
|
||||
var thisUnit = BLL.UnitService.GetUnitByUnitId(BLL.Const.UnitId_CD);
|
||||
request.AddHeader("ClientId", ClientId);
|
||||
request.AddHeader("OperationCode", "cn.cncec.group.qhsePROD.common.GetToken");
|
||||
request.AddParameter("UnitName", thisUnit.UnitName);
|
||||
request.AddParameter("CollCropCode", thisUnit.CollCropCode);
|
||||
IRestResponse response = client.Execute(request);
|
||||
|
||||
Alert.Show(response.Content);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user