private void OnSave(ComposeNewContactModel args)
 { 
     IDbManager dbManager = ObjectPool.Instance.Resolve<IDbManager>();
     IDataCommand db = dbManager.GetDatabase(DatabaseNames.SMSGW);
     if (args.ID == null)
     {
         string id = GenerateID();
         db.Execute("InsertContact", new
         {
             ID = id,
             Name = args.Name,
             PhoneNumber = args.PhoneNumber
         });
     }
     else
     { 
         db.Execute("UpdateContact", new
         {
             ID = args.ID,
             Name = args.Name,
             PhoneNumber = args.PhoneNumber
         });
     } 
     db.Close();
 }
Beispiel #2
0
        private void OnSave(ComposeNewContactModel args)
        {
            IDbManager   dbManager = ObjectPool.Instance.Resolve <IDbManager>();
            IDataCommand db        = dbManager.GetDatabase(DatabaseNames.SMSGW);

            if (args.ID == null)
            {
                string id = GenerateID();
                db.Execute("InsertContact", new
                {
                    ID          = id,
                    Name        = args.Name,
                    PhoneNumber = args.PhoneNumber
                });
            }
            else
            {
                db.Execute("UpdateContact", new
                {
                    ID          = args.ID,
                    Name        = args.Name,
                    PhoneNumber = args.PhoneNumber
                });
            }
            db.Close();
        }
        public void OnCompose(object args)
        {
            ComposeNewContactModel newMessage = new ComposeNewContactModel();

            DialogService.Instance.ShowDialog <Views.Dialogs.ComposeContact>(newMessage);
            ObjectPool.Instance.Resolve <DatabaseCollectionViewSource>().StartSyncronizing();
        }
Beispiel #4
0
        private void OnItemOpen(object args)
        {
            if (args == null)
            {
                return;
            }
            ComposeNewContactModel data = new ComposeNewContactModel();
            Contact contact             = (Contact)args;

            data.ID          = contact.ID;
            data.Name        = contact.Name;
            data.PhoneNumber = contact.PhoneNumber;

            DialogService.Instance.ShowDialog <Views.Dialogs.ComposeContact>(data);
            ObjectPool.Instance.Resolve <DatabaseCollectionViewSource>().StartSyncronizing();
        }
 public void OnCompose(object args)
 {
     ComposeNewContactModel newMessage = new ComposeNewContactModel();
     DialogService.Instance.ShowDialog<Views.Dialogs.ComposeContact>(newMessage);
     ObjectPool.Instance.Resolve<DatabaseCollectionViewSource>().StartSyncronizing();
 }