当前位置: 首页>>代码示例>>C#>>正文


C# Student.feePayable方法代码示例

本文整理汇总了C#中Student.feePayable方法的典型用法代码示例。如果您正苦于以下问题:C# Student.feePayable方法的具体用法?C# Student.feePayable怎么用?C# Student.feePayable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Student的用法示例。


在下文中一共展示了Student.feePayable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DisplayStudentInfo

    protected void DisplayStudentInfo(Student student, String type)
    {
        // Output the student's name and type to the page
        lblStudentInfoName.Text = student.Name;
        lblStudentInfoType.Text = student.ToString();

        // Display the success page
        studentInfo.Visible = true;

        // Generate the table header
        var tHead = new TableHeaderRow();
        tblCourses.Rows.Add(tHead);

        var tHeadCellCode = new TableHeaderCell();
        var tHeadCellTitle = new TableHeaderCell();
        var tHeadCellHours = new TableHeaderCell();
        var tHeadCellFee = new TableHeaderCell();

        tHeadCellCode.Text = "Course Code";
        tHeadCellTitle.Text = "Course Title";
        tHeadCellHours.Text = "Weekly Hours";
        tHeadCellFee.Text = "Fee Payable";

        tHead.Cells.Add(tHeadCellCode);
        tHead.Cells.Add(tHeadCellTitle);
        tHead.Cells.Add(tHeadCellHours);
        tHead.Cells.Add(tHeadCellFee);

        // Table generation loop
        foreach (Course course in student.getEnrolledCourses())
        {
            // Start creating the table rows
            var tRow = new TableRow();
            tblCourses.Rows.Add(tRow);

            // Now the table cells
            var tCellCode = new TableCell();
            var tCellTitle = new TableCell();
            var tCellHours = new TableCell();
            var tCellFee = new TableCell();

            tCellCode.Text = course.Code;
            tCellTitle.Text = course.Title;
            tCellHours.Text = Convert.ToString(course.WeeklyHours);
            tCellFee.Text = Convert.ToString(String.Format("{0:C0}", course.Fee));

            tRow.Cells.Add(tCellCode);
            tRow.Cells.Add(tCellTitle);
            tRow.Cells.Add(tCellHours);
            tRow.Cells.Add(tCellFee);
        }

        // Generate the table footer
        var tFoot = new TableRow();
        tblCourses.Rows.Add(tFoot);

        var tFootTotalLabel = new TableCell();
        var tFootTotalRows = new TableCell();
        var tFootTotal = new TableCell();

        tFootTotalLabel.Text = "Total";
        tFootTotalLabel.HorizontalAlign = HorizontalAlign.Right;
        tFootTotalLabel.ColumnSpan = 2;
        tFootTotalRows.Text = Convert.ToString(student.totalWeeklyHours());
        tFootTotal.Text = Convert.ToString(String.Format("{0:C0}", student.feePayable()));

        tFoot.Cells.Add(tFootTotalLabel);
        tFoot.Cells.Add(tFootTotalRows);
        tFoot.Cells.Add(tFootTotal);
    }
开发者ID:egnsh93,项目名称:CST8253,代码行数:70,代码来源:CourseRegistration.aspx.cs


注:本文中的Student.feePayable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。