コード例 #1
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();
 }
コード例 #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();
        }
コード例 #3
0
        public void OnCompose(object args)
        {
            ComposeNewContactModel newMessage = new ComposeNewContactModel();

            DialogService.Instance.ShowDialog <Views.Dialogs.ComposeContact>(newMessage);
            ObjectPool.Instance.Resolve <DatabaseCollectionViewSource>().StartSyncronizing();
        }
コード例 #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();
        }
コード例 #5
0
 public void OnCompose(object args)
 {
     ComposeNewContactModel newMessage = new ComposeNewContactModel();
     DialogService.Instance.ShowDialog<Views.Dialogs.ComposeContact>(newMessage);
     ObjectPool.Instance.Resolve<DatabaseCollectionViewSource>().StartSyncronizing();
 }