[Browsable( true ) , Description( "当前页记录数" ) , Category( "分页" ) , DefaultValue( 0 )]//这一行是什么意思

本文介绍了一个 C# 分页功能中使用的属性设计方法。该属性用于表示当前页面的记录数量,并通过 VS 的属性面板展示,方便开发者进行配置。

 private   int   pageItemCount;  
  [Browsable(   true   )   ,   Description(   "当前页 记录 数"   )   ,   Category(   "分页"   )   ,   DefaultValue(   0   )]//这一行是什么意思  
        public   int   PageItemCount   {  
  get   {  
  return   pageItemCount;  
  }  
        }   
 

属性的设计时 支持 ,这个属性,会出现在VS的属性面板中的“分页”一组里面

///<summary> ///成品库未发货仓储费 ///</summary> [SugarTable("WFHCPK")] public partial class WFHCPK { public WFHCPK() { } /// <summary> /// Description: /// DefaultValue: /// Nullable:False /// <summary> [Browsable(false)] [DisplayName("")] [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] public int ID { get; set; } /// <summary> /// Description:受损阿米巴 /// DefaultValue: /// Nullable:True /// <summary> /// [Browsable(false)] [DisplayName("受损阿米巴")] public string SSAMB { get; set; } /// <summary> /// Description:责任阿米巴 /// DefaultValue: /// Nullable:True /// <summary> /// [Browsable(false)] [DisplayName("责任阿米巴")] public string ZRAMB { get; set; } /// <summary> /// Description:生产编号 /// DefaultValue: /// Nullable:True /// <summary> /// [Browsable(false)] [DisplayName("生产编号")] public string ProductionNumber { get; set; } /// <summary> /// Description:生产类型 /// DefaultValue: /// Nullable:True /// <summary> /// [Browsable(false)] [DisplayName("生产类型")] public string ProductType { get; set; } /// <summary> /// Description:生产控制方 /// DefaultValue: /// Nullable:True /// <summary> /// [Browsable(false)] [DisplayName("生产控制方")] public string ProductionControl { get; set; } /// <summary> /// Description:主要加工车间 /// DefaultValue: /// Nullable:True /// <summary> /// [Browsable(false)] [DisplayName("主要加工车间")] public string ProductionWorkshop { get; set; } /// <summary> /// Description:成品入库日期 /// DefaultValue: /// Nullable:True /// <summary> /// [Browsable(false)] [DisplayName("成品入库日期")] public DateTime ReceivingDate { get; set; } /// <summary> /// Description:要求发货日期 /// DefaultValue: /// Nullable:True /// <summary> /// [Browsable(false)] [DisplayName("要求发货日期")] public DateTime DispatchDate { get; set; } /// <summary> /// Description:免费仓储天数 /// DefaultValue: /// Nullable:True /// <summary> /// [Browsable(false)] [DisplayName("免费仓储天数")] public int? FreeDays { get; set; } /// <summary> /// Description:已存储天数 /// DefaultValue: /// Nullable:True /// <summary> /// [Browsable(false)] [DisplayName("已存储天数")] public int? StorageDays { get; set; } /// <summary> /// Description:赔偿金额 /// DefaultValue: /// Nullable:True /// <summary> /// [Browsable(false)] [DisplayName("赔偿金额")] public string Amount { get; set; } /// <summary> /// Description:创建人 /// DefaultValue: /// Nullable:True /// <summary> /// [Browsable(false)] [DisplayName("创建人")] public string Creator { get; set; } /// <summary> /// Description:创建时间 /// DefaultValue: /// Nullable:True /// <summary> /// [Browsable(false)] [DisplayName("创建时间")] public DateTime? CreateTime { get; set; } /// <summary> /// Description:更新人 /// DefaultValue: /// Nullable:True /// <summary> /// [Browsable(false)] [DisplayName("更新人")] public string Updater { get; set; } /// <summary> /// Description:更新时间 /// DefaultValue: /// Nullable:True /// <summary> /// [Browsable(false)] [DisplayName("更新时间")] public DateTime? UpdateTime { get; set; } /// <summary> /// Description:上次记录日期 /// DefaultValue: /// Nullable:True /// <summary> [Browsable(false)] [DisplayName("上次记录日期")] public DateTime LastTime { get; set; } 查看全部 }这是我的一个类 Amount列的格式为202507:3170 \r\n 202508:310 现在获取这个类的数据绑定到gridconrol 想要根据amount列的数据动态拆分添加数据列 202507赔偿 202508赔偿 3170 310
07-09
车间生产有一台用电设备 他每次运行24-32小时,开机后后台每十分钟记录一次功率变化,因为一天24小时电价是波动的,现在想要根据一次运行期间记录的功率数据和一天24小时内每小时的电价数据,开发一款自动计算设备最佳开机时间的软件 其中运行时间不是固定的 需要传入参数 提供C#代码其中电价和功率存储在数据中 使用sqlsugar获取 ///<summary> ///区间电价表 ///</summary> [SugarTable("ElectricityPrices")] public partial class ElectricityPrices { public ElectricityPrices() { } /// <summary> /// Description: /// DefaultValue: /// Nullable:False /// <summary> /// [Browsable(false)] [DisplayName("")] [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] public int ID { get; set; } /// <summary> /// Description:起始时间 /// DefaultValue: /// Nullable:True /// <summary> /// [Browsable(false)] [DisplayName("起始时间")] public DateTime StartTime { get; set; } /// <summary> /// Description:结束时间 /// DefaultValue: /// Nullable:True /// <summary> /// [Browsable(false)] [DisplayName("结束时间")] public DateTime EndTime { get; set; } /// <summary> /// Description:价格 /// DefaultValue: /// Nullable:True /// <summary> /// [Browsable(false)] [DisplayName("价格")] public decimal? Price { get; set; } }///<summary> ///电炉功率记录表 ///</summary> [SugarTable("PowerData")] public partial class PowerData { public PowerData() { } /// <summary> /// Description: /// DefaultValue: /// Nullable:False /// <summary> /// [Browsable(false)] [DisplayName("")] [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] public int ID { get; set; } /// <summary> /// Description:炉号 /// DefaultValue: /// Nullable:True /// <summary> /// [Browsable(false)] [DisplayName("炉号")] public string Lh { get; set; } /// <summary> /// Description:时间 /// DefaultValue: /// Nullable:True /// <summary> /// [Browsable(false)] [DisplayName("时间")] public DateTime Time { get; set; } /// <summary> /// Description:功率 /// DefaultValue: /// Nullable:True /// <summary> /// [Browsable(false)] [DisplayName("功率")] public int? Power { get; set; } }
06-14
///<summary> ///区间电价表 ///</summary> [SugarTable("ElectricityPrices")] public partial class ElectricityPrices { public ElectricityPrices() { } /// <summary> /// Description: /// DefaultValue: /// Nullable:False /// <summary> /// [Browsable(false)] [DisplayName("")] [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] public int ID { get; set; } /// <summary> /// Description:起始时间 /// DefaultValue: /// Nullable:True /// <summary> /// [Browsable(false)] [DisplayName("起始时间")] public DateTime StartTime { get; set; } /// <summary> /// Description:结束时间 /// DefaultValue: /// Nullable:True /// <summary> /// [Browsable(false)] [DisplayName("结束时间")] public DateTime EndTime { get; set; } /// <summary> /// Description:价格 /// DefaultValue: /// Nullable:True /// <summary> /// [Browsable(false)] [DisplayName("价格")] public decimal Price { get; set; } } ///<summary> ///电炉功率记录表 ///</summary> [SugarTable("PowerData")] public partial class PowerData { public PowerData() { } /// <summary> /// Description: /// DefaultValue: /// Nullable:False /// <summary> /// [Browsable(false)] [DisplayName("")] [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] public int ID { get; set; } /// <summary> /// Description:炉号 /// DefaultValue: /// Nullable:True /// <summary> /// [Browsable(false)] [DisplayName("炉号")] public string Lh { get; set; } /// <summary> /// Description:时间 /// DefaultValue: /// Nullable:True /// <summary> /// [Browsable(false)] [DisplayName("时间")] public DateTime Time { get; set; } /// <summary> /// Description:功率 /// DefaultValue: /// Nullable:True /// <summary> /// [Browsable(false)] [DisplayName("功率")] public int? Power { get; set; } }// 获取电价数据(整个月的数据) var monthlyPriceData = SQL.Db.Queryable<ElectricityPrices>().ToList(); // 获取功率数据 var powerDataByType = new Dictionary<OnlyElectricity.DeviceType, List<PowerData>> { [OnlyElectricity.DeviceType.A] = SQL.Db.Queryable<PowerData>() .Where(p => p.Lh == "1-25").ToList(), [OnlyElectricity.DeviceType.B] = SQL.Db.Queryable<PowerData>() .Where(p => p.Lh == "27-28").ToList(), [OnlyElectricity.DeviceType.C] = SQL.Db.Queryable<PowerData>() .Where(p => p.Lh == "29-32").ToList() };电价和功率使用这些
06-26
<td><a href="tel:62501" class="phone-link"><i class="fas fa-phone"></i>62501</a></td> <td class="notes-cell"></td> </tr> <tr> <td>热工采购科</td> <td>热工采购科巴</td> <td>一级巴</td> <td><span class="role-tag role-bazhang">巴长</span></td> <td>王青.20142689</td> <td><a href="tel:62111" class="phone-link"><i class="fas fa-phone"></i>62111</a></td> <td class="notes-cell"></td> </tr> <tr> <td>热工采购科</td> <td>热工采购科巴</td> <td>一级巴</td> <td><span class="role-tag role-bazhu">巴助</span></td> <td>柴雪.20160837</td> <td><a href="tel:663216" class="phone-link"><i class="fas fa-phone"></i>663216</a></td> <td class="notes-cell"></td> </tr> </tbody> </table> </div> </div> <div class="footer"> <p>化工装备事业部 © 2025 阿米巴交易平台 | 更新日期: 2025年9月11日</p> </div> </main> </div> </div> </div> </div> <script> // ====================================== // 1. 初始化AmazeUI选项卡(关键修复:自动初始化) // ====================================== $(document).ready(function() { // AmazeUI自动初始化data-am-tabs组件 $('[data-am-tabs]').tabs(); }); // ====================================== // 2. 数据分析页面:模拟数据(保持不变) // ====================================== const dept1Data = { name: "化工装备生产一部", amebas: [ { name: "生产一部综合巴", target: 850000, actual: 820000, rate: 96 }, { name: "碳化硅技术组巴", target: 620000, actual: 640000, rate: 103 }, { name: "换热器车间巴", target: 780000, actual: 730000, rate: 94 }, { name: "特材车间巴", target: 920000, actual: 980000, rate: 107 }, { name: "成型车间巴", target: 710000, actual: 680000, rate: 96 } ] }; const dept2Data = { name: "化工装备生产二部", amebas: [ { name: "生产二部综合巴", target: 760000, actual: 730000, rate: 96 }, { name: "列管换热器巴", target: 580000, actual: 550000, rate: 95 }, { name: "绕管换热器巴", target: 820000, actual: 850000, rate: 104 }, { name: "热工无缝管巴", target: 650000, actual: 620000, rate: 95 }, { name: "下料车间巴", target: 790000, actual: 750000, rate: 95 } ] }; const weeklyData = { name: "周目标达成情况", amebas: [ { name: "生产一部综合巴", target: 195000, actual: 188000 }, { name: "碳化硅技术组巴", target: 145000, actual: 152000 }, { name: "换热器车间巴", target: 175000, actual: 168000 }, { name: "特材车间巴", target: 205000, actual: 215000 }, { name: "成型车间巴", target: 160000, actual: 155000 } ] }; const dailyData = { name: "日目标达成情况", amebas: [ { name: "生产一部综合巴", target: 38000, actual: 36000 }, { name: "碳化硅技术组巴", target: 28000, actual: 29000 }, { name: "换热器车间巴", target: 34000, actual: 32000 }, { name: "特材车间巴", target: 40000, actual: 42000 }, { name: "成型车间巴", target: 31000, actual: 30000 } ] }; // ====================================== // 3. 初始化数据分析表格(保持不变) // ====================================== function initTables() { // 生产一部表格 const dept1TableBody = document.getElementById('dept1-table-body'); dept1Data.amebas.forEach(ameba => { const row = document.createElement('tr'); row.innerHTML = ` <td>${ameba.name}</td> <td>¥${ameba.target.toLocaleString()}</td> <td>¥${ameba.actual.toLocaleString()}</td> <td class="${ameba.rate >= 100 ? 'rate-success' : 'rate-warning'}">${ameba.rate}%</td> `; dept1TableBody.appendChild(row); }); // 生产二部表格 const dept2TableBody = document.getElementById('dept2-table-body'); dept2Data.amebas.forEach(ameba => { const row = document.createElement('tr'); row.innerHTML = ` <td>${ameba.name}</td> <td>¥${ameba.target.toLocaleString()}</td> <td>¥${ameba.actual.toLocaleString()}</td> <td class="${ameba.rate >= 100 ? 'rate-success' : 'rate-warning'}">${ameba.rate}%</td> `; dept2TableBody.appendChild(row); }); } // ====================================== // 4. 初始化ECharts图表(保持不变) // ====================================== function initCharts() { // 生产一部图表 const dept1Chart = echarts.init(document.getElementById('dept1-chart')); dept1Chart.setOption({ tooltip: { trigger: 'axis' }, grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true }, xAxis: { type: 'category', data: dept1Data.amebas.map(a => a.name), axisLabel: { rotate: 30 } }, yAxis: { type: 'value', name: '金额(元)' }, series: [ { name: '目标收入', type: 'bar', data: dept1Data.amebas.map(a => a.target), itemStyle: { color: '#3498db' } }, { name: '实际收入', type: 'bar', data: dept1Data.amebas.map(a => a.actual), itemStyle: { color: '#2ecc71' } } ] }); // 生产二部图表 const dept2Chart = echarts.init(document.getElementById('dept2-chart')); dept2Chart.setOption({ tooltip: { trigger: 'axis' }, grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true }, xAxis: { type: 'category', data: dept2Data.amebas.map(a => a.name), axisLabel: { rotate: 30 } }, yAxis: { type: 'value', name: '金额(元)' }, series: [ { name: '目标收入', type: 'bar', data: dept2Data.amebas.map(a => a.target), itemStyle: { color: '#3498db' } }, { name: '实际收入', type: 'bar', data: dept2Data.amebas.map(a => a.actual), itemStyle: { color: '#2ecc71' } } ] }); // 周目标图表 const weeklyChart = echarts.init(document.getElementById('weekly-chart')); weeklyChart.setOption({ tooltip: { trigger: 'axis' }, legend: { data: ['目标', '实际'], top: 0 }, grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true }, xAxis: { type: 'category', data: weeklyData.amebas.map(a => a.name), axisLabel: { rotate: 30 } }, yAxis: { type: 'value', name: '金额(元)' }, series: [ { name: '目标收入', type: 'bar', data: weeklyData.amebas.map(a => a.target), itemStyle: { color: '#9b59b6' } }, { name: '实际收入', type: 'bar', data: weeklyData.amebas.map(a => a.actual), itemStyle: { color: '#1abc9c' } } ] }); // 日目标图表 const dailyChart = echarts.init(document.getElementById('daily-chart')); dailyChart.setOption({ tooltip: { trigger: 'axis' }, legend: { data: ['目标', '实际'], top: 0 }, grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true }, xAxis: { type: 'category', data: dailyData.amebas.map(a => a.name), axisLabel: { rotate: 30 } }, yAxis: { type: 'value', name: '金额(元)' }, series: [ { name: '目标收入', type: 'bar', data: dailyData.amebas.map(a => a.target), itemStyle: { color: '#e67e22' } }, { name: '实际收入', type: 'bar', data: dailyData.amebas.map(a => a.actual), itemStyle: { color: '#f1c40f' } } ] }); // 窗口resize时重绘图表 window.addEventListener('resize', () => { dept1Chart.resize(); dept2Chart.resize(); weeklyChart.resize(); dailyChart.resize(); }); } // ====================================== // 5. 联系人页面功能(保持不变) // ====================================== function initContactFunctions() { // 导航点击效果 document.querySelectorAll('.nav-link').forEach(link => { link.addEventListener('click', function(e) { // 移除所有active类 document.querySelectorAll('.nav-link').forEach(item => { item.classList.remove('active'); }); // 为当前点击项添加active类 this.classList.add('active'); // 平滑滚动到目标位置 const targetId = this.getAttribute('href'); const targetElement = document.querySelector(targetId); if (targetElement) { window.scrollTo({ top: targetElement.offsetTop - 100, behavior: 'smooth' }); } }); }); // 搜索功能 const searchInput = document.querySelector('.search-box input'); searchInput.addEventListener('input', function() { const searchTerm = this.value.toLowerCase().trim(); document.querySelectorAll('.baba-table tbody tr').forEach(row => { row.style.display = row.textContent.toLowerCase().includes(searchTerm) ? '' : 'none'; }); }); } // ====================================== // 6. 页面加载完成后初始化所有功能 // ====================================== document.addEventListener('DOMContentLoaded', function() { initTables(); initCharts(); initContactFunctions(); }); </script> </body> </html>上述是我一个前端的页面,现在想把数据分析页面的数据从sqlserver数据库获取,前端四个数据表需要获取不同的数据:1、获取Scb为化工装备生产一部 各阿米巴Amoeba的月目标收入、月实际收入 2、获取Scb为化工装备生产二部 各阿米巴Amoeba的月目标收入、月实际收入 3、获取各阿米巴周目标收入、周实际收入 4、获取各阿米巴日目标收入、日实际收入 我的数据类如下 ///<summary> ///阿米巴收入目标配置表 ///</summary> [SugarTable("AmoebaTarget")] public partial class AmoebaTarget { public AmoebaTarget(){ } /// <summary> /// Description: /// DefaultValue: /// Nullable:False /// <summary> // [Browsable(false)] [DisplayName("")] [SugarColumn(IsPrimaryKey=true,IsIdentity=true)] public int ID {get;set;} /// <summary> /// Description:阿米巴 /// DefaultValue: /// Nullable:True /// <summary> // [Browsable(false)] [DisplayName("阿米巴")] public string Amoeba {get;set;} /// <summary> /// Description:所属部门 /// DefaultValue: /// Nullable:True /// <summary> // [Browsable(false)] [DisplayName("所属部门")] public string Dpt {get;set;} /// <summary> /// Description:所属生产部 /// DefaultValue: /// Nullable:True /// <summary> // [Browsable(false)] [DisplayName("所属生产部")] public string Scb {get;set;} /// <summary> /// Description:月目标收入 /// DefaultValue: /// Nullable:True /// <summary> // [Browsable(false)] [DisplayName("月目标收入")] public decimal? TargetIncome_Monthly {get;set;} /// <summary> /// Description:周目标收入 /// DefaultValue: /// Nullable:True /// <summary> // [Browsable(false)] [DisplayName("周目标收入")] public decimal? TargetIncome_Weekly {get;set;} /// <summary> /// Description:日目标收入 /// DefaultValue: /// Nullable:True /// <summary> // [Browsable(false)] [DisplayName("日目标收入")] public decimal? TargetIncome_Dayily {get;set;} /// <summary> /// Description:月实际收入 /// DefaultValue: /// Nullable:True /// <summary> // [Browsable(false)] [DisplayName("月实际收入")] public decimal? ActualIncome_Monthly {get;set;} /// <summary> /// Description:周实际收入 /// DefaultValue: /// Nullable:True /// <summary> // [Browsable(false)] [DisplayName("周实际收入")] public decimal? ActualIncome_Weekly {get;set;} /// <summary> /// Description:日实际收入 /// DefaultValue: /// Nullable:True /// <summary> // [Browsable(false)] [DisplayName("日实际收入")] public decimal? ActualIncome_Dayily {get;set;} /// <summary> /// Description:创建人 /// DefaultValue: /// Nullable:True /// <summary> // [Browsable(false)] [DisplayName("创建人")] public string Creator {get;set;} /// <summary> /// Description:创建时间 /// DefaultValue: /// Nullable:True /// <summary> // [Browsable(false)] [DisplayName("创建时间")] public DateTime? CreateTime {get;set;} /// <summary> /// Description:更新人 /// DefaultValue: /// Nullable:True /// <summary> // [Browsable(false)] [DisplayName("更新人")] public string Updater {get;set;} /// <summary> /// Description:更新时间 /// DefaultValue: /// Nullable:True /// <summary> // [Browsable(false)] [DisplayName("更新时间")] public DateTime? UpdateTime {get;set;} }
最新发布
09-14
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值