public static bool Connect(IMobileAccount account1, IMobileAccount account2) { if (_repository.Containts(account1.PhoneNumber) && _repository.Containts(account2.PhoneNumber)) { account2.GetCallEvent += ShowMessage; account2.GetCall(account1); return(true); } return(false); }
public static bool Connect(IMobileAccount account1, IMobileAccount account2) { account1 = _repository.GetMobileAccountByPhoneNumber(account1.PhoneNumber); account2 = _repository.GetMobileAccountByPhoneNumber(account2.PhoneNumber); if (account1.PhoneNumber == account2.PhoneNumber) { return(false); } if (_repository.Containts(account1.PhoneNumber) && _repository.Containts(account2.PhoneNumber)) { SendInfoMessage(account1, 1m); account2.GetCallEvent += ShowMessage; account2.GetCall(account1); _repository.SetMobileAccountChanges((MobileAccount)account1); return(true); } return(false); }