Click here to Skip to main content
13,050,840 members (72,603 online)
Rate this:
Please Sign up or sign in to vote.
See more: , +
Hi guys,

I'm in the middle of creating a desktop application that allows a user to insert their Organisation details into a database that uses Entity Framework.

So far, I've created CRUD operations to allow the user to add, delete and update data, which was straight forward.

When doing this, I'm using commands, as I am trying to use the MVVM design pattern.

But what I want to achieve is to allow the user to only enter one row of data into the database, so what would be the best way to achieve it?

I've looked at using a Flag as well as using a query. Here is the code I have currently;

private ICommand showAddCommand;
            public ICommand ShowAddCommand
                    if (this.showAddCommand == null)
                        this.showAddCommand = new RelayCommand(this.SaveFormExecute, this.SaveFormCanExecute);
                    return this.showAddCommand;
            private bool SaveFormCanExecute()
                return !string.IsNullOrEmpty(OrganisationName) //...
            private void SaveFormExecute()

so what would be the best way to do this? Any help will be appreciated.

Many thanks,

Posted 17-Jan-13 22:36pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 18 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100