public ContactAddEditViewModel()
 {
     contact             = new RContact();
     IsEdit              = false;
     SaveCommand         = new DelegateCommand(onSave);
     BackOrDeleteCommand = new DelegateCommand(onBack);
 }
 public ContactAddEditViewModel(RContact ct)
 {
     contact = ct;
     IsEdit  = true;
     //RoleSelected = contact.ContactRole;
     SaveCommand         = new DelegateCommand(onSave);
     BackOrDeleteCommand = new DelegateCommand(onDelete);
 }
Exemplo n.º 3
0
        public static void DeleteItemAsync(RContact item)
        {
            var realm = Realm.GetInstance();

            realm.Write(() =>
            {
                realm.Remove(item);
            });
        }
Exemplo n.º 4
0
        public static void UpdateItemAsync(RContact item)
        {
            var realm = Realm.GetInstance();

            realm.Write(() =>
            {
                realm.Add(item, true);
            });
        }
Exemplo n.º 5
0
        public static void InsertItemAsync(RContact item)
        {
            var realm = Realm.GetInstance();
            var genId = 0;
            var list  = GetItemsAsync();

            if (list.Count != 0)
            {
                genId = list.Max(c => c.ContactId);
            }
            realm.Write(() =>
            {
                item.ContactId = genId + 1;
                realm.Add(item);
            });
        }
Exemplo n.º 6
0
 public ContactAddEdit(RContact contact)
 {
     InitializeComponent();
     CTAEViewModel  = new ContactAddEditViewModel(contact);
     BindingContext = CTAEViewModel;
 }