public EmployeeListViewModel()
        {
            this._employeeListViewModelCollection = new BindingList <EmployeeViewModel>()
            {
                new EmployeeViewModel(new EmployeeModel {
                    EmpName = "Raj"
                }),
                new EmployeeViewModel(new EmployeeModel {
                    EmpName = "Kumar"
                }),
                new EmployeeViewModel(new EmployeeModel {
                    EmpName = "Bala"
                }),
                new EmployeeViewModel(new EmployeeModel {
                    EmpName = "Manigandan"
                }),
                new EmployeeViewModel(new EmployeeModel {
                    EmpName = "Prayag"
                }),
                new EmployeeViewModel(new EmployeeModel {
                    EmpName = "Pavithran"
                }),
                new EmployeeViewModel(new EmployeeModel {
                    EmpName = "Selva"
                })
            };

            //ApplyChangesCommand = new DelegatingCommand(ApplyChanges);
            ApplyChangesCommand = new ApplyChangesCommand((p) => OnApplyChangesCommand(this.EmployeeListViewModelCollection));
        }
        private void ExecuteCreateNewInvoiceLine(object obj)
        {
            var invoiceLine = new InvoiceLine {
                InvoiceID = _invoice.ID, UnitType = (int)UnitTypes.Other, Text = string.Empty
            };

            _invoice.InvoiceLines.Add(invoiceLine);
            InvoiceLines.Add(new InvoiceLineListItemViewModel(invoiceLine));
            ApplyChangesCommand.RaiseCanExecuteChanged();
            //SaveAndCloseCommand.RaiseCanExecuteChanged();
        }
 private void LoadInvoiceLines()
 {
     InvoiceLines = new ObservableCollection <InvoiceLineListItemViewModel>();
     foreach (var invoiceLine in _invoice.InvoiceLines)
     {
         invoiceLine.AcceptChanges();
         InvoiceLines.Add(new InvoiceLineListItemViewModel(invoiceLine));
     }
     ApplyChangesCommand.RaiseCanExecuteChanged();
     //SaveAndCloseCommand.RaiseCanExecuteChanged();
 }
        private void ExecuteDeleteInvoiceLine(object obj)
        {
            _selectedInvoiceLine.InvoiceLine.MarkAsDeleted();

            InvoiceLines.Remove(_selectedInvoiceLine);
            ApplyChangesCommand.RaiseCanExecuteChanged();
            //SaveAndCloseCommand.RaiseCanExecuteChanged();
            //_dataService.SaveInvoice(_invoice).Subscribe(
            //    result =>
            //    {
            //        _invoice = result;

            //        _invoice.MarkAsUnchanged();
            //        _invoice.AcceptChanges();
            //        this.Update();
            //        LoadInvoiceLines();
            //        LoadTimeEntries();
            //    }

            //    );
        }
        private void LoadTimeEntries()
        {
            _dataService.GetTimeEntriesForInvoicing(_invoice.StartDate, _invoice.EndDate, _invoice.CustomerInvoiceGroupId).Subscribe
            (
                notBookedTimeEntries =>
            {
                TimeEntries = new ObservableCollection <TimeEntryListItemViewModel>();

                foreach (var timeEntry in notBookedTimeEntries)
                {
                    timeEntry.AcceptChanges();
                    TimeEntries.Add(new TimeEntryListItemViewModel(timeEntry, _invoice, _userRepository));
                }

                foreach (var timeEntry in _invoice.TimeEntries)
                {
                    timeEntry.AcceptChanges();
                    TimeEntries.Add(new TimeEntryListItemViewModel(timeEntry, _invoice, _userRepository));
                }
                ApplyChangesCommand.RaiseCanExecuteChanged();
                //SaveAndCloseCommand.RaiseCanExecuteChanged();
            }
            );
        }
 private void ExecuteTimeEntryChanged(TimeEntry timeEntry)
 {
     ApplyChangesCommand.RaiseCanExecuteChanged();
     //SaveAndCloseCommand.RaiseCanExecuteChanged();
 }
 private void ExecuteInvoiceLineChanged(InvoiceLine obj)
 {
     _dataService.SaveInvoiceLine(obj);
     ApplyChangesCommand.RaiseCanExecuteChanged();
     //SaveAndCloseCommand.RaiseCanExecuteChanged();
 }