Exemple #1
0
        public void HandleSms(MobileAccount sender, int receiver, string text)
        {
            MobileAccount mobileAccount = GetAccountByNumber(receiver);

            mobileAccount.ReceiveSms(sender.Number, text);
            smsJournal.Add(new KeyValuePair <int, int>(sender.Number, receiver));
        }
Exemple #2
0
        public OperatorMessage HandleSms(MobileAccount sender, int receiver, string text)
        {
            MobileAccount mobileAccount = GetAccountByNumber(receiver);

            if (moneyOnAccount[sender.Number] < this.SmsPricing)
            {
                return(new OperatorErrorMessage()
                {
                    Text = "Insufficient funds. You have: $" + moneyOnAccount[sender.Number]
                });
            }
            moneyOnAccount[sender.Number] -= this.SmsPricing;
            mobileAccount.ReceiveSms(sender.Number, text);
            smsJournal.Add(new KeyValuePair <int, int>(sender.Number, receiver));
            return(new OperatorInfoMessage());
        }
Exemple #3
0
        public void HandleSms(MobileAccount sender, int receiver, string text)
        {
            MobileAccount mobileAccount = GetAccountByNumber(receiver);

            mobileAccount.ReceiveSms(sender.Number, text);
        }