コード例 #1
0
ファイル: Group.cs プロジェクト: scuhurricane/Sample-Projects
 private void OnClientRemoved(Client client)
 {
     client.Group = null;
 }
コード例 #2
0
 public void ClientUnchecked(Client client)
 {
     ChangeActiveStatus(client,false);
 }
コード例 #3
0
ファイル: Group.cs プロジェクト: scuhurricane/Sample-Projects
 private void OnClientAdded(Client client)
 {
     client.Group = this;
 }
コード例 #4
0
 private void ChangeActiveStatus(Client client, bool isActive)
 {
     using (IDataContextWrapper dataContext = _dataContextLocator())
     {
         var clientEntity = dataContext.Table<Client>().First(x => x.Id == client.Id);
         clientEntity.IsActive = isActive;
         dataContext.SubmitChanges();
     }
 }
コード例 #5
0
 public void ClientChecked(Client client)
 {
     ChangeActiveStatus(client,true);
 }
コード例 #6
0
 public void ShowBirthdate(Client client)
 {
     MessageBox.Show(((DateTime)client.Birthdate).ToString("M/d/yyyy"));
 }
コード例 #7
0
 public void ShowPhoto(Client client)
 {
     _navigationService.UriFor<PhotoViewModel>().WithParam(x => x.ClientID, client.Id).Navigate();
 }
コード例 #8
0
 public void Edit(Client client)
 {
     _navigationService.UriFor<ClientEditViewModel>().WithParam(x => x.ClientId, client.Id).Navigate();
 }
コード例 #9
0
 public void Delete(Client client)
 {
     using (IDataContextWrapper dataContext = _dataContextLocator())
     {
         var clientEntity = dataContext.Table<Client>().First(x => x.Id == client.Id);
         IsoStorageHelper.DeleteFile(clientEntity.Photo);
         dataContext.DeleteOnSubmit(clientEntity);
         dataContext.SubmitChanges();
     }
     Clients.Remove(client);
 }
コード例 #10
0
        protected override void OnCreated()
        {
            base.OnCreated();

            using (IDataContextWrapper dataContext = _dataContextLocator())
                GroupName = dataContext.Table<Group>().First(g => g.Id == GroupId).GroupName;

            RefreshClients();
            SelectedClient = ClientsList.FirstOrDefault();
        }
コード例 #11
0
 protected override void LoadState()
 {
     GroupName = (string)TombstoningContainer.GetValue(TombstoningVariables.GroupAddClientGroupName);
     RefreshClients();
     long id = (long)TombstoningContainer.GetValue(TombstoningVariables.GroupAddClientSelectedClient);
     SelectedClient = ClientsList.FirstOrDefault(c => c.Id == id);
 }
コード例 #12
0
        public void RemoveClientFromGroup(Client client)
        {
            using (IDataContextWrapper dataContext = _dataContextLocator())
            {
                var clientRecord = dataContext.Table<Client>().FirstOrDefault(x => x.Id == client.Id);
                clientRecord.Group.Clients.Remove(clientRecord); //automatically detach client from group
                dataContext.SubmitChanges();
            }

            Groups.First(x => x.Id == client.GroupId).Clients.Remove(client);
        }