private void OnClientRemoved(Client client) { client.Group = null; }
public void ClientUnchecked(Client client) { ChangeActiveStatus(client,false); }
private void OnClientAdded(Client client) { client.Group = this; }
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(); } }
public void ClientChecked(Client client) { ChangeActiveStatus(client,true); }
public void ShowBirthdate(Client client) { MessageBox.Show(((DateTime)client.Birthdate).ToString("M/d/yyyy")); }
public void ShowPhoto(Client client) { _navigationService.UriFor<PhotoViewModel>().WithParam(x => x.ClientID, client.Id).Navigate(); }
public void Edit(Client client) { _navigationService.UriFor<ClientEditViewModel>().WithParam(x => x.ClientId, client.Id).Navigate(); }
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); }
protected override void OnCreated() { base.OnCreated(); using (IDataContextWrapper dataContext = _dataContextLocator()) GroupName = dataContext.Table<Group>().First(g => g.Id == GroupId).GroupName; RefreshClients(); SelectedClient = ClientsList.FirstOrDefault(); }
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); }
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); }