Esempio n. 1
0
 public async Task CreateCommunication(CommunicationModel communication, bool isSms, double duration)
 {
     communication.Time   = DateTime.Now;
     communication.LineId = communication.Line.LineId;
     if (isSms)
     {
         SMSDto sms = ModelExtensions.ToSms(communication);
         if (sms != null)
         {
             await invoice.AddSMSAsync(sms);
         }
     }
     else
     {
         CallsDto call = ModelExtensions.ToCall(communication, duration);
         if (call != null)
         {
             await invoice.AddCallAsync(call);
         }
     }
 }