Click here to Skip to main content
11,790,613 members (59,255 online)
Rate this: bad
Please Sign up or sign in to vote.
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
0 OriginalGriff 1,154
1 Maciej Los 825
2 KrunalRohit 686
3 ppolymorphe 660
4 CPallini 621

Advertise | Privacy | Mobile
Web04 | 2.8.1509028.1 | Last Updated 18 Jan 2013
Copyright © CodeProject, 1999-2015
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