예제 #1
0
파일: Program.cs 프로젝트: lyumos/Labs
static double ComputeTarification(Abonent abonent)
{
double sum = 0;
sum = sum + abonent.SmsCount * 1;
sum = sum + abonent.CallDurationIncoming * 1;
sum = sum + abonent.CallDurationOutcoming * 3;

return sum;
}
예제 #2
0
파일: Program.cs 프로젝트: lyumos/Labs
static Abonent GetAbonent()
{
var abonent = new Abonent();
abonent.Number = 968247916;

OpenCsv();
while (csvReader.Read())
{
if(csvReader.GetField("msisdn_origin") == "968247916")
{
abonent.CallDurationOutcoming = abonent.CallDurationOutcoming + Convert.ToDouble(csvReader.GetField("call_duration"));
abonent.SmsCount = abonent.SmsCount + int.Parse(csvReader.GetField("sms_number"));
}
if(csvReader.GetField("msisdn_dest") == "968247916")
{
abonent.CallDurationIncoming = abonent.CallDurationIncoming + Convert.ToDouble(csvReader.GetField("call_duration"));
}
}
CloseCsv();

return abonent;
}