Beispiel #1
0
        public static async Task ContactHandler()
        {
            string content = await ContactContent();

            Dictionary <KiaFields, string> KiaDictionary = new Dictionary <KiaFields, string>();
            GetContacts Contactlist  = Json.Decode <GetContacts>(content);
            ArrayList   custom_field = Json.Decode <GetContacts>(content).Custom_fields;

            foreach (var n in typeof(GetContacts).GetProperties())
            {
                foreach (var KiaFields in Enum.GetValues(typeof(KiaFields)).Cast <KiaFields>().ToDictionary(t => t, t => t.ToString()))
                {
                    string GetField = n.GetValue(Contactlist)?.ToString();

                    if (!string.IsNullOrEmpty(GetField) && KiaFields.Key.ToString().ToUpper() == n.Name.ToUpper())
                    {
                        if (!n.Name.ToUpper().Equals("CUSTOM_FIELDS"))
                        {
                            KiaDictionary[KiaFields.Key] = GetField;//Inserting data to the dictionary
                        }
                        else
                        {
                            string custVal = CustomDataXML(custom_field);
                            KiaDictionary[KiaFields.Key] = custVal;
                        }
                    }
                }
            }
            bool update = Contacts(KiaDictionary);

            await UpdateTask(KiaDictionary, update);
        }
Beispiel #2
0
        GetContacts givenAnGetContactsUseCase()
        {
            var contactRepository = new ContactRepository(contactDatasource);
            var getContacts       = new GetContacts(contactRepository);

            return(getContacts);
        }
Beispiel #3
0
    public object Get(GetContacts request)
    {
        var contacts = request.Id == null?
                       Db.Select <Contact>() :
                           Db.Select <Contact>(x => x.Id == request.Id.ToInt());

        return(contacts);
    }
Beispiel #4
0
 public HomeController()
 {
     _getContacts   = new GetContacts();
     _createContact = new CreateContact();
     _updateContact = new UpdateContact();
     _searchContact = new SearchContact();
     _deleteContact = new DeleteContact();
 }
 public HomeController()
 {
     _getContacts   = new GetContacts();
     _createContact = new CreateContact();
     _updateContact = new UpdateContact();
     _searchContact = new SearchContact();
     _deleteContact = new DeleteContact();
     //_context = new AddressBookContext();
 }
Beispiel #6
0
        public async Task <contacts_Contacts> GetContacts()
        {
            var req = new GetContacts();
            await _sender.Send(req);

            await _sender.Recieve(req);

            return(req.contacts);
        }
Beispiel #7
0
            public object Any(GetContacts request)
            {
                var userId = this.GetUserId();

                return(new GetContactsResponse
                {
                    Results = Contacts.Values
                              .Where(x => x.UserAuthId == userId)
                              .OrderByDescending(x => x.Id)
                              .Map(x => x.ConvertTo <Contact>())
                });
            }
Beispiel #8
0
 public override void OnStart()
 {
     try
     {
         base.OnStart();
         this.HasOptionsMenu = true;
         lvContact           = rootView.FindViewById <ListView>(Resource.Id.lvContact);
         txtSearch           = rootView.FindViewById <EditText>(Resource.Id.etContactSearch);
         var setadapter = new GetContacts(lvContact, Activity, txtSearch);
         setadapter.Execute();
     }
     catch (System.Exception ex)
     {
         new CrashReportAsync("InviteContacts", "OnStart", ex.Message + ex.StackTrace).Execute();
     }
 }
        public async Task <IReadOnlyList <ContactResult> > Handle(GetContacts request, CancellationToken cancellationToken)
        {
            var result = await dataStore.Contacts.GetContactsAsync();


            return(result != null?result
                   .Select(dl =>
                           new ContactResult(
                               dl.Id,
                               dl.FirstName,
                               dl.LastName,
                               dl.Phone,
                               dl.Email,
                               dl.Notes,
                               dl.Tags
                               ))
                   .ToList() : null);
        }
Beispiel #10
0
 public object Any(GetContacts request) =>
 Db.Select <Contact>();
 public object Get(GetContacts request) => new GetContactsResponse
 {
     Results = Contacts.Values.OrderBy(x => x.Name).ToList()
 };