Пример #1
0
    void Handle(Input.AddPhoneNumber input)
    {
        var phoneNumber = new PhoneNumber();

        phoneNumber.Contact = (Contact)this.Data;
        PhoneNumbers.Add().Data = phoneNumber;
    }
Пример #2
0
 private void AddNumber()
 {
     PhoneNumbers.Add(new PhoneNumberModel()
     {
         ID = 0, PhoneNumber = EditablePhoneNumber
     });
 }
        private void OnAddPhoneNumberExecute()
        {
            var newNumber = new FriendPhoneNumberWrapper(new FriendPhoneNumber());

            newNumber.PropertyChanged += FriendPhoneNumberWrapper_PropertyChanged;
            PhoneNumbers.Add(newNumber);
            Friend.Model.PhoneNumbers.Add(newNumber.Model);
            newNumber.Number = string.Empty;
        }
Пример #4
0
        private void OnAddNewPhoneNumber()
        {
            var newNumber = new FriendPhoneWrapper(new FriendPhoneNumber());

            newNumber.PropertyChanged += FriendPhoneNumberWrapper_PropertyChanged;
            PhoneNumbers.Add(newNumber);
            Friend.Model.PhoneNumbers.Add(newNumber.Model);
            newNumber.Number = "";
        }
        private void OnAddPhoneExecute()
        {
            var phone = new PhoneNumberWrapper(new PhoneNumber());

            phone.PropertyChanged += PhoneNumbers_PropertyChange;
            PhoneNumbers.Add(phone);
            Friend.Model.PhoneNumbers.Add(phone.Model);
            phone.Number = ""; // trigger validation
        }
Пример #6
0
 public void AddPhoneNumber(string phoneNumber)
 {
     phoneNumber = phoneNumber.Trim();
     if (!HasPhoneNumber(phoneNumber))
     {
         PhoneNumbers.Add(phoneNumber);
         phoneNumberLookup.Add(phoneNumber);
     }
 }
Пример #7
0
        private void OnAddPhoneNumberExecute()
        {
            var newNumber = new FriendPhoneNumberWrapper(new FriendPhoneNumber());

            newNumber.PropertyChanged += FriendPhoneNumberWrapper_PropertyChanged;
            PhoneNumbers.Add(newNumber);
            Friend.Model.PhoneNumbers.Add(newNumber.Model);
            newNumber.Number = ""; // Done to trigger the validation
        }
Пример #8
0
        internal Contact(BinaryReader reader) : this()
        {
            Name         = reader.ReadString();
            EMailAddress = reader.ReadString();
            int nPhones = reader.ReadInt32();

            for (int i = 0; i < nPhones; ++i)
            {
                PhoneNumbers.Add(new PhoneNumber(reader));
            }
        }
        private void OnSavePhoneNumberExecute()
        {
            var newNumber = new FriendPhoneModelWrapper(new FriendPhoneNumber());

            newNumber.PropertyChanged += FriendPhoneModelWrapper_PropertyChanged;

            PhoneNumbers.Add(newNumber);

            Friend.PhoneNumbers.Add(newNumber.Model);
            newNumber.PhoneNumber = "";
        }
Пример #10
0
        private void OnAddPhoneNumberExecute()
        {
            var newNumber = new FriendPhoneNumberWrapper(new FriendPhoneNumber());

            newNumber.PropertyChanged += FriendPhoneNumberWrapperPropertyChangedHandler;

            PhoneNumbers.Add(newNumber);
            Friend.Model.PhoneNumbers.Add(newNumber.Model);

            newNumber.Number = string.Empty; //To trigger validation
        }
Пример #11
0
 public void LoadPhoneNumbers()
 {
     using (SqlCommand command = new SqlCommand("select * from Phone_Numbers where Contact_id = @Contact_id"))
     {
         command.Parameters.Add(DataContext.CreateSqlParameter("@Contact_id", Id));
         DataTable dt = DataContext.ExecuteReader(command);
         foreach (DataRow row in dt.Rows)
         {
             PhoneNumbers.Add(new PhoneNumber(row));
         }
     }
 }
Пример #12
0
        private void AddPhoneNumberExecute()
        {
            Int64 startTicks = Log.EVENT_HANDLER("Enter", Common.LOG_APPNAME);

            var newNumber = new DogPhoneNumberWrapper(new DogPhoneNumber());

            newNumber.PropertyChanged += DogPhoneNumberWrapper_PropertyChanged;
            PhoneNumbers.Add(newNumber);
            Dog.Model.PhoneNumbers.Add(newNumber.Model);
            newNumber.Number = ""; // Trigger validation :-)

            Log.EVENT_HANDLER("Exit", Common.LOG_APPNAME, startTicks);
        }
Пример #13
0
 public bool AddPhoneNumber(PhoneNumber phoneNumber)
 {
     if (phoneNumber == null)
     {
         return(false);
     }
     if (PhoneNumbers.Contains(phoneNumber))
     {
         return(false);
     }
     PhoneNumbers.Add(phoneNumber);
     return(true);
 }
Пример #14
0
 public Billing(IAutoTelephoneStaition station, List <PhoneNumber> phones)
 {
     this.PhoneNumbers = new Dictionary <PhoneNumber, bool>();
     this.Users        = new List <IUser>();
     this.Station      = station;
     this.CallService  = new CallService();
     this.Tarif        = 0.9;
     foreach (var item in phones)
     {
         PhoneNumbers.Add(item, true);
     }
     RegisterHandlerForStation(station);
 }
Пример #15
0
 private void InitializePersonPhoneNumbers(ICollection <PersonPhoneNumber> phoneNumbers)
 {
     foreach (PersonPhoneNumberWrapper wrapper in PhoneNumbers)
     {
         wrapper.PropertyChanged -= PersonPhoneNumberWrapper_PropertyChanged;
     }
     PhoneNumbers.Clear();
     foreach (PersonPhoneNumber personPhoneNumber in phoneNumbers)
     {
         var wrapper = new PersonPhoneNumberWrapper(personPhoneNumber);
         PhoneNumbers.Add(wrapper);
         wrapper.PropertyChanged += PersonPhoneNumberWrapper_PropertyChanged;
     }
 }
Пример #16
0
 private void InitializeClientPhoneNumbers(ICollection <ClientPhoneNumber> phoneNumbers)
 {
     foreach (var wrapper in PhoneNumbers)
     {
         wrapper.PropertyChanged -= ClientPhoneNumberWrapper_PropertyChanged;
     }
     PhoneNumbers.Clear();
     foreach (var clientPhoneNumber in phoneNumbers)
     {
         var wrapper = new ClientPhoneNumberWrapper(clientPhoneNumber);
         PhoneNumbers.Add(wrapper);
         wrapper.PropertyChanged += ClientPhoneNumberWrapper_PropertyChanged;
     }
 }
 private void InitializeFriendPhoneNumbers(ICollection <FriendPhoneNumber> phoneNumbers)
 {
     foreach (var wrapper in PhoneNumbers)
     {
         wrapper.PropertyChanged -= FriendPhoneNumberWrapper_PropertyChanged;
     }
     PhoneNumbers.Clear();
     foreach (var friendPhoneNumber in phoneNumbers)
     {
         var wrapper = new FriendPhoneNumberWrapper(friendPhoneNumber);
         PhoneNumbers.Add(wrapper);
         wrapper.PropertyChanged += FriendPhoneNumberWrapper_PropertyChanged;
     }
 }
Пример #18
0
        private void OnPhoneNumberAndTypeReceived(Dictionary <string, string> phoneNumberAndType)
        {
            if (phoneNumberAndType.Any(keyValuePairReceivedDictionary =>
                                       _phoneNumbersTypeAndPhoneNumber.ContainsValue(keyValuePairReceivedDictionary.Value)))
            {
                MessageBox.Show("Numret är redan tillagt.");
                return;
            }

            ConvertReceivedDictionaryToLocalDictionary(phoneNumberAndType);

            foreach (var phoneNumber in phoneNumberAndType)
            {
                PhoneNumbers.Add(phoneNumber.Value);
            }
        }
Пример #19
0
        private void InitializeFriendPhoneNumbers(IEnumerable <FriendPhoneNumber> phoneNumbers)
        {
            foreach (FriendPhoneNumberWrapper wrapper in PhoneNumbers)
            {
                wrapper.PropertyChanged -= FriendPhoneNumberWrapper_PropertyChanged;
            }

            PhoneNumbers.Clear();

            foreach (FriendPhoneNumber friendPhoneNumber in phoneNumbers)
            {
                FriendPhoneNumberWrapper wrapper = new FriendPhoneNumberWrapper(friendPhoneNumber);
                PhoneNumbers.Add(wrapper);
                wrapper.PropertyChanged += FriendPhoneNumberWrapper_PropertyChanged;
            }
        }
        private void InitPhoneNumber(IEnumerable <PhoneNumber> phoneNumbers)
        {
            foreach (var wrapper in PhoneNumbers)
            {
                wrapper.PropertyChanged -= PhoneNumbers_PropertyChange;
            }


            PhoneNumbers.Clear();
            foreach (var phone in phoneNumbers)
            {
                var wrapper = new PhoneNumberWrapper(phone);
                PhoneNumbers.Add(wrapper);
                wrapper.PropertyChanged += PhoneNumbers_PropertyChange;
            }
        }
Пример #21
0
        public PersonDTO(Person person)
            : this()
        {
            Id        = person.Id;
            FirstName = person.FirstName;
            LastName  = person.LastName;

            for (int i = 0; i < person.PhoneNumbers.Count; i++)
            {
                PhoneNumbers.Add(new PhoneNumberDTO(person.PhoneNumbers[i]));
            }

            for (int i = 0; i < person.Addresses.Count; i++)
            {
                Addresses.Add(new AddressDTO(person.Addresses[i]));
            }
        }
 public Person(int suffix, int AddressCount, int PhoneCount) : this()
 {
     Id        = Guid.NewGuid();
     FirstName = "First" + suffix;
     LastName  = "Last" + suffix;
     DOB       = DateTime.Now;
     Age       = new Random().Next(18, 100);
     for (int i = 0; i < AddressCount; i++)
     {
         var address = new Address(i);
         Addresses["type" + i] = address;
     }
     for (int i = 0; i < PhoneCount; i++)
     {
         PhoneNumbers.Add(new Phone(i));
     }
 }
Пример #23
0
        void IXafEntityObject.OnCreated()
        {
            FirstName       = "Sam";
            TitleOfCourtesy = TitleOfCourtesy.Mr;

            Address1         = objectSpace.CreateObject <Address>();
            Address1.Country = objectSpace.FindObject <Country>(CriteriaOperator.Parse("Name = 'USA'"));
            if (Address1.Country == null)
            {
                Address1.Country      = objectSpace.CreateObject <Country>();
                Address1.Country.Name = "USA";
            }
            Manager = objectSpace.FindObject <Contact>(CriteriaOperator.Parse("FirstName = 'John' && LastName = 'Doe'"));
            PhoneNumber phone1 = objectSpace.FindObject <PhoneNumber>(CriteriaOperator.Parse("Number = '555-0101'"));
            PhoneNumber phone2 = objectSpace.FindObject <PhoneNumber>(CriteriaOperator.Parse("Number = '555-0102'"));

            PhoneNumbers.Add(phone1);
            PhoneNumbers.Add(phone2);
        }
Пример #24
0
        private void InitializeDogPhoneNumbers(ICollection <DogPhoneNumber> phoneNumbers)
        {
            Int64 startTicks = Log.VIEWMODEL("Enter", Common.LOG_APPNAME);

            foreach (var wrapper in PhoneNumbers)
            {
                wrapper.PropertyChanged -= DogPhoneNumberWrapper_PropertyChanged;
            }

            PhoneNumbers.Clear();

            foreach (var phoneNumber in phoneNumbers)
            {
                var wrapper = new DogPhoneNumberWrapper(phoneNumber);
                PhoneNumbers.Add(wrapper);
                wrapper.PropertyChanged += DogPhoneNumberWrapper_PropertyChanged;
            }

            Log.VIEWMODEL("Exit", Common.LOG_APPNAME, startTicks);
        }
        public override void AfterConstruction()
        {
            base.AfterConstruction();

            FirstName       = "Sam";
            TitleOfCourtesy = TitleOfCourtesy.Mr;

            Address1         = new Address(Session);
            Address1.Country = Session.FindObject <Country>(CriteriaOperator.Parse("Name = 'USA'"));
            if (Address1.Country == null)
            {
                Address1.Country      = new Country(Session);
                Address1.Country.Name = "USA";
                Address1.Country.Save();
            }

            Manager = Session.FindObject <Contact>(CriteriaOperator.Parse("FirstName = 'John' && LastName = 'Doe'"));

            PhoneNumber phone1 = Session.FindObject <PhoneNumber>(CriteriaOperator.Parse("Number = '555-0101'"));
            PhoneNumber phone2 = Session.FindObject <PhoneNumber>(CriteriaOperator.Parse("Number = '555-0102'"));

            PhoneNumbers.Add(phone1);
            PhoneNumbers.Add(phone2);
        }
Пример #26
0
 public void addPhoneNumber(PhoneNumber phoneNumber)
 {
     PhoneNumbers.Add(phoneNumber);
 }
Пример #27
0
 public void AddPhone(string phone)
 {
     PhoneNumbers.Add(phone);
 }
Пример #28
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);


            // Set our view from the "main" layout resource



            var PhoneNumberText   = FindViewById <EditText>(Resource.Id.PhoneNumberText);
            var TranslateButton   = FindViewById <Button>(Resource.Id.TranslateButton);
            var CallButton        = FindViewById <Button>(Resource.Id.CallButton);
            var CallHistoryButton = FindViewById <Button>(Resource.Id.CallHistoryButton);

            //  var ValidarButton= FindViewById<Button>(Resource.Id.ValidateButton);
            CallButton.Enabled = false;

            var TranslateNumber = string.Empty;

            TranslateButton.Click += (object sender, System.EventArgs e) =>
            {
                var Translator = new PhoneTranslator();
                TranslateNumber = Translator.ToNumber(PhoneNumberText.Text);
                if (string.IsNullOrWhiteSpace(TranslateNumber))
                {
                    //no hay numero a llamar
                    CallButton.Text    = "Llamar";
                    CallButton.Enabled = false;
                }
                else
                {
                    //Hay un posible numero telefonico a Llamar
                    CallButton.Text    = $"Llamar al {TranslateNumber}";
                    CallButton.Enabled = true;
                }
            };
            CallButton.Click += (object sender, System.EventArgs e) =>

            {
                //Intentar marcar el numero telefonico
                var CallDialog = new AlertDialog.Builder(this);
                CallDialog.SetMessage($"Llamar al numero {TranslateNumber}?");
                CallDialog.SetNeutralButton("Llamar", delegate
                {
                    //Agrega el numero marcado a la lista de numero marcado
                    PhoneNumbers.Add(TranslateNumber);
                    //Habilita el boton Call HistoryButton
                    CallHistoryButton.Enabled = true;


                    //Crear un intento para marcar el numero telefonico
                    var CallIntent = new Android.Content.Intent(Android.Content.Intent.ActionCall);
                    CallIntent.SetData(
                        Android.Net.Uri.Parse($"tel:{TranslateNumber}"));
                    StartActivity(CallIntent);
                });
                CallDialog.SetNegativeButton("Cancelar", delegate { });
                //Mostrar el cuadro de dialogo al usuario y esperar una respuesta.
                CallDialog.Show();
            };

            CallHistoryButton.Click += (sender, e) =>
            {
                var Intent = new Android.Content.Intent(this, typeof(CallHistoryActivity));
                Intent.PutStringArrayListExtra("phone_numbers", PhoneNumbers);
                StartActivity(Intent);
            };

            /* ValidarButton.Click += delegate {
             *   SetContentView(Resource.Layout.layoutValidate);
             *   Validate();
             * };*/
        }
Пример #29
0
 public virtual void AddPhoneNumber(CustomerPhone phone)
 {
     phone.Customer = this;
     PhoneNumbers.Add(phone);
 }
Пример #30
0
 public void addPhone(string phoneNumber)
 {
     PhoneNumbers.Add(phoneNumber);
 }