40 lines
1.3 KiB
C#
40 lines
1.3 KiB
C#
using BS.Shared;
|
|
using BS.Shared.DataContracts;
|
|
using DevExpress.Mvvm;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace BeWo.ViewModel.ListViewModel
|
|
{
|
|
public class CustomerWohnhilfeListVM : AbstractDCListMapperVM<CustomerWohnhilfeDC, CustomerWohnhilfeVM>
|
|
{
|
|
public DelegateCommand AddWohnhilfeCommand { get; set; }
|
|
public DelegateCommand DeleteWohnhilfeCommand { get; set; }
|
|
|
|
public CustomerVM Customer { get; set; }
|
|
|
|
public CustomerWohnhilfeListVM(CustomerVM vm, IEnumerable<CustomerWohnhilfeDC> wohnhilfe) : base(wohnhilfe)
|
|
{
|
|
Customer = vm;
|
|
|
|
AddWohnhilfeCommand = new DelegateCommand(() => AddNewVMToListAndSelect(true), CanAddWohnhilfe);
|
|
|
|
DeleteWohnhilfeCommand = new DelegateCommand(() => DeleteSelectedVM($"Wohnhilfe '{SelectedVM.Displayname}'"), CanDeleteWohnhilfe);
|
|
//AddWohnhilfeCommand.RaiseCanExecuteChanged();
|
|
}
|
|
|
|
public bool CanAddWohnhilfe()
|
|
{
|
|
return BeWoApp.HasLoggedOnUserRight(UserRightType.Customer_Wohnhilfe_Create);
|
|
}
|
|
|
|
public bool CanDeleteWohnhilfe()
|
|
{
|
|
return BeWoApp.HasLoggedOnUserRight(UserRightType.Customer_Wohnhilfe_Delete);
|
|
}
|
|
}
|
|
}
|