本文整理汇总了C#中GSM.Bill方法的典型用法代码示例。如果您正苦于以下问题:C# GSM.Bill方法的具体用法?C# GSM.Bill怎么用?C# GSM.Bill使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GSM
的用法示例。
在下文中一共展示了GSM.Bill方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StartTest
public static void StartTest()
{
var display = new Display(3, 300);
var battery = new Battery("S.NO.W3TT543");
GSM addPhone = new GSM("Hero", "HTC", 100m, "4ovek", battery, display);
DateTime time = new DateTime(2013, 1, 10, 11, 00, 00);
string number = "08837656282";
int duration = 60;
addPhone.AddCall(time, number, duration);
DateTime time1 = new DateTime(2013, 1, 10, 12, 00, 00);
string number1 = "08957656282";
int duration1 = 135;
addPhone.AddCall(time1, number1, duration1);
DateTime time2 = new DateTime(2013, 1, 10, 12, 05, 00);
string number2 = "08957656282";
int duration2 = 35;
addPhone.AddCall(time2, number2, duration2);
var callHistory = addPhone.CallHistory;
Console.WriteLine();
foreach (var call in callHistory)
{
Console.WriteLine("Call: {0}\t{1}\t{2} secconds", call.Phone, call.Time, call.Duration);
}
Console.WriteLine("The bill is: {0}$", addPhone.Bill(0.37m));
callHistory = callHistory.OrderByDescending(x => x.Duration).ToList();
addPhone.DelCall(callHistory[0]);
Console.WriteLine("After deleting the longest call the bill is: {0}$", addPhone.Bill(0.37m));
addPhone.ClearCallHistory();
Console.WriteLine("Printing call history (should be empty)");
callHistory = addPhone.CallHistory;
foreach (var call in callHistory)
{
Console.WriteLine("Call: {0}\t{1}\t{2} secconds", call.Phone, call.Time, call.Duration);
}
}