20220905代码初始化
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProjectSysSet.aspx.cs" Inherits="FineUIPro.Web.CQMS.BaseInfo.ProjectSysSet" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="RegionPanel1" runat="server" />
|
||||
<f:GroupPanel ID="GroupPanel1" Layout="Anchor" Title="项目环境设置" runat="server">
|
||||
<Items>
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
Layout="VBox" BodyPadding="10px" runat="server" RedStarPosition="BeforeText"
|
||||
LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:FormRow runat="server">
|
||||
<Items>
|
||||
<f:NumberBox ID="txtRemindDay" Label="检试验设备到期提醒天数" runat="server"
|
||||
LabelWidth="180px" DecimalPrecision="1" NoNegative="true">
|
||||
</f:NumberBox>
|
||||
<f:Label runat="server"></f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow runat="server">
|
||||
<Items>
|
||||
<f:NumberBox ID="txtStarTime" runat="server" NoDecimal="true" NoNegative="false" Label="月报开始日期" MinValue="1" MaxValue="31"
|
||||
LabelWidth="180" Width="210">
|
||||
</f:NumberBox>
|
||||
<f:NumberBox ID="txtEndTime" NoDecimal="true" NoNegative="false" Label="月报结束日期" LabelWidth="180" Width="210" runat="server" MinValue="1" MaxValue="31">
|
||||
</f:NumberBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:HiddenField ID="hdCheckerId" runat="server">
|
||||
</f:HiddenField>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="保存" ValidateForms="SimpleForm1" OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
<%--<f:Button ID="btnClose" EnablePostBack="false"
|
||||
runat="server" Icon="SystemClose">
|
||||
</f:Button>--%>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
</Items>
|
||||
</f:GroupPanel>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,127 @@
|
||||
using BLL;
|
||||
using System;
|
||||
|
||||
namespace FineUIPro.Web.CQMS.BaseInfo
|
||||
{
|
||||
public partial class ProjectSysSet : PageBase
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
GetButtonPower();
|
||||
Model.Project_Sys_Set CheckEquipmentDay = BLL.Project_SysSetService.GetSysSetBySetName("检试验设备到期提醒天数", this.CurrUser.LoginProjectId);
|
||||
if (CheckEquipmentDay != null)
|
||||
{
|
||||
this.txtRemindDay.Text = CheckEquipmentDay.SetValue;
|
||||
}
|
||||
Model.Project_Sys_Set CheckMonthStartDay = BLL.Project_SysSetService.GetSysSetBySetName("月报开始日期", this.CurrUser.LoginProjectId);
|
||||
if (CheckMonthStartDay != null)
|
||||
{
|
||||
this.txtStarTime.Text = CheckMonthStartDay.SetValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.txtStarTime.Text = "25";
|
||||
}
|
||||
Model.Project_Sys_Set CheckMonthEndDay = BLL.Project_SysSetService.GetSysSetBySetName("月报结束日期", this.CurrUser.LoginProjectId);
|
||||
if (CheckMonthEndDay != null)
|
||||
{
|
||||
this.txtEndTime.Text = CheckMonthEndDay.SetValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.txtEndTime.Text = "24";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
Model.Project_Sys_Set CheckEquipmentDay = BLL.Project_SysSetService.GetSysSetBySetName("检试验设备到期提醒天数", this.CurrUser.LoginProjectId);
|
||||
if (CheckEquipmentDay != null)
|
||||
{
|
||||
|
||||
if (!string.IsNullOrEmpty(this.txtRemindDay.Text.Trim()))
|
||||
{
|
||||
CheckEquipmentDay.SetValue = this.txtRemindDay.Text.Trim();
|
||||
BLL.Project_SysSetService.UpdateSet(CheckEquipmentDay);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.txtRemindDay.Text.Trim()))
|
||||
{
|
||||
Model.Project_Sys_Set newCheckEquipmentDay = new Model.Project_Sys_Set();
|
||||
newCheckEquipmentDay.SetId = SQLHelper.GetNewID(typeof(Model.Project_Sys_Set));
|
||||
|
||||
newCheckEquipmentDay.ProjectId = this.CurrUser.LoginProjectId;
|
||||
newCheckEquipmentDay.SetName = "检试验设备到期提醒天数";
|
||||
newCheckEquipmentDay.SetValue = this.txtRemindDay.Text.Trim();
|
||||
BLL.Project_SysSetService.AddSet(newCheckEquipmentDay);
|
||||
}
|
||||
}
|
||||
Model.Project_Sys_Set CheckMonthStartDay = BLL.Project_SysSetService.GetSysSetBySetName("月报开始日期", this.CurrUser.LoginProjectId);
|
||||
if (CheckMonthStartDay != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.txtStarTime.Text.Trim()))
|
||||
{
|
||||
CheckMonthStartDay.SetValue = this.txtStarTime.Text.Trim();
|
||||
BLL.Project_SysSetService.UpdateSet(CheckMonthStartDay);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.txtStarTime.Text.Trim()))
|
||||
{
|
||||
Model.Project_Sys_Set newCheckEquipmentDay = new Model.Project_Sys_Set();
|
||||
newCheckEquipmentDay.SetId = SQLHelper.GetNewID(typeof(Model.Project_Sys_Set));
|
||||
newCheckEquipmentDay.ProjectId = this.CurrUser.LoginProjectId;
|
||||
newCheckEquipmentDay.SetName = "月报开始日期";
|
||||
newCheckEquipmentDay.SetValue = this.txtStarTime.Text.Trim();
|
||||
BLL.Project_SysSetService.AddSet(newCheckEquipmentDay);
|
||||
}
|
||||
}
|
||||
Model.Project_Sys_Set CheckMonthEndDay = BLL.Project_SysSetService.GetSysSetBySetName("月报结束日期", this.CurrUser.LoginProjectId);
|
||||
if (CheckMonthEndDay != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.txtEndTime.Text.Trim()))
|
||||
{
|
||||
CheckMonthStartDay.SetValue = this.txtEndTime.Text.Trim();
|
||||
BLL.Project_SysSetService.UpdateSet(CheckMonthStartDay);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.txtEndTime.Text.Trim()))
|
||||
{
|
||||
Model.Project_Sys_Set newCheckEquipmentDay = new Model.Project_Sys_Set();
|
||||
newCheckEquipmentDay.SetId = SQLHelper.GetNewID(typeof(Model.Project_Sys_Set));
|
||||
newCheckEquipmentDay.ProjectId = this.CurrUser.LoginProjectId;
|
||||
newCheckEquipmentDay.SetName = "月报结束日期";
|
||||
newCheckEquipmentDay.SetValue = this.txtEndTime.Text.Trim();
|
||||
BLL.Project_SysSetService.AddSet(newCheckEquipmentDay);
|
||||
}
|
||||
}
|
||||
|
||||
Alert.ShowInTop("保存成功!", MessageBoxIcon.Success);
|
||||
}
|
||||
|
||||
#region 判断按钮权限
|
||||
/// <summary>
|
||||
/// 判断按钮权限
|
||||
/// </summary>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.CQMSSysSetMenuId, Const.BtnSave))
|
||||
{
|
||||
this.btnSave.Hidden = false;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.CQMS.BaseInfo {
|
||||
|
||||
|
||||
public partial class ProjectSysSet {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// GroupPanel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.GroupPanel GroupPanel1;
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
/// <summary>
|
||||
/// txtRemindDay 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtRemindDay;
|
||||
|
||||
/// <summary>
|
||||
/// txtStarTime 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtStarTime;
|
||||
|
||||
/// <summary>
|
||||
/// txtEndTime 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtEndTime;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// hdCheckerId 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hdCheckerId;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user