feat: 添加Web.config配置并更新E3_ycsys页面功能

- 新增Web.config文件配置数据库连接字符串
- 修改E3_ycsys.aspx.cs从配置文件中读取连接字符串
- 更新SQL查询语句和页面显示字段
- 简化页面样式并调整中英文显示
This commit is contained in:
2025-06-16 14:46:01 +08:00
parent 623254de84
commit c335dc8a80
3 changed files with 32 additions and 25 deletions
+10 -23
View File
@@ -1,36 +1,23 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="E3_ycsys.aspx.cs" Inherits="E3_ycsys" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>功能开关控制</title>
<style>
body { font-family: Arial, sans-serif; margin: 0; padding: 15px; }
.feature { display: flex; justify-content: space-between; align-items: center; padding: 10px; border-bottom: 1px solid #eee; }
.feature-info { flex: 1; }
.feature-name { font-weight: bold; margin-bottom: 5px; }
.feature-desc { color: #666; font-size: 14px; }
.toggle-btn { padding: 5px 10px; border-radius: 4px; border: none; color: white; cursor: pointer; }
.enable { background-color: #4CAF50; }
.disable { background-color: #f44336; }
.status { margin-left: 10px; font-size: 14px; color: #666; }
</style>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
<h2>功能开关控制</h2>
<h2>E3_ycsys</h2>
<asp:Repeater ID="FeaturesRepeater" runat="server">
<ItemTemplate>
<div class="feature">
<div class="feature-info">
<div class="feature-name"><%# Eval("name") %></div>
<div class="feature-desc"><%# Eval("description") %></div>
<div class="feature-name"><%# Eval("khdm") %></div>
<div class="feature-desc"><%# Eval("khmc") %></div>
</div>
<div>
<%# (int)Eval("status") == 1 ?
"<a href='?action=disable&id=" + Eval("id") + "' class='toggle-btn disable'>关闭</a><span class='status'>(已启用)</span>" :
"<a href='?action=enable&id=" + Eval("id") + "' class='toggle-btn enable'>开启</a><span class='status'>(已禁用)</span>" %>
<%# (int)Eval("status") == 1 ?
"<a href='?action=disable&id=" + Eval("khdm") + "' class='toggle-btn disable'>close</a><span class='status'>(opened)</span>" :
"<a href='?action=enable&id=" + Eval("khdm") + "' class='toggle-btn enable'>open</a><span class='status'>(closed)</span>" %>
</div>
</div>
</ItemTemplate>