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(); }
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(); }
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(); }