SVN r483
SVN-Revision: r483
This commit is contained in:
@@ -0,0 +1,134 @@
|
||||
using Lskj.Business.Impl;
|
||||
using Lskj.Control;
|
||||
using Lskj.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Lskj.PubApiSetModule
|
||||
{
|
||||
public partial class FrmMain : BaseForm
|
||||
{
|
||||
public DynamicApiSetModel Model;
|
||||
public SqlDataAdapter SendMainAdapterObj;
|
||||
public SqlDataAdapter SendDetailAdapterObj;
|
||||
public FrmMain()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.Load += OnFrmMainLoad;
|
||||
}
|
||||
/// <summary>
|
||||
/// 初始化时
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnFrmMainLoad(object sender, EventArgs e)
|
||||
{
|
||||
InitEventApiTable();
|
||||
InitColumnsData();
|
||||
InitDataSource();
|
||||
}
|
||||
/// <summary>
|
||||
/// 初始化数据源
|
||||
/// </summary>
|
||||
private void InitDataSource()
|
||||
{
|
||||
//SendMain
|
||||
SendMainAdapterObj = BaseImpl.GetAdapterResult("select * from p_systemeventapitab");
|
||||
DataTable sendMainTable = new DataTable();
|
||||
SendMainAdapterObj.Fill(sendMainTable);
|
||||
sendGcMain.DataSource = sendMainTable;
|
||||
//SendDetail
|
||||
SendDetailAdapterObj = BaseImpl.GetAdapterResult("select * from p_systemeventapipmstab");
|
||||
DataTable sendDetailTable = new DataTable();
|
||||
SendMainAdapterObj.Fill(sendDetailTable);
|
||||
sendGcDetail.DataSource = sendDetailTable;
|
||||
}
|
||||
/// <summary>
|
||||
/// 初始化表格数据源
|
||||
/// </summary>
|
||||
private void InitColumnsData()
|
||||
{
|
||||
//reqDataType
|
||||
reqDataTypeComboBox.Items.Add(new ComBoxModel() { Value = 1, Text = "Json" });
|
||||
reqDataTypeComboBox.Items.Add(new ComBoxModel() { Value = 0, Text = "Text" });
|
||||
reqDataTypeComboBox.Items.Add(new ComBoxModel() { Value = 2, Text = "Xml" });
|
||||
//resDataType
|
||||
resDataTypeComboBox.Items.Add(new ComBoxModel() { Value = 1, Text = "Json" });
|
||||
resDataTypeComboBox.Items.Add(new ComBoxModel() { Value = 0, Text = "Text" });
|
||||
resDataTypeComboBox.Items.Add(new ComBoxModel() { Value = 2, Text = "Xml" });
|
||||
//method
|
||||
methodComboBox.Items.Add(new ComBoxModel() { Value = 0, Text = "Get" });
|
||||
methodComboBox.Items.Add(new ComBoxModel() { Value = 1, Text = "Post" });
|
||||
//actionType
|
||||
actionTypeComboBox.Items.Add(new ComBoxModel() { Value = 0, Text = "手动触发" });
|
||||
actionTypeComboBox.Items.Add(new ComBoxModel() { Value = 1, Text = "循环触发" });
|
||||
//eType
|
||||
eTypeComboBox.Items.Add(new ComBoxModel() { Value = "AfterModuleDataChange", Text = "数据改变后" });
|
||||
eTypeComboBox.Items.Add(new ComBoxModel() { Value = "BeforeModuleDataChange", Text = "数据改变前" });
|
||||
eTypeComboBox.Items.Add(new ComBoxModel() { Value = "AfterModuleContextMenu", Text = "右键执行后" });
|
||||
eTypeComboBox.Items.Add(new ComBoxModel() { Value = "BeforeModuleContextMenu", Text = "右键执行前" });
|
||||
eTypeComboBox.Items.Add(new ComBoxModel() { Value = "AfterModuleAuditStateChange", Text = "审核执行后" });
|
||||
eTypeComboBox.Items.Add(new ComBoxModel() { Value = "BeforeModuleAuditStateChange", Text = "审核执行前" });
|
||||
//tokenType
|
||||
tokenTypeComboBox.Items.Add(new ComBoxModel() { Value = "0", Text = "Token文本" });
|
||||
tokenTypeComboBox.Items.Add(new ComBoxModel() { Value = "1", Text = "Cookie" });
|
||||
//eTypeCode
|
||||
eTypeCodeComboBox.Items.Add(new ComBoxModel() { Value = "1", Text = "新增" });
|
||||
eTypeCodeComboBox.Items.Add(new ComBoxModel() { Value = "2", Text = "更新" });
|
||||
eTypeCodeComboBox.Items.Add(new ComBoxModel() { Value = "3", Text = "删除" });
|
||||
eTypeCodeComboBox.Items.Add(new ComBoxModel() { Value = "21", Text = "提交审核" });
|
||||
eTypeCodeComboBox.Items.Add(new ComBoxModel() { Value = "31", Text = "审核" });
|
||||
eTypeCodeComboBox.Items.Add(new ComBoxModel() { Value = "32", Text = "反审" });
|
||||
//allowShowMsg
|
||||
allowShowMsgComboBox.Items.Add(new ComBoxModel() { Value = "0", Text = "不提示" });
|
||||
allowShowMsgComboBox.Items.Add(new ComBoxModel() { Value = "1", Text = "提示" });
|
||||
//disableTag
|
||||
disableTagComboBox.Items.Add(new ComBoxModel() { Value = "0", Text = "启用" });
|
||||
disableTagComboBox.Items.Add(new ComBoxModel() { Value = "1", Text = "禁用" });
|
||||
}
|
||||
/// <summary>
|
||||
/// 构建数据表
|
||||
/// </summary>
|
||||
private bool InitEventApiTable()
|
||||
{
|
||||
try
|
||||
{
|
||||
Dictionary<string, string> colDic = new Dictionary<string, string>();
|
||||
colDic.Add("title", "varchar(200)");
|
||||
colDic.Add("url", "varchar(1000)");
|
||||
colDic.Add("dllcoid", "varchar(100)");
|
||||
colDic.Add("contextMenuId", "int");
|
||||
colDic.Add("reqDataType", "int");
|
||||
colDic.Add("resDataType", "int");
|
||||
colDic.Add("method", "int");
|
||||
colDic.Add("datasource", "varchar(8000)");
|
||||
colDic.Add("actionType", "int");
|
||||
colDic.Add("actionDelay", "int");
|
||||
colDic.Add("eType", "varchar(1000)");
|
||||
colDic.Add("finshAction", "varchar(8000)");
|
||||
colDic.Add("orderValue", "int");
|
||||
colDic.Add("isSucceedCond", "varchar(100)");
|
||||
colDic.Add("tokenApiId", "int");
|
||||
colDic.Add("tokenType", "int");
|
||||
colDic.Add("dynamicToken", "varchar(200)");
|
||||
colDic.Add("pmsType", "int");
|
||||
colDic.Add("allowShowMsg", "int");
|
||||
colDic.Add("ContentType", "varchar(200)");
|
||||
string isExitApiTab = "select top 1 * from sysObjects where Id=OBJECT_ID(N'p_systemEventApiTab') and xtype='U'";
|
||||
DataTable apiTab = SqlHelper.ExecuteDataTable(isExitApiTab);
|
||||
if (apiTab.Rows.Count > 0)//存在日志表
|
||||
{
|
||||
DataTable columnsTab = SqlHelper.ExecuteDataTable(string.Format("select name from syscolumns where id=object_id('p_systemEventApiTab')"));
|
||||
foreach (KeyValuePair<string, string> colunmField in colDic)
|
||||
{
|
||||
DataRow[] dataRows = columnsTab.Select().Where(n => (n["name"] + "").Equals(colunmField.Key)).ToArray();
|
||||
if (dataRows.Length == 0)
|
||||
{
|
||||
string addColSql =
|
||||
Reference in New Issue
Block a user