Prepare GUI for Customer
This commit is contained in:
parent
5ddf1ac2a3
commit
c661fd8d79
@ -78,10 +78,12 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="Model\Customer.cs" />
|
||||
<Compile Include="Model\Model.cs" />
|
||||
<Compile Include="Model\Location.cs" />
|
||||
<Compile Include="Model\Node.cs" />
|
||||
<Compile Include="Model\SeverityComboBoxItem.cs" />
|
||||
<Compile Include="Repository\CustomerRepository.cs" />
|
||||
<Compile Include="Repository\IRepositoryBase.cs" />
|
||||
<Compile Include="Repository\LocationRepository.cs" />
|
||||
<Compile Include="Repository\LoggingRepository.cs" />
|
||||
@ -90,9 +92,13 @@
|
||||
<Compile Include="ViewModel\Commands\BaseCommand.cs" />
|
||||
<Compile Include="ViewModel\Commands\RelayCommand.cs" />
|
||||
<Compile Include="Validators\StringRangeValidationRule.cs" />
|
||||
<Compile Include="ViewModel\CustomerViewModel.cs" />
|
||||
<Compile Include="ViewModel\LocationTreeBuilder.cs" />
|
||||
<Compile Include="ViewModel\LocationViewModel.cs" />
|
||||
<Compile Include="ViewModel\NavigationViewModel.cs" />
|
||||
<Compile Include="Views\CustomerView.xaml.cs">
|
||||
<DependentUpon>CustomerView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\LocationView.xaml.cs">
|
||||
<DependentUpon>LocationView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@ -113,6 +119,10 @@
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Page Include="Views\CustomerView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\LocationView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
@ -4,7 +4,7 @@
|
||||
xmlns:views="clr-namespace:LoggingClient.Views"
|
||||
xmlns:local="clr-namespace:LoggingClient.ViewModel"
|
||||
Title="MainWindow" Height="470" Width="800" ResizeMode="NoResize">
|
||||
|
||||
|
||||
<Window.Resources>
|
||||
<DataTemplate DataType="{x:Type local:LogViewModel}">
|
||||
<views:LogView/>
|
||||
@ -13,6 +13,11 @@
|
||||
<DataTemplate DataType="{x:Type local:LocationViewModel}">
|
||||
<views:LocationView/>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate DataType="{x:Type local:CustomerViewModel}">
|
||||
<views:CustomerView/>
|
||||
</DataTemplate>
|
||||
|
||||
</Window.Resources>
|
||||
|
||||
<DockPanel LastChildFill="True">
|
||||
@ -24,8 +29,9 @@
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Button Grid.Row="0" Width="400" Content="Locations" Command="{Binding LocationsCommand}" Margin="394,0,-393,0"/>
|
||||
<Button HorizontalAlignment="Right" Width="400" Content="Log Reader" Command="{Binding LogsCommand}" Margin="0,0,2,0"/>
|
||||
<Button HorizontalAlignment="Left" Width="268" Content="Log Reader" Command="{Binding LogsCommand}"/>
|
||||
<Button HorizontalAlignment="Center" Width="265" Content="Locations" Command="{Binding LocationsCommand}" Margin="265,0,-235,0"/>
|
||||
<Button HorizontalAlignment="Right" Width="264" Content="Customers" Command="{Binding CustomersCommand}" Margin="0,0,-498,0"/>
|
||||
</Grid>
|
||||
<ContentControl x:Name="Pages" DockPanel.Dock="Right" Content="{Binding SelectedViewModel}"/>
|
||||
</DockPanel>
|
||||
|
60
LoggingClient/LoggingClient/Model/Customer.cs
Executable file
60
LoggingClient/LoggingClient/Model/Customer.cs
Executable file
@ -0,0 +1,60 @@
|
||||
using System;
|
||||
|
||||
namespace LoggingClient.Model
|
||||
{
|
||||
public class Customer : Model<Customer>
|
||||
{
|
||||
public string FirstName { get; set; }
|
||||
public string LastName { get; set; }
|
||||
public string AddressNumber { get; set; }
|
||||
public int CustomerBankAccountId { get; set; }
|
||||
public string TelephoneNumber { get; set; }
|
||||
public string EmailAddress { get; set; }
|
||||
public string Url { get; set; }
|
||||
public string Password { get; set; }
|
||||
|
||||
public Customer()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Customer(int id, string firstName, string lastName, string addressNumber, int customerBankAccountId, string telephoneNumber, string emailAddress, string url, string password)
|
||||
{
|
||||
this.Id = id;
|
||||
this.FirstName = firstName;
|
||||
this.LastName = lastName;
|
||||
this.AddressNumber = addressNumber;
|
||||
this.CustomerBankAccountId = customerBankAccountId;
|
||||
this.TelephoneNumber = telephoneNumber;
|
||||
this.EmailAddress = emailAddress;
|
||||
this.Url = url;
|
||||
this.Password = password;
|
||||
}
|
||||
public bool Equals(Customer secondCustomerModel)
|
||||
{
|
||||
if (Object.ReferenceEquals(null, secondCustomerModel)) return false;
|
||||
if (Object.ReferenceEquals(this, secondCustomerModel)) return true;
|
||||
|
||||
return String.Equals(FirstName, secondCustomerModel.FirstName) && String.Equals(LastName, secondCustomerModel.LastName) && String.Equals(AddressNumber, secondCustomerModel.AddressNumber);
|
||||
}
|
||||
public override bool Equals(object value)
|
||||
{
|
||||
return Equals(value as Customer);
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
// Choose large primes to avoid hashing collisions
|
||||
const int hashingBase = (int)2166136261;
|
||||
const int hashingMultiplier = 16777619;
|
||||
|
||||
int hash = hashingBase;
|
||||
hash = (hash * hashingMultiplier) ^ (!Object.ReferenceEquals(null, FirstName) ? FirstName.GetHashCode() : 0);
|
||||
hash = (hash * hashingMultiplier) ^ (!Object.ReferenceEquals(null, LastName) ? LastName.GetHashCode() : 0);
|
||||
hash = (hash * hashingMultiplier) ^ (!Object.ReferenceEquals(null, AddressNumber) ? AddressNumber.GetHashCode() : 0);
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -3,9 +3,9 @@ using DuplicateCheckerLib;
|
||||
|
||||
namespace LoggingClient.Model
|
||||
{
|
||||
public class Logging : IEntity
|
||||
public class Logging : Model<Logging>
|
||||
{
|
||||
public int Id { get; set; }
|
||||
//public int Id { get; set; }
|
||||
public string Pod { get; set; }
|
||||
public string Location { get; set; }
|
||||
public string Hostname { get; set; }
|
||||
|
56
LoggingClient/LoggingClient/Repository/CustomerRepository.cs
Executable file
56
LoggingClient/LoggingClient/Repository/CustomerRepository.cs
Executable file
@ -0,0 +1,56 @@
|
||||
using LoggingClient.Model;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace LoggingClient.Repository
|
||||
{
|
||||
public class CustomerRepository : RepositoryBase<Customer>
|
||||
{
|
||||
public CustomerRepository(string connectionString) : base(connectionString)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override string TableName => throw new System.NotImplementedException();
|
||||
|
||||
public override string ColumnsForSelect => throw new System.NotImplementedException();
|
||||
|
||||
public override string ColumnsForAdd => throw new System.NotImplementedException();
|
||||
|
||||
public override string PrimaryKeyFromTable => throw new System.NotImplementedException();
|
||||
|
||||
public override void Add(Customer entity)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public override void CallStoredProcedure(Customer entity)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public override void Delete(Customer entity)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public override List<Customer> GetAll(string whereCondition, Dictionary<string, object> parameterValues)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public override List<Customer> GetAll()
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public override Customer GetSingle<P>(P pkValue)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public override void Update(Customer entity)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
@ -7,6 +7,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using MySql.Data.MySqlClient;
|
||||
using System.Linq.Expressions;
|
||||
using LoggingClient.Model;
|
||||
|
||||
namespace LoggingClient.Repository
|
||||
|
179
LoggingClient/LoggingClient/ViewModel/CustomerViewModel.cs
Executable file
179
LoggingClient/LoggingClient/ViewModel/CustomerViewModel.cs
Executable file
@ -0,0 +1,179 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using DuplicateCheckerLib;
|
||||
using System.Windows.Input;
|
||||
using LoggingClient.Repository;
|
||||
using LoggingClient.Model;
|
||||
using System.Windows;
|
||||
using LoggingClient.ViewModel.Commands;
|
||||
|
||||
namespace LoggingClient.ViewModel
|
||||
{
|
||||
public class CustomerViewModel : INotifyPropertyChanged
|
||||
{
|
||||
private string _txtConnectionString;
|
||||
private readonly DuplicateChecker _dupChecker;
|
||||
|
||||
private ICommand _btnAddDataClick;
|
||||
private ICommand _btnFindDuplicatesClick;
|
||||
private ICommand _btnUpdateDataClick;
|
||||
private ICommand _btnLoadDataClick;
|
||||
private ICommand _btnDeleteDataClick;
|
||||
|
||||
public List<Customer> Customers
|
||||
{
|
||||
get => _customers;
|
||||
set
|
||||
{
|
||||
_customers = value;
|
||||
OnPropertyChanged("Customers");
|
||||
}
|
||||
}
|
||||
private List<Customer> _customers;
|
||||
public Customer NewCustomerEntry { get; set; }
|
||||
|
||||
public CustomerViewModel()
|
||||
{
|
||||
TxtConnectionString = "Server=localhost;Database=inventarisierungsloesung;Uid=root;Pwd=MySQLPassword1234!;";
|
||||
|
||||
Customers = new List<Customer>();
|
||||
NewCustomerEntry = new Customer();
|
||||
_dupChecker = new DuplicateChecker();
|
||||
}
|
||||
public Customer MySelectedItem { get; set; }
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
public string TxtConnectionString
|
||||
{
|
||||
get => _txtConnectionString;
|
||||
set
|
||||
{
|
||||
_txtConnectionString = value;
|
||||
OnPropertyChanged(nameof(TxtConnectionString));
|
||||
}
|
||||
}
|
||||
public ICommand BtnAddDataClick
|
||||
{
|
||||
get
|
||||
{
|
||||
return _btnAddDataClick ?? (_btnAddDataClick = new RelayCommand(
|
||||
x =>
|
||||
{
|
||||
AddData();
|
||||
}));
|
||||
}
|
||||
}
|
||||
public ICommand BtnUpdateDataClick
|
||||
{
|
||||
get
|
||||
{
|
||||
return _btnUpdateDataClick ?? (_btnUpdateDataClick = new RelayCommand(
|
||||
x =>
|
||||
{
|
||||
UpdateData();
|
||||
}));
|
||||
}
|
||||
}
|
||||
public ICommand BtnLoadDataClick
|
||||
{
|
||||
get
|
||||
{
|
||||
return _btnLoadDataClick ?? (_btnLoadDataClick = new RelayCommand(
|
||||
x =>
|
||||
{
|
||||
LoadData();
|
||||
}));
|
||||
}
|
||||
}
|
||||
public ICommand BtnFindDuplicatesClick
|
||||
{
|
||||
get
|
||||
{
|
||||
return _btnFindDuplicatesClick ?? (_btnFindDuplicatesClick = new RelayCommand(
|
||||
x =>
|
||||
{
|
||||
BtnFindDuplicates_Click();
|
||||
}));
|
||||
}
|
||||
}
|
||||
public ICommand BtnDeleteDataClick
|
||||
{
|
||||
get
|
||||
{
|
||||
return _btnDeleteDataClick ?? (_btnDeleteDataClick = new RelayCommand(
|
||||
x =>
|
||||
{
|
||||
DeleteData();
|
||||
}));
|
||||
}
|
||||
}
|
||||
public List<Customer> BtnFindDuplicates_Click()
|
||||
{
|
||||
var customerModelRepository = new CustomerRepository(TxtConnectionString);
|
||||
this.Customers = customerModelRepository.GetAll().ToList();
|
||||
var dupList = _dupChecker.FindDuplicates(Customers);
|
||||
Customers = new List<Customer>(dupList.Cast<Customer>());
|
||||
|
||||
return Customers;
|
||||
}
|
||||
private void LoadData()
|
||||
{
|
||||
try
|
||||
{
|
||||
var customerModelRepository = new CustomerRepository(TxtConnectionString);
|
||||
this.Customers = customerModelRepository.GetAll().ToList();
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("LocationTree"));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Error occurred: " + ex.Message);
|
||||
}
|
||||
}
|
||||
private void AddData()
|
||||
{
|
||||
try
|
||||
{
|
||||
var customerModelRepository = new CustomerRepository(TxtConnectionString);
|
||||
customerModelRepository.Add(this.NewCustomerEntry);
|
||||
this.Customers = customerModelRepository.GetAll().ToList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Error occurred: " + ex.Message);
|
||||
}
|
||||
}
|
||||
private void DeleteData()
|
||||
{
|
||||
try
|
||||
{
|
||||
var customerModelRepository = new CustomerRepository(TxtConnectionString);
|
||||
customerModelRepository.Delete(this.NewCustomerEntry);
|
||||
this.Customers = customerModelRepository.GetAll().ToList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Error occurred: " + ex.Message);
|
||||
}
|
||||
}
|
||||
private void UpdateData()
|
||||
{
|
||||
try
|
||||
{
|
||||
var customerModelRepository = new CustomerRepository(TxtConnectionString);
|
||||
customerModelRepository.Update(this.NewCustomerEntry);
|
||||
this.Customers = customerModelRepository.GetAll().ToList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Error occurred: " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnPropertyChanged(string propertyName)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
@ -9,6 +9,7 @@ namespace WpfControlNugget.ViewModel
|
||||
{
|
||||
public ICommand LogsCommand { get; set; }
|
||||
public ICommand LocationsCommand { get; set; }
|
||||
public ICommand CustomersCommand { get; set; }
|
||||
|
||||
private object _selectedViewModel;
|
||||
public object SelectedViewModel
|
||||
@ -21,6 +22,7 @@ namespace WpfControlNugget.ViewModel
|
||||
{
|
||||
LogsCommand = new BaseCommand(OpenLogs);
|
||||
LocationsCommand = new BaseCommand(OpenLocations);
|
||||
CustomersCommand = new BaseCommand(OpenCustomers);
|
||||
}
|
||||
|
||||
private void OpenLogs(object obj)
|
||||
@ -32,6 +34,10 @@ namespace WpfControlNugget.ViewModel
|
||||
{
|
||||
SelectedViewModel = new LocationViewModel();
|
||||
}
|
||||
private void OpenCustomers(object obj)
|
||||
{
|
||||
SelectedViewModel = new CustomerViewModel();
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
|
155
LoggingClient/LoggingClient/Views/CustomerView.xaml
Executable file
155
LoggingClient/LoggingClient/Views/CustomerView.xaml
Executable file
@ -0,0 +1,155 @@
|
||||
<UserControl x:Class="LoggingClient.Views.CustomerView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:LoggingClient.Views"
|
||||
xmlns:viewModel="clr-namespace:LoggingClient.ViewModel"
|
||||
xmlns:validators="clr-namespace:LoggingClient.Validators"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Control.DataContext>
|
||||
<viewModel:CustomerViewModel/>
|
||||
</Control.DataContext>
|
||||
|
||||
<Grid Height="450" Width="800" Background="#FF89A9B2" >
|
||||
<TextBlock Height="32" HorizontalAlignment="Left" Margin="10,18,0,0" Name="TextBlockHeading" Text="Customers" VerticalAlignment="Top" Width="310" FontSize="20" FontStretch="Normal"/>
|
||||
<Grid HorizontalAlignment="Left" Height="416" VerticalAlignment="Top" Width="773">
|
||||
<DataGrid CanUserAddRows="False" AutoGenerateColumns="False" HorizontalAlignment="Left" SelectedItem="{Binding MySelectedItem, Mode=TwoWay}" Margin="10,55,0,131" Name="DataGridLogs" Width="763" ItemsSource="{Binding Path=Customers}" CanUserResizeRows="False">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Binding="{Binding Path=Id}" Header="id" Width="40" IsReadOnly="True" />
|
||||
<DataGridTextColumn Binding="{Binding Path=FirstName}" Header="First Name" Width="70" IsReadOnly="True" />
|
||||
<DataGridTextColumn Binding="{Binding Path=LastName}" Header="Last Name" Width="70" IsReadOnly="True" />
|
||||
<DataGridTextColumn Binding="{Binding Path=AddressNumber}" Header="AddressNumber" Width="100" IsReadOnly="True" />
|
||||
<DataGridTextColumn Binding="{Binding Path=CustomerBankAccountId}" Header="BankAccountId" Width="100" IsReadOnly="True" />
|
||||
<DataGridTextColumn Binding="{Binding Path=TelephoneNumber}" Header="TelephoneNumber" Width="115" IsReadOnly="True" />
|
||||
<DataGridTextColumn Binding="{Binding Path=EmailAddress}" Header="Email" Width="115" IsReadOnly="True" />
|
||||
<DataGridTextColumn Binding="{Binding Path=Url}" Header="Url" Width="80" IsReadOnly="True" />
|
||||
<DataGridTextColumn Binding="{Binding Path=Password}" Header="Password" Width="71" IsReadOnly="True" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<Button Content="Add" Height="25" HorizontalAlignment="Left" Margin="508,372,0,0" Name="BtnAdd" VerticalAlignment="Top" Width="85" Command="{Binding BtnAddDataClick}">
|
||||
<Button.Style>
|
||||
<Style TargetType="{x:Type Button}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Text.Length, ElementName=EnterCustomerId, UpdateSourceTrigger=PropertyChanged}" Value="0">
|
||||
<Setter Property="IsEnabled" Value="False"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Text.Length, ElementName=EnterPhoneNumber, UpdateSourceTrigger=PropertyChanged}" Value="0">
|
||||
<Setter Property="IsEnabled" Value="False"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Text.Length, ElementName=EnterEmail, UpdateSourceTrigger=PropertyChanged}" Value="0">
|
||||
<Setter Property="IsEnabled" Value="False"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Text.Length, ElementName=EnterWebsite, UpdateSourceTrigger=PropertyChanged}" Value="0">
|
||||
<Setter Property="IsEnabled" Value="False"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Text.Length, ElementName=EnterPassword, UpdateSourceTrigger=PropertyChanged}" Value="0">
|
||||
<Setter Property="IsEnabled" Value="False"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
<!--<Button Content="Find Duplicates" Height="25" HorizontalAlignment="Left" Margin="598,321,0,0" Name="BtnFindDuplicates" VerticalAlignment="Top" Width="85" Command="{Binding BtnFindDuplicatesClick}" />-->
|
||||
<Button Content="Update" Height="25" HorizontalAlignment="Left" Margin="598,372,0,0" Name="BtnUpdate" VerticalAlignment="Top" Width="85" Command="{Binding BtnUpdateDataClick}" />
|
||||
<Button Content="Load Data" Height="25" HorizontalAlignment="Left" Margin="688,321,0,0" Name="BtnLoadData" VerticalAlignment="Top" Width="85" Command="{Binding BtnLoadDataClick}" />
|
||||
<Button Content="Delete" Height="25" HorizontalAlignment="Left" Margin="688,372,0,0" Name="BtnDelete" VerticalAlignment="Top" Width="85" Command="{Binding BtnDeleteDataClick}"/>
|
||||
|
||||
<TextBox HorizontalAlignment="Left" Height="23" Margin="248,22,0,0" TextWrapping="Wrap" Text="{Binding TxtConnectionString}" Name="TxtConnectionString" VerticalAlignment="Top" Width="525" />
|
||||
|
||||
<TextBox HorizontalAlignment="Left" Height="25" Margin="10,321,0,0" TextWrapping="Wrap" Name="EnterFirstName" VerticalAlignment="Top" Width="95">
|
||||
<TextBox.Text>
|
||||
<Binding Path="NewCustomerEntry.FirstName" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
<validators:StringRangeValidationRule
|
||||
MinimumLength="1" MaximumLength="45"
|
||||
ErrorMessage="Message must contain at least 1 character up to 45" />
|
||||
</Binding.ValidationRules>
|
||||
</Binding>
|
||||
</TextBox.Text>
|
||||
</TextBox>
|
||||
<TextBox HorizontalAlignment="Left" Height="25" Margin="110,321,0,0" TextWrapping="Wrap" Name="EnterLastName" VerticalAlignment="Top" Width="95" >
|
||||
<TextBox.Text>
|
||||
<Binding Path="NewCustomerEntry.LastName" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
<validators:StringRangeValidationRule
|
||||
MinimumLength="1" MaximumLength="45"
|
||||
ErrorMessage="Message must contain at least 1 character up to 45" />
|
||||
</Binding.ValidationRules>
|
||||
</Binding>
|
||||
</TextBox.Text>
|
||||
</TextBox>
|
||||
<TextBox HorizontalAlignment="Left" Height="25" Margin="210,321,0,0" TextWrapping="Wrap" Name="EnterAddressNumber" VerticalAlignment="Top" Width="95">
|
||||
<TextBox.Text>
|
||||
<Binding Path="NewCustomerEntry.AddressNumber" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
<validators:StringRangeValidationRule
|
||||
MinimumLength="1" MaximumLength="45"
|
||||
ErrorMessage="Message must contain at least 1 character up to 45" />
|
||||
</Binding.ValidationRules>
|
||||
</Binding>
|
||||
</TextBox.Text>
|
||||
</TextBox>
|
||||
<TextBox HorizontalAlignment="Left" Height="25" Margin="310,321,0,0" TextWrapping="Wrap" x:Name="EnterUrl" VerticalAlignment="Top" Width="95">
|
||||
<Binding Path="NewCustomerEntry.Url" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
<validators:StringRangeValidationRule
|
||||
MinimumLength="1" MaximumLength="30"
|
||||
ErrorMessage="Message must contain at least 1 characters up to 30" />
|
||||
</Binding.ValidationRules>
|
||||
</Binding>
|
||||
</TextBox>
|
||||
<TextBox HorizontalAlignment="Left" Height="25" Margin="10,372,0,0" TextWrapping="Wrap" Name="EnterCustomerAccNr" VerticalAlignment="Top" Width="95">
|
||||
<TextBox.Text>
|
||||
<Binding Path="NewCustomerEntry.CustomerBankAccountId" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
<validators:IntRangeValidationRule
|
||||
MinimumLength="1" MaximumLength="8"/>
|
||||
</Binding.ValidationRules>
|
||||
</Binding>
|
||||
</TextBox.Text>
|
||||
</TextBox>
|
||||
<TextBox HorizontalAlignment="Left" Height="25" Margin="110,372,0,0" TextWrapping="Wrap" Name="EnterPhone" VerticalAlignment="Top" Width="95">
|
||||
<TextBox.Text>
|
||||
<Binding Path="NewCustomerEntry.TelephoneNumber" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
<validators:StringRangeValidationRule
|
||||
MinimumLength="1" MaximumLength="20"
|
||||
ErrorMessage="Message must contain at least 1 character up to 20" />
|
||||
</Binding.ValidationRules>
|
||||
</Binding>
|
||||
</TextBox.Text>
|
||||
</TextBox>
|
||||
<TextBox HorizontalAlignment="Left" Height="25" Margin="210,372,0,0" TextWrapping="Wrap" x:Name="EnterEmail" VerticalAlignment="Top" Width="95">
|
||||
<Binding Path="NewCustomerEntry.EmailAddress" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
<validators:StringRangeValidationRule
|
||||
MinimumLength="1" MaximumLength="30"
|
||||
ErrorMessage="Message must contain at least 1 characters up to 30" />
|
||||
</Binding.ValidationRules>
|
||||
</Binding>
|
||||
</TextBox>
|
||||
<TextBox HorizontalAlignment="Left" Height="25" Margin="310,372,0,0" TextWrapping="Wrap" x:Name="EnterPassword" VerticalAlignment="Top" Width="95">
|
||||
<Binding Path="NewCustomerEntry.Password" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
<validators:StringRangeValidationRule
|
||||
MinimumLength="1" MaximumLength="255"
|
||||
ErrorMessage="Message must contain at least 1 character up to 255" />
|
||||
</Binding.ValidationRules>
|
||||
</Binding>
|
||||
</TextBox>
|
||||
|
||||
<Label Content="Database Connection" HorizontalAlignment="Left" Margin="118,22,0,0" VerticalAlignment="Top" Height="23" Width="125" Background="{x:Null}" RenderTransformOrigin="0.366,0.725"/>
|
||||
<Label Content="Firstname" HorizontalAlignment="Left" Margin="10,290,0,0" VerticalAlignment="Top" Width="95"/>
|
||||
<Label Content="Lastname" HorizontalAlignment="Left" Margin="110,290,0,0" VerticalAlignment="Top" Width="95"/>
|
||||
<Label Content="Addressnumber" HorizontalAlignment="Left" Margin="210,290,0,0" VerticalAlignment="Top" Width="95"/>
|
||||
<Label Content="Url" HorizontalAlignment="Left" Margin="310,291,0,0" VerticalAlignment="Top" Width="95"/>
|
||||
<Label Content="CustomerAccNr" HorizontalAlignment="Left" Margin="10,346,0,0" VerticalAlignment="Top" Width="95"/>
|
||||
<Label Content="Phone" HorizontalAlignment="Left" Margin="110,346,0,0" VerticalAlignment="Top" Width="95"/>
|
||||
<Label Content="Email" HorizontalAlignment="Left" Margin="210,346,0,0" VerticalAlignment="Top" Width="95"/>
|
||||
<Label Content="Password" HorizontalAlignment="Left" Margin="310,347,0,0" VerticalAlignment="Top" Width="95"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
28
LoggingClient/LoggingClient/Views/CustomerView.xaml.cs
Executable file
28
LoggingClient/LoggingClient/Views/CustomerView.xaml.cs
Executable file
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace LoggingClient.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for CustomerView.xaml
|
||||
/// </summary>
|
||||
public partial class CustomerView : UserControl
|
||||
{
|
||||
public CustomerView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
@ -53,10 +53,10 @@
|
||||
</Button>
|
||||
<Button Content="Update" Height="25" HorizontalAlignment="Left" Margin="553,366,0,0" Name="BtnUpdateDataClick" VerticalAlignment="Top" Width="70" Command="{Binding BtnUpdateDataClick}" />-->
|
||||
<Button Content="Load Data" Height="25" HorizontalAlignment="Left" Margin="628,366,0,0" Name="BtnLoadDataClick" VerticalAlignment="Top" Width="70" Command="{Binding BtnLoadDataClick}" />
|
||||
<!--<Button Content="Delete" Height="25" HorizontalAlignment="Left" Margin="703,366,0,0" Name="BtnDeleteDataClick" VerticalAlignment="Top" Width="70" Command="{Binding BtnDeleteDataClick}"/>
|
||||
<!--<Button Content="Delete" Height="25" HorizontalAlignment="Left" Margin="703,366,0,0" Name="BtnDeleteDataClick" VerticalAlignment="Top" Width="70" Command="{Binding BtnDeleteDataClick}"/>-->
|
||||
|
||||
<TextBox HorizontalAlignment="Left" Height="23" Margin="248,22,0,0" TextWrapping="Wrap" Text="{Binding TxtConnectionString}" Name="TxtConnectionString" VerticalAlignment="Top" Width="525" />
|
||||
<TextBox HorizontalAlignment="Left" Height="25" Margin="10,366,0,0" TextWrapping="Wrap" x:Name="LocationId" VerticalAlignment="Top" Width="80" >
|
||||
<!--<TextBox HorizontalAlignment="Left" Height="25" Margin="10,366,0,0" TextWrapping="Wrap" x:Name="LocationId" VerticalAlignment="Top" Width="80" >
|
||||
<Binding Path="NewLocationModelEntry.AddressId" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
<validators:IntRangeValidationRule
|
||||
|
Loading…
Reference in New Issue
Block a user