Button Collapse wenn Command CanExecute False ist
Bereich SozialKontakte
This commit is contained in:
@@ -14,18 +14,24 @@ namespace BeWo.Converter
|
||||
return Visibility.Visible;
|
||||
}
|
||||
|
||||
var lMode = true;
|
||||
if (parameter is string s)
|
||||
{
|
||||
bool.TryParse(s, out lMode);
|
||||
}
|
||||
|
||||
if (lMode)
|
||||
if(value is bool b)
|
||||
{
|
||||
return !(bool)value ? Visibility.Collapsed : Visibility.Visible;
|
||||
var lMode = true;
|
||||
if (parameter is string s)
|
||||
{
|
||||
bool.TryParse(s, out lMode);
|
||||
}
|
||||
|
||||
if (lMode)
|
||||
{
|
||||
return !(bool)value ? Visibility.Collapsed : Visibility.Visible;
|
||||
}
|
||||
|
||||
return (bool)value ? Visibility.Collapsed : Visibility.Visible;
|
||||
}
|
||||
|
||||
return (bool)value ? Visibility.Collapsed : Visibility.Visible;
|
||||
// Fange Fälle ab, wo noch nicht mit Command gearbeitet wird
|
||||
return Visibility.Visible;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using BeWo.ViewModel;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Wohnhilfe;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -9,6 +9,16 @@
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance Type=viewmodel:CustomerVM, IsDesignTimeCreatable=true}"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<UserControl.Resources>
|
||||
<Style TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Visibility" Value="Visible" />
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsEnabled}" Value="False">
|
||||
<Setter Property="Visibility" Value="Collapsed" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
<Grid DataContext="{Binding CustomerWohnhilfeListVM}">
|
||||
<Grid.RowDefinitions>
|
||||
@@ -17,7 +27,7 @@
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button Content="Neue Wohnhilfe hinzufügen" Margin="3" Command="{Binding AddWohnhilfeCommand}">
|
||||
<Button.Style>
|
||||
<!--<Button.Style>
|
||||
<Style TargetType="Button"
|
||||
BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Style.Triggers>
|
||||
@@ -26,7 +36,7 @@
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button.Style>-->
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<TabControl Grid.Row="1" Margin="5" ItemsSource="{Binding VMList}" SelectedItem="{Binding SelectedVM}" x:Name="tabcontrol_NotizenKategorien" Visibility="{Binding VMList.Count, Converter={StaticResource CollectionCountToVisibilityConverter}}">
|
||||
|
||||
@@ -837,7 +837,8 @@ namespace BeWo.ViewModel
|
||||
return base.IsDirty || TeamRelations.IsDirty || EmployeeRelations.IsDirty || _EnvironmentPersons.IsDirty ||
|
||||
_EnvironmentOrganisations.IsDirty || _AbsenceTimes.IsDirty || _VarFields.IsDirty ||
|
||||
CostBearers.IsDirty || _IndividualAssessmentSheetCategories.IsDirty ||
|
||||
_PlacementList.IsDirty || _MedVerordnungslisten.IsDirty || _EnvironmentPersonsWithFamily.IsDirty || _Arbeitszeiten.IsDirty || _CustomerFalldatenVM.IsDirty;
|
||||
_PlacementList.IsDirty || _MedVerordnungslisten.IsDirty || _EnvironmentPersonsWithFamily.IsDirty || _Arbeitszeiten.IsDirty ||
|
||||
_CustomerFalldatenVM.IsDirty || _CustomerWohnhilfeListVM.IsDirty;
|
||||
}
|
||||
}
|
||||
public bool IsFemale
|
||||
|
||||
@@ -168,9 +168,6 @@ namespace BeWo.ViewModel.ListViewModel
|
||||
|
||||
public VMType AddNewVMToList(bool pSetAsEdit)
|
||||
{
|
||||
// Muss hier _NewVM oder kann auch NewVM?
|
||||
// Fall: _NevVM is null
|
||||
// Mache unten mal neue Methode, falls das Verhalten gewünscht ist
|
||||
_VMList.Add(_NewVM);
|
||||
|
||||
// _VMList.Sort();
|
||||
@@ -183,6 +180,21 @@ namespace BeWo.ViewModel.ListViewModel
|
||||
return EditVM;
|
||||
}
|
||||
|
||||
public VMType AddNewVMToListAndSelect(bool auto_select)
|
||||
{
|
||||
// Wichtig! NewVM, wenn _NewVM null ist
|
||||
_VMList.Add(NewVM);
|
||||
|
||||
// _VMList.Sort();
|
||||
if (auto_select)
|
||||
{
|
||||
SelectedVM = _NewVM;
|
||||
}
|
||||
|
||||
NewVM = null;
|
||||
return EditVM;
|
||||
}
|
||||
|
||||
public virtual List<DCType> CommitAdded()
|
||||
{
|
||||
return this.VMList.Where(vm => vm.IsNew).Select(vm => vm.CommitToDataContract()).ToList();
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace BeWo.ViewModel.ListViewModel
|
||||
{
|
||||
Customer = vm;
|
||||
|
||||
AddWohnhilfeCommand = new DelegateCommand(() => AddNewVMToList(), CanAddWohnhilfe);
|
||||
AddWohnhilfeCommand = new DelegateCommand(() => AddNewVMToListAndSelect(true), CanAddWohnhilfe);
|
||||
|
||||
DeleteWohnhilfeCommand = new DelegateCommand(() => DeleteSelectedVM($"Wohnhilfe '{SelectedVM.Displayname}'"), CanDeleteWohnhilfe);
|
||||
//AddWohnhilfeCommand.RaiseCanExecuteChanged();
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Wohnhilfe;
|
||||
|
||||
namespace BeWo.Data.Entities
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<property name="ZuLeistendeArbeitsstunden"/>
|
||||
<property name="Hinweis"/>
|
||||
<property name="Termin"/>
|
||||
<property column="FalldatenBearbeitungsstatus" type="BS.Shared.DataContracts.Wohnhilfe.FalldatenBearbeitungsstatus, BS.Shared" name="FalldatenBearbeitungsstatus" />
|
||||
<property column="FalldatenBearbeitungsstatus" type="BS.Shared.DataContracts.FalldatenBearbeitungsstatus, BS.Shared" name="FalldatenBearbeitungsstatus" />
|
||||
<property name="Auftragsruckgabe"/>
|
||||
<property name="Verlauf"/>
|
||||
<property name="AbgeleisteteStunden"/>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Wohnhilfe;
|
||||
using BS.Shared.Extensions;
|
||||
using BS.Shared.Translation;
|
||||
@@ -924,6 +925,11 @@ namespace BS.Shared.Core
|
||||
dict.Add(Angebot.SonstigerStellen, "sonstiger Stellen");
|
||||
dict.Add(Angebot.TragerDerSozialhilfe, "überörtlichen Träger der Sozialhilfe");
|
||||
|
||||
dict.Add(SozialKontakte.Ja, "ja");
|
||||
dict.Add(SozialKontakte.KeineAngabe, "keine Angabe");
|
||||
dict.Add(SozialKontakte.Nein, "nein");
|
||||
dict.Add(SozialKontakte.NichtAbgefragt, "nicht angefragt");
|
||||
|
||||
dict.Add(Krankenversicherung.JaEingeschrankt, "Ja, aber nur eingeschränkt");
|
||||
dict.Add(Krankenversicherung.JaUneingeschrankt, "Ja, in uneingeschränktem Maße");
|
||||
dict.Add(Krankenversicherung.KeineAngabe, "keine Angabe");
|
||||
|
||||
@@ -10,8 +10,20 @@ namespace BS.Shared.DataContracts.Wohnhilfe
|
||||
[DataContract]
|
||||
public class BereichSozialDC : IDataContract
|
||||
{
|
||||
//[DataMember] public SozialeKontakte BeginnSozialeKontakte { get; set; }
|
||||
//[DataMember] public SozialeKontakte EndeSozialeKontakte { get; set; }
|
||||
[DataMember] public SozialKontakte BeginnSozialeKontakte { get; set; }
|
||||
[DataMember] public bool BeginnKontaktPartner { get; set; }
|
||||
[DataMember] public bool BeginnKontaktMindKinder { get; set; }
|
||||
[DataMember] public bool BeginnKontaktVolljahrKinderElternVerwandten { get; set; }
|
||||
[DataMember] public bool BeginnKontaktFreundenBekannten { get; set; }
|
||||
[DataMember] public bool BeginnKontaktSelbsthilfe { get; set; }
|
||||
[DataMember] public bool BeginnKontaktSonstige { get; set; }
|
||||
[DataMember] public SozialKontakte EndeSozialeKontakte { get; set; }
|
||||
[DataMember] public bool EndeKontaktPartner { get; set; }
|
||||
[DataMember] public bool EndeKontaktMindKinder { get; set; }
|
||||
[DataMember] public bool EndeKontaktVolljahrKinderElternVerwandten { get; set; }
|
||||
[DataMember] public bool EndeKontaktFreundenBekannten { get; set; }
|
||||
[DataMember] public bool EndeKontaktSelbsthilfe { get; set; }
|
||||
[DataMember] public bool EndeKontaktSonstige { get; set; }
|
||||
[DataMember] public Krankenversicherung BeginnKrankenversicherung{ get; set; }
|
||||
[DataMember] public Krankenversicherung EndeKrankenversicherung{ get; set; }
|
||||
[DataMember] public KontaktArzt BeginnKontaktArzt{ get; set; }
|
||||
@@ -19,6 +31,14 @@ namespace BS.Shared.DataContracts.Wohnhilfe
|
||||
[DataMember] public VorlageSchwerbehindertenausweises VorlageSchwerbehindertenausweises { get; set; }
|
||||
}
|
||||
|
||||
public enum SozialKontakte
|
||||
{
|
||||
Nein = 1,
|
||||
Ja = 2,
|
||||
KeineAngabe = 99,
|
||||
NichtAbgefragt = 0
|
||||
}
|
||||
|
||||
public enum Krankenversicherung
|
||||
{
|
||||
Nein = 1,
|
||||
|
||||
@@ -5,7 +5,7 @@ using System.Runtime.Serialization;
|
||||
using BS.Shared.Core;
|
||||
using BS.Shared.DataContracts.Compact;
|
||||
|
||||
namespace BS.Shared.DataContracts.Wohnhilfe
|
||||
namespace BS.Shared.DataContracts
|
||||
{
|
||||
public enum FalldatenBearbeitungsstatus
|
||||
{
|
||||
@@ -175,7 +175,7 @@
|
||||
<Compile Include="DataContracts\Wohnhilfe\BereichBundDC.cs" />
|
||||
<Compile Include="DataContracts\Wohnhilfe\BereichEinkommenUndArbeitDC.cs" />
|
||||
<Compile Include="DataContracts\Wohnhilfe\BereichSozialDC.cs" />
|
||||
<Compile Include="DataContracts\Wohnhilfe\FalldatenDC.cs" />
|
||||
<Compile Include="FalldatenDC.cs" />
|
||||
<Compile Include="DataContracts\BeWoDataContract.cs" />
|
||||
<Compile Include="DataContracts\HilfeplanImportDC.cs" />
|
||||
<Compile Include="DataContracts\HilfeplanImportZielDC.cs" />
|
||||
|
||||
@@ -16,8 +16,6 @@ namespace TranslationUnitTest
|
||||
[TestInitialize]
|
||||
public void Init()
|
||||
{
|
||||
Dict = EnumTranslations.UserRightType2Translations;
|
||||
|
||||
UserRightTypesVersion1dot0 = new List<UserRightType>() {
|
||||
UserRightType.None,
|
||||
UserRightType.DeleteAll,
|
||||
@@ -252,6 +250,8 @@ UserRightType.Signature_ProvideMonthlySignatureByProxy,
|
||||
[TestMethod]
|
||||
public void DictionaryComplete()
|
||||
{
|
||||
Dict = EnumTranslations.UserRightType2Translations;
|
||||
|
||||
foreach (UserRightType item in Enum.GetValues(typeof(UserRightType)))
|
||||
{
|
||||
if (item != UserRightType.None && !Dict.ContainsKey(item))
|
||||
|
||||
Reference in New Issue
Block a user