Beispiel #1
0
 //constructor - sets the state
 public CallRecord(string callData, CallRate rate)
 {
     //set the state
     try {
         SetState(callData, rate);
     }
     catch (ArgumentException ae)
     {
         //MessageBox.Show(ae.Message);
     }
     catch (Exception ex)
     {
         //MessageBox.Show(ex.Message);
     }
 }
Beispiel #2
0
        private void SetState(string callData, CallRate rate)
        {
            //split the data, seperated by the comma
            string[] data = callData.Split(',');
            CallType            = data[0];
            CallDate            = data[1];
            CallTime            = data[2];
            CallDuration        = data[3];
            CallFromNumber      = data[4];
            CallToNumber        = data[5];
            CallCompletedStatus = data[6];
            Rate = rate;

            //call method to calculate cost
            _cost = CalcCost(data[0], data[2], data[3]);
        }