zoukankan      html  css  js  c++  java
  • 生成求十二个月和的codesmith源代码

    <%--
    Name:
    Author:
    Description:
    --%>
    <%@ CodeTemplate Language="C#" TargetLanguage="T-SQL" ResponseEncoding="UTF-8"   Src="" Inherits="" Debug="False" Description="Template description here." %>

    <%for(int i=1;i<=13;i++){%>
    private decimal _Totalsl<%=i%>;
    <%}%>

       if(e.Item.ItemType==ListItemType.Item || e.Item.ItemType==ListItemType.AlternatingItem)
       {//相加
        
        
        <%for(int i=1;i<=13;i++){%>
        decimal sl<%=i%> = Convert.ToDecimal(e.Item.Cells[<%=i+5%>].Text);
                    _Totalsl<%=i%> += sl<%=i%>;
        <%}%>
       }
       else if(e.Item.ItemType==ListItemType.Footer)
       {//总和
        e.Item.Cells[0].Text = "合计:";
                    e.Item.Cells[0].HorizontalAlign = HorizontalAlign.Right;
                    e.Item.Cells[0].CssClass = "ItemStyleRightBold";
        <%for(int i=1;i<=13;i++){%>
                    e.Item.Cells[<%=i+5%>].Text = string.Format("{0:0.00}", _Totalsl<%=i%>);
                    e.Item.Cells[<%=i+5%>].CssClass = "ItemStyleRightBold";
        <%}%>
       }

  • 相关阅读:
    Django中间件
    cookies与session
    Django Form组件
    Django 自定义分页器
    Django 批量插入数据
    Ajax
    图书管理系统
    Django常用字段及参数、事务、数据库查询优化
    Django之F与Q查询
    课堂测试-统计单词个数和字母出现频率
  • 原文地址:https://www.cnblogs.com/hhq80/p/1074086.html
Copyright © 2011-2022 走看看