1、系统菜单调整;

2、系统看板UI调整;
3、事故事件功能
4、其他
This commit is contained in:
2025-12-10 15:58:02 +08:00
parent 3d00bb7a94
commit 6619f1e004
276 changed files with 131707 additions and 50045 deletions
@@ -24,7 +24,7 @@
<f:Toolbar ID="Toolbar2" Position="Top" runat="server">
<Items>
<f:TextBox ID="txtUserName" runat="server" Label="接口名称" EmptyText="输入查询条件"
AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="200px" LabelWidth="50px"
AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="300px" LabelWidth="80px"
LabelAlign="Right">
</f:TextBox>
<%-- <f:DropDownList ID="drpDataType" runat="server" Label="操作类型" EnableEdit="false" ForceSelection="false"
@@ -1,22 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using BLL;
using System.Data;
namespace FineUIPro.Web.InterFace
{
public partial class IFLogList : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
{
if (!IsPostBack)
{
// BLL.ConstValue.InitConstValueDropDownList(this.drpDataType, "DataType", true);
// BLL.ConstValue.InitConstValueDropDownList(this.drpDataType, "DataType", true);
BindGrid();
}
}
@@ -25,13 +18,12 @@ namespace FineUIPro.Web.InterFace
private void BindGrid()
{
Model.InterFaceLog interFaceLog=new Model.InterFaceLog();
interFaceLog.InterFaceName=txtUserName.Text;
var q= BLL.InterFaceLogService.GetInterFaceLogByModle(interFaceLog);
Model.InterFaceLog interFaceLog = new Model.InterFaceLog();
interFaceLog.InterFaceName = txtUserName.Text;
var q = BLL.InterFaceLogService.GetInterFaceLogByModle(interFaceLog);
Grid1.DataSource = InterFaceLogService.getListData(interFaceLog, Grid1);
Grid1.RecordCount = InterFaceLogService.count;
Grid1.DataSource= InterFaceLogService.getListData(interFaceLog, Grid1);
Grid1.DataBind();
Grid1.DataBind();
}
#endregion
@@ -67,7 +59,6 @@ namespace FineUIPro.Web.InterFace
{
Grid1.SortDirection = e.SortDirection;
Grid1.SortField = e.SortField;
BindGrid();
}
@@ -17,39 +17,36 @@
<f:TextBox ID="txtFaceName" runat="server" Label="接口名称" Required="true" ShowRedStar="true" MaxLength="50"
FocusOnPageLoad="true">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList ID="drpUnit" runat="server" Label="源单位" EnableEdit="true" ForceSelection="false"
Required="true" ShowRedStar="true">
<f:CheckBox ID="cbIsSingleRequest" Label="是否单一来源" runat="server" DisplayType="Switch" OnCheckedChanged="cbIsSingleRequest_OnCheckedChanged"
LabelWidth="140px" Checked="true" AutoPostBack="true">
</f:CheckBox>
</Items>
</f:FormRow>
<f:FormRow ID="rowFace">
<Items>
<f:DropDownList ID="drpUnit" runat="server" Label="源单位" EnableEdit="true" ForceSelection="false">
</f:DropDownList>
<f:TextBox ID="txtFaceUrl" runat="server" Label="来源地址" Required="true" ShowRedStar="true" >
<f:TextBox ID="txtFaceUrl" runat="server" Label="来源地址" Required="true" ShowRedStar="true">
</f:TextBox>
<f:DropDownList ID="DrpUrlReqMethod" runat="server" Label="请求类型" EnableEdit="false" ForceSelection="false"
Required="true" ShowRedStar="true">
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownBox runat="server" ID="drpAuthUnit" DataControlID="rbAuthUnits"
Label="目标单位" MaxLength="4000">
<PopPanel>
<f:SimpleForm ID="SimpleForm2" BodyPadding="10px" runat="server" AutoScroll="true"
ShowBorder="True" ShowHeader="false" Hidden="true">
<Items>
<f:Label ID="Label1" runat="server" Text="请选择目标单位:"></f:Label>
<f:CheckBoxList ID="rbAuthUnits" ColumnNumber="3" runat="server">
</f:CheckBoxList>
</Items>
</f:SimpleForm>
</PopPanel>
</f:DropDownBox>
<f:TextArea ID="txtRequestJsonBody" runat="server" Label="请求报文体" Hidden="True">
</f:TextArea>
</Items>
</f:FormRow>
<f:FormRow ID="rowFaceFor">
<Items>
<f:DropDownList runat="server" ID="drpAuthUnit" Label="目标单位" MaxLength="4000" EnableEdit="True">
</f:DropDownList>
<f:TextBox ID="txtFaceForUrl" runat="server" Label="目标地址" Required="true" ShowRedStar="true">
</f:TextBox>
<f:DropDownList ID="DrpForUrlReqMethod" runat="server" Label="请求类型" EnableEdit="false" ForceSelection="false"
@@ -57,12 +54,12 @@
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<f:FormRow ID="rowCallBack">
<Items>
<f:CheckBox ID="IsCallBack" Label="是否回调" runat="server" DisplayType="Switch" OnCheckedChanged="IsCallBack_CheckedChanged"
Checked="true" AutoPostBack="true">
</f:CheckBox>
<f:TextBox ID="txtCallBackUrl" runat="server" Label="回调地址" Hidden="false" >
<f:TextBox ID="txtCallBackUrl" runat="server" Label="回调地址" Hidden="false">
</f:TextBox>
<f:DropDownList ID="DrpCallBackUrlReqMethod" runat="server" Label="请求类型" EnableEdit="false" ForceSelection="false"
Required="true" ShowRedStar="true">
@@ -71,7 +68,7 @@
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList ID="drpIsOpen" runat="server" Label="是否启用" EnableEdit="false" ForceSelection="false"
<f:DropDownList ID="drpIsOpen" runat="server" Label="是否启用" EnableEdit="false" ForceSelection="false"
Required="true" ShowRedStar="true">
</f:DropDownList>
<f:TextBox ID="txtRemarks" runat="server" Label="描述" MaxLength="500">
@@ -1,10 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
namespace FineUIPro.Web.InterFace
@@ -49,6 +44,11 @@ namespace FineUIPro.Web.InterFace
this.drpUnit.DataValueField = "UnitId";
this.drpUnit.DataSource = BLL.UnitService.GetUnitDropDownList();
drpUnit.DataBind();
this.drpAuthUnit.DataTextField = "UnitName";
this.drpAuthUnit.DataValueField = "UnitId";
this.drpAuthUnit.DataSource = BLL.UnitService.GetUnitDropDownList();
drpAuthUnit.DataBind();
Funs.FineUIPleaseSelect(this.drpUnit);
if (!string.IsNullOrEmpty(this.InterFaceSetId))
{
@@ -62,14 +62,7 @@ namespace FineUIPro.Web.InterFace
this.drpUnit.SelectedValue = unit.UnitId;
}
}
var list = (from x in Funs.DB.Base_Unit
orderby x.UnitName
select new { x.UnitName, x.UnitId }).ToList();
foreach (var item in list)
{
this.rbAuthUnits.Items.Add(item.UnitName, item.UnitId);
}
if (!string.IsNullOrEmpty(this.InterFaceSetId))
{
@@ -89,10 +82,11 @@ namespace FineUIPro.Web.InterFace
this.IsCallBack.Checked =(bool) FaceSet.IsCallBack;
if (!string.IsNullOrEmpty(FaceSet.AuthUnitIds))
{
this.drpAuthUnit.Values = FaceSet.AuthUnitIds.Split(',');
this.drpAuthUnit.SelectedValueArray = FaceSet.AuthUnitIds.Split(',');
}
this.txtRemarks.Text = FaceSet.TxtRemarks;
txtRequestJsonBody.Text = FaceSet.RequestJsonBody;
if (FaceSet.IsOpen.HasValue)
{
this.drpIsOpen.SelectedValue = Convert.ToString(FaceSet.IsOpen);
@@ -109,8 +103,15 @@ namespace FineUIPro.Web.InterFace
{
this.DrpCallBackUrlReqMethod.SelectedValue = FaceSet.CallBackUrlReqMethod;
}
if (FaceSet.IsSingleRequest != null) cbIsSingleRequest.Checked = (bool)FaceSet.IsSingleRequest;
cbIsSingleRequest_OnCheckedChanged(null, null);
}
}
else
{
cbIsSingleRequest_OnCheckedChanged(null, null);
}
}
}
@@ -132,24 +133,10 @@ namespace FineUIPro.Web.InterFace
//目标单位
string AuthUnitId = string.Empty;
string AuthUnitName = string.Empty;
string UnitId = string.Empty;
foreach (var item in this.drpAuthUnit.Values)
{
if (item != "")
{
AuthUnitId += item + ",";
}
}
foreach (var item in this.drpAuthUnit.Texts)
{
if (item != "")
{
AuthUnitName += item + ",";
}
}
AuthUnitId = AuthUnitId.Substring(0, AuthUnitId.LastIndexOf(","));
AuthUnitName = AuthUnitName.Substring(0, AuthUnitName.LastIndexOf(","));
string UnitId = string.Empty;
AuthUnitId = string.Join(",", drpAuthUnit.SelectedValueArray);
AuthUnitName = UnitService.getUnitNamesUnitIds(AuthUnitId);
if (this.drpUnit.SelectedValue != Const._Null)
{
UnitId = this.drpUnit.SelectedValue;
@@ -168,7 +155,9 @@ namespace FineUIPro.Web.InterFace
InterFaceCallBackUrl = txtCallBackUrl.Text,
UrlReqMethod=DrpUrlReqMethod.SelectedValue.Trim(),
ForUrlReqMethod=DrpForUrlReqMethod.SelectedValue.Trim(),
CallBackUrlReqMethod=DrpCallBackUrlReqMethod.SelectedValue.Trim()
CallBackUrlReqMethod=DrpCallBackUrlReqMethod.SelectedValue.Trim(),
IsSingleRequest = cbIsSingleRequest.Checked,
RequestJsonBody = txtRequestJsonBody.Text.Trim(),
};
if (string.IsNullOrEmpty(this.InterFaceSetId))
@@ -195,7 +184,7 @@ namespace FineUIPro.Web.InterFace
/// <returns></returns>
private void GetButtonPower()
{
var buttonList = BLL.CommonService.GetAllButtonList(null,this.CurrUser.UserId, BLL.Const.InterFaceSetMenuId);
var buttonList = BLL.CommonService.GetAllButtonList(string.Empty, this.CurrUser.UserId, BLL.Const.UserMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnSave))
@@ -218,5 +207,23 @@ namespace FineUIPro.Web.InterFace
}
}
protected void cbIsSingleRequest_OnCheckedChanged(object sender, CheckedEventArgs e)
{
if (cbIsSingleRequest.Checked == true)
{
this.rowFace.Hidden = false;
this.rowFaceFor.Hidden = true;
this.rowCallBack.Hidden = true;
txtRequestJsonBody.Hidden = false;
}
else
{
this.rowFace.Hidden = false;
this.rowFaceFor.Hidden = false;
this.rowCallBack.Hidden = false;
txtRequestJsonBody.Hidden = true;
}
}
}
}
@@ -50,6 +50,24 @@ namespace FineUIPro.Web.InterFace
/// </remarks>
protected global::FineUIPro.TextBox txtFaceName;
/// <summary>
/// cbIsSingleRequest 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.CheckBox cbIsSingleRequest;
/// <summary>
/// rowFace 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.FormRow rowFace;
/// <summary>
/// drpUnit 控件。
/// </summary>
@@ -77,6 +95,24 @@ namespace FineUIPro.Web.InterFace
/// </remarks>
protected global::FineUIPro.DropDownList DrpUrlReqMethod;
/// <summary>
/// txtRequestJsonBody 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextArea txtRequestJsonBody;
/// <summary>
/// rowFaceFor 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.FormRow rowFaceFor;
/// <summary>
/// drpAuthUnit 控件。
/// </summary>
@@ -84,34 +120,7 @@ namespace FineUIPro.Web.InterFace
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownBox drpAuthUnit;
/// <summary>
/// SimpleForm2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.SimpleForm SimpleForm2;
/// <summary>
/// Label1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label Label1;
/// <summary>
/// rbAuthUnits 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.CheckBoxList rbAuthUnits;
protected global::FineUIPro.DropDownList drpAuthUnit;
/// <summary>
/// txtFaceForUrl 控件。
@@ -131,6 +140,15 @@ namespace FineUIPro.Web.InterFace
/// </remarks>
protected global::FineUIPro.DropDownList DrpForUrlReqMethod;
/// <summary>
/// rowCallBack 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.FormRow rowCallBack;
/// <summary>
/// IsCallBack 控件。
/// </summary>
@@ -20,7 +20,7 @@
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="接口设置" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="InterFaceSetId" EnableColumnLines="true"
runat="server" BoxFlex="1" DataKeyNames="InterFaceSetId" EnableColumnLines="true" ForceFit="true"
ClicksToEdit="2" DataIDField="InterFaceSetId" AllowSorting="true" SortField="InterFaceName"
SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" Width="980px">
@@ -55,8 +55,7 @@
</f:Toolbar>
</Toolbars>
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center" TextAlign="Center"/>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center" TextAlign="Center"/>
<f:RenderField Width="120px" ColumnID="InterFaceName" DataField="InterFaceName" EnableFilter="true"
SortField="InterFaceName" FieldType="String" HeaderText="接口名称" HeaderTextAlign="Center"
TextAlign="Left">
@@ -77,13 +76,13 @@
<asp:Label ID="Label4" runat="server" Text='<%# Bind("InterFaceForUrl") %>' ToolTip='<%# Bind("InterFaceForUrl") %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<%-- <f:TemplateField Width="100px" HeaderText="频率" ColumnID="ValidPeriod" HeaderTextAlign="Center" ExpandUnusedSpace="true"
<%-- <f:TemplateField Width="100px" HeaderText="频率" ColumnID="ValidPeriod" HeaderTextAlign="Center"
TextAlign="Left">
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("ValidPeriod") %>' ToolTip='<%# Bind("ValidPeriod") %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>--%>
<f:TemplateField Width="350px" HeaderText="目标单位" ColumnID="AuthUnitName" HeaderTextAlign="Center" ExpandUnusedSpace="true"
<f:TemplateField Width="350px" HeaderText="目标单位" ColumnID="AuthUnitName" HeaderTextAlign="Center"
TextAlign="Left">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("AuthUnitName") %>' ToolTip='<%# Bind("AuthUnitName") %>'></asp:Label>
@@ -120,7 +119,7 @@
</f:Panel>
<f:Window ID="Window1" Title="编辑接口配置信息" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Self" EnableResize="true" runat="server" OnClose="Window1_Close" IsModal="true"
Width="800px" Height="380px">
Width="1200px" Height="420px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true"
@@ -1,11 +1,13 @@
namespace FineUIPro.Web.InterFace
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using BLL;
namespace FineUIPro.Web.InterFace
{
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using BLL;
public partial class InterFaceSet : PageBase
{
@@ -17,7 +19,7 @@
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
{
////权限按钮方法
this.GetButtonPower();
btnNew.OnClientClick = Window1.GetShowReference("InterFaceEdit.aspx") + "return false;";
@@ -37,7 +39,7 @@
{
string strSql = "SELECT InterFaceSetId,InterFaceName,InterFaceForUrl,InterFaceUrl,Unit.UnitName as UnitId,AuthUnitName,IsOpen,ValidPeriod,TxtRemarks FROM InterFaceSet"
+ @" AS FaceSet LEFT JOIN Base_Unit AS Unit ON Unit.UnitId = FaceSet.UnitId where 1=1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
if (!string.IsNullOrEmpty(this.txtUserName.Text.Trim()))
{
@@ -54,13 +56,13 @@
strSql += " AND IsOpen = @IsOpen";
listStr.Add(new SqlParameter("@IsOpen", this.cbRoleCategory.Items[0].Selected));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
// 2.获取当前分页数据
//var table = this.GetPagedDataTable(Grid1, tb1);
Grid1.RecordCount = tb.Rows.Count;
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
@@ -76,7 +78,7 @@
{
if (this.CurrUser != null)
{
var buttonList = BLL.CommonService.GetAllButtonList(null,this.CurrUser.UserId, BLL.Const.InterFaceSetMenuId);
var buttonList = BLL.CommonService.GetAllButtonList(string.Empty, this.CurrUser.UserId, BLL.Const.InterFaceSetMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnAdd))
@@ -97,7 +99,7 @@
}
}
#endregion
#region
/// <summary>
/// 批量删除数据
@@ -111,11 +113,11 @@
protected void btnStart_Click(object sender, EventArgs e)
{
Model.CNPCDB db = Funs.DB;
List<Model.InterFaceSet> FaceList = db.InterFaceSet.Where(p=>p.IsOpen==true).ToList();
foreach(var item in FaceList)
List<Model.InterFaceSet> FaceList = db.InterFaceSet.Where(p => p.IsOpen == true).ToList();
foreach (var item in FaceList)
{
// if (!string.IsNullOrEmpty(item.InterFaceUrl))
// APIServiceTimer.GetApiData(item.InterFaceSetId, item.InterFaceUrl);
// if (!string.IsNullOrEmpty(item.InterFaceUrl))
// APIServiceTimer.GetApiData(item.InterFaceSetId, item.InterFaceUrl);
}
}
@@ -125,8 +127,8 @@
List<Model.InterFaceSet> FaceList = db.InterFaceSet.Where(p => p.IsOpen == true).ToList();
foreach (var item in FaceList)
{
// if (!string.IsNullOrEmpty(item.InterFaceForUrl))
// APIServiceTimer.UpApiData(item.InterFaceSetId, item.InterFaceForUrl, item.IsReqPost);
// if (!string.IsNullOrEmpty(item.InterFaceForUrl))
// APIServiceTimer.UpApiData(item.InterFaceSetId, item.InterFaceForUrl, item.IsReqPost);
}
}
/// <summary>
@@ -37,7 +37,7 @@
<f:Button ID="btnEdit" Text="编辑" ToolTip="编辑" Icon="Pencil" runat="server" OnClick="btnEdit_Click"
Hidden="true">
</f:Button>
<f:Button ID="Button1" Text="立即执行" ToolTip="开始执行" Icon="ServerStart" OnClick="btnStart_Click"
<f:Button ID="Button1" Text="执行" ToolTip="开始执行" Icon="SystemSaveNew" OnClick="btnStart_Click"
runat="server">
</f:Button>
</Items>
@@ -1,12 +1,8 @@
namespace FineUIPro.Web.InterFace
{
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using BLL;
using System;
using System.Linq;
namespace FineUIPro.Web.InterFace
{
public partial class InterFaceTask : PageBase
{
/// <summary>
@@ -50,7 +46,7 @@
{
if (this.CurrUser != null)
{
var buttonList = BLL.CommonService.GetAllButtonList(null,this.CurrUser.UserId, BLL.Const.InterFaceTaskMenuId);
var buttonList = BLL.CommonService.GetAllButtonList(string.Empty, this.CurrUser.UserId, BLL.Const.UserMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnModify))
@@ -63,8 +59,6 @@
}
#endregion
#region
/// <summary>
/// 分页
@@ -205,11 +199,6 @@
#endregion
protected void btnStart_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInParent("请至少选择一条记录!", MessageBoxIcon.Warning);
return;
}
var Id = Grid1.SelectedRowID;
BLL.InterFaceTaskService.ExecuteTasks(Id);
}
@@ -16,8 +16,10 @@
<f:FormRow>
<Items>
<f:TextBox ID="txtInterFaceName" runat="server" Label="任务名称" LabelAlign="Right" AutoPostBack="true" LabelWidth="140px"></f:TextBox>
<f:NumberBox ID="txtFrequency" runat="server" NoDecimal="true" NoNegative="false" Label="频率(小时)" MinValue="0" MaxValue="12">
</f:NumberBox>
<%-- <f:NumberBox ID="txtFrequency" runat="server" NoDecimal="true" NoNegative="false" Label="频率(小时)" MinValue="0" MaxValue="12">
</f:NumberBox>--%>
<f:TextBox ID="txtFrequency" runat="server" Label="频率(表达式)" LabelAlign="Right" LabelWidth="140px" >
</f:TextBox>
<f:CheckBox ID="IsEnable" Label="是否启用" runat="server" DisplayType="Switch" Checked="true">
</f:CheckBox>
</Items>
@@ -1,11 +1,8 @@
using BLL;
using Model;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.InterFace
@@ -25,11 +22,13 @@ namespace FineUIPro.Web.InterFace
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack) {
if (!IsPostBack)
{
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
InterFaceTaskId = Request.Params["InterFaceTaskId"];
InterFaceSetService.InitInterFaceDropDownList(DropInterFaceSet, false);
BindGrid();
#region Grid1
// 删除选中单元格的客户端脚本
string deleteScript = GetDeleteScript();
@@ -43,57 +42,53 @@ namespace FineUIPro.Web.InterFace
btnDelete.OnClientClick = Grid1.GetNoSelectionAlertReference("请选择一条记录!") + deleteScript;
#endregion
}
}
private void BindGrid()
{
if (!string.IsNullOrEmpty(InterFaceTaskId))
{
var model = BLL.InterFaceTaskService.GetInterFaceTaskById(InterFaceTaskId);
txtFrequency.Text= model.Frequency;
txtInterFaceName.Text= model.InterFaceName;
txtFrequency.Text = model.Frequency;
txtInterFaceName.Text = model.InterFaceName;
IsEnable.Checked = (bool)model.Enable;
var a = model.InterFaceSetLists.Split(',');
var a = model.InterFaceSetLists.Split(',');
var q = (from x in a select new { id = Guid.NewGuid().ToString(), InterFaceSetId = x.ToString() }).ToList();
Grid1.DataSource= q;
Grid1.DataBind();
Grid1.DataSource = q;
Grid1.DataBind();
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
List<string> list = new List<string>();
JArray EditorArr = Grid1.GetMergedData();
if (EditorArr.Count > 0)
{
{
for (int i = 0; i < EditorArr.Count; i++)
{
JObject objects = (JObject)EditorArr[i];
list.Add(objects["values"]["InterFaceSetId"].ToString());
}
}
if (!string.IsNullOrEmpty(InterFaceTaskId))
{
var model=BLL.InterFaceTaskService.GetInterFaceTaskById(InterFaceTaskId);
model.InterFaceName=txtInterFaceName.Text;
model.Frequency = txtFrequency.Text;
model.InterFaceSetLists=string .Join(",", list);
var model = BLL.InterFaceTaskService.GetInterFaceTaskById(InterFaceTaskId);
model.InterFaceName = txtInterFaceName.Text;
model.Frequency = txtFrequency.Text.Trim();
model.InterFaceSetLists = string.Join(",", list);
model.CreateTime = DateTime.Now;
model.Enable = IsEnable.Checked;
InterFaceTaskService.UpdateInterFaceTask(model);
}
else
{
Model.InterFaceTask model =new Model.InterFaceTask();
Model.InterFaceTask model = new Model.InterFaceTask();
model.InterFaceTaskId = SQLHelper.GetNewID(typeof(Model.InterFaceTask));
InterFaceTaskId = model.InterFaceTaskId;
model.InterFaceName = txtInterFaceName.Text;
model.Frequency = txtFrequency.Text;
model.Frequency = txtFrequency.Text.Trim();
model.InterFaceSetLists = string.Join(",", list);
model.CreateTime = DateTime.Now;
model.Enable = IsEnable.Checked;
@@ -102,12 +97,12 @@ namespace FineUIPro.Web.InterFace
QuartzServices.SyncISchedulerById(InterFaceTaskId);
ShowNotify("保存成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
}
private string GetDeleteScript()
{
return Confirm.GetShowReference("确定删除当前数据吗?", String.Empty, MessageBoxIcon.Question, Grid1.GetDeleteSelectedRowsReference(), String.Empty);
}
}
}
@@ -57,7 +57,7 @@ namespace FineUIPro.Web.InterFace
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtFrequency;
protected global::FineUIPro.TextBox txtFrequency;
/// <summary>
/// IsEnable 控件。