예제 #1
0
        public async Task <bool> UpdateContact(string email, SBResponseAllContacts.Contacts contact, string nuevoEmail)
        {
            var  jsonContent = serializeModel.SerializerDataUpdateContact(contact, nuevoEmail);
            bool result      = await contactRepository.UpdateContact(jsonContent, email);

            return(result);
        }
        public string  SerializerDataUpdateContact(SBResponseAllContacts.Contacts contacto, string nuevoEmail)
        {
            UpdateContactModel dataContact = new UpdateContactModel();

            dataContact.attributes         = new UpdateContactModel.Attributes();
            dataContact.attributes.NOMBRE  = contacto.attributes.NOMBRE;
            dataContact.attributes.SURNAME = contacto.attributes.SURNAME;
            dataContact.attributes.Email   = nuevoEmail;
            if (!string.IsNullOrEmpty(contacto.attributes.SMS))
            {
                dataContact.attributes.SMS = contacto.attributes.SMS;
            }
            else
            {
                dataContact.attributes.SMS = string.Empty;
            }

            dataContact.email               = contacto.email;
            dataContact.listIds             = new List <int>();
            dataContact.listIds             = contacto.listIds;
            dataContact.emailBlacklisted    = false;
            dataContact.smsBlacklisted      = false;
            dataContact.unlinkListIds       = new List <int>();
            dataContact.smtpBlacklistSender = new List <string>();

            return(JsonConvert.SerializeObject(dataContact));
        }
예제 #3
0
        public async Task <bool> UpdateContactAsync(string email, SBResponseAllContacts.Contacts contacto, string nuevoEmail)
        {
            var contactRepository = new ContactRepository();
            var serializeModel    = new SerializeModel();
            var procesor          = new Procesor(serializeModel, contactRepository);
            var result            = await procesor.UpdateContact(email, contacto, nuevoEmail);

            return(result);
        }
        private void dgv_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            DataGridViewRow row = dgv.CurrentRow;

            email            = row.Cells["EMAIL"].Value.ToString();
            dataContact      = new SBResponseAllContacts.Contacts();
            dataContact      = listaContactos.contacts.Where(x => x.email == email).FirstOrDefault();
            txtNombre.Text   = dataContact.attributes.NOMBRE;
            txtApellido.Text = dataContact.attributes.SURNAME;
            txtEmail.Text    = dataContact.email;
            txtTelefono.Text = dataContact.attributes.SMS;
        }