本文整理汇总了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);
}