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; }
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; }