113 lines
2.5 KiB
C#
113 lines
2.5 KiB
C#
using System;
|
|
using System.ComponentModel;
|
|
using System.Windows;
|
|
using BeWo.Validation;
|
|
using BS.Shared.DataContracts;
|
|
using BS.Shared.DataContracts.Compact;
|
|
using BS.Shared.Extensions;
|
|
|
|
namespace BeWo.ViewModel
|
|
{
|
|
public class TeamFolderRightVM : AbstractDCMapperVM<TeamFolderRightDC>
|
|
{
|
|
private DateTime? _End;
|
|
|
|
private string _Notice;
|
|
|
|
private CompactTeamDC _Team;
|
|
|
|
private long? _TeamOid;
|
|
|
|
private long? _BeWoFolderOid;
|
|
|
|
private bool _AllowEdit;
|
|
|
|
private bool _AllowView;
|
|
|
|
public TeamFolderRightVM(TeamFolderRightDC pDC) : base(pDC, pDC.Oid == null) {}
|
|
|
|
public CompactTeamDC Team
|
|
{
|
|
get => _Team;
|
|
|
|
set
|
|
{
|
|
_Team = value;
|
|
if (_Team != null)
|
|
{
|
|
TeamOid = _Team.TeamOid;
|
|
}
|
|
FirePropertyChanged(nameof(Team));
|
|
}
|
|
}
|
|
|
|
public long? TeamOid
|
|
{
|
|
get => _TeamOid;
|
|
|
|
set
|
|
{
|
|
_TeamOid = value;
|
|
FirePropertyChanged(nameof(TeamOid));
|
|
}
|
|
}
|
|
|
|
public long? BeWoFolderOid
|
|
{
|
|
get => _BeWoFolderOid;
|
|
|
|
set
|
|
{
|
|
_BeWoFolderOid = value;
|
|
FirePropertyChanged(nameof(BeWoFolderOid));
|
|
}
|
|
}
|
|
|
|
public bool AllowEdit
|
|
{
|
|
get => _AllowEdit;
|
|
|
|
set
|
|
{
|
|
if (AreDifferent(_AllowEdit, value))
|
|
{
|
|
_AllowEdit = value;
|
|
FirePropertyChanged(nameof(AllowEdit));
|
|
}
|
|
}
|
|
}
|
|
|
|
public bool AllowView
|
|
{
|
|
get => _AllowView;
|
|
|
|
set
|
|
{
|
|
if (AreDifferent(_AllowView, value))
|
|
{
|
|
_AllowView = value;
|
|
FirePropertyChanged(nameof(AllowView));
|
|
}
|
|
}
|
|
}
|
|
|
|
protected override void InitByDataContract(TeamFolderRightDC pDataContract)
|
|
{
|
|
_BeWoFolderOid = pDataContract.BeWoFolderOid;
|
|
_TeamOid = pDataContract.TeamOid;
|
|
_AllowEdit = pDataContract.AllowEdit;
|
|
_AllowView = pDataContract.AllowView;
|
|
}
|
|
|
|
protected override TeamFolderRightDC MapToDataContract(TeamFolderRightDC pDataContract, bool doCommit)
|
|
{
|
|
pDataContract.TeamOid = _TeamOid.Value;
|
|
pDataContract.BeWoFolderOid = _BeWoFolderOid.Value;
|
|
pDataContract.AllowEdit = _AllowEdit;
|
|
pDataContract.AllowView = _AllowView;
|
|
|
|
return pDataContract;
|
|
}
|
|
|
|
}
|
|
} |