Add EF Functionality on Delete, Add
This commit is contained in:
parent
85b4d92c23
commit
ef9b30d65d
@ -9,10 +9,9 @@
|
||||
|
||||
namespace LoggingClient.Model
|
||||
{
|
||||
using Org.BouncyCastle.Asn1.TeleTrust;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
public partial class Customer
|
||||
{
|
||||
public long customer_id { get; set; }
|
||||
@ -39,5 +38,5 @@ namespace LoggingClient.Model
|
||||
this.url = URL;
|
||||
this.password = Password;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
<Key>
|
||||
<PropertyRef Name="customer_id" />
|
||||
</Key>
|
||||
<Property Name="customer_id" Type="bigint" Nullable="false" />
|
||||
<Property Name="customer_id" Type="bigint" Nullable="false" StoreGeneratedPattern="Identity" />
|
||||
<Property Name="firstname" Type="nvarchar" MaxLength="45" Nullable="false" />
|
||||
<Property Name="lastname" Type="nvarchar" MaxLength="45" Nullable="false" />
|
||||
<Property Name="customernumber" Type="nvarchar" MaxLength="45" Nullable="false" />
|
||||
@ -31,7 +31,7 @@
|
||||
<Key>
|
||||
<PropertyRef Name="customer_id" />
|
||||
</Key>
|
||||
<Property Name="customer_id" Type="Int64" Nullable="false" />
|
||||
<Property Name="customer_id" Type="Int64" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
|
||||
<Property Name="firstname" Type="String" MaxLength="45" FixedLength="false" Unicode="true" Nullable="false" />
|
||||
<Property Name="lastname" Type="String" MaxLength="45" FixedLength="false" Unicode="true" Nullable="false" />
|
||||
<Property Name="customernumber" Type="String" MaxLength="45" FixedLength="false" Unicode="true" Nullable="false" />
|
||||
|
@ -2,56 +2,66 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
|
||||
namespace LoggingClient.Repository
|
||||
{
|
||||
public class CustomerRepositoryEF : RepositoryBase<Customer>
|
||||
public class CustomerRepositoryEF
|
||||
{
|
||||
public CustomerRepositoryEF(string connectionString) : base(connectionString)
|
||||
public CustomerRepositoryEF()
|
||||
{
|
||||
Customers = new List<Customer>();
|
||||
}
|
||||
public List<Customer> Customers { get; set; }
|
||||
public override string TableName => throw new NotImplementedException();
|
||||
|
||||
public override string ColumnsForSelect => throw new NotImplementedException();
|
||||
public void Add(Customer newCustomerEntry)
|
||||
{
|
||||
using (var context = new inventarisierungsloesungEntities())
|
||||
{
|
||||
var customer = new Customer()
|
||||
{
|
||||
firstname = newCustomerEntry.firstname,
|
||||
lastname = newCustomerEntry.lastname,
|
||||
customernumber = newCustomerEntry.customernumber,
|
||||
kundenkonto_fk = newCustomerEntry.kundenkonto_fk,
|
||||
tel = newCustomerEntry.tel,
|
||||
email = newCustomerEntry.email,
|
||||
url = newCustomerEntry.url,
|
||||
password = newCustomerEntry.password
|
||||
};
|
||||
context.Customer.Add(customer);
|
||||
context.SaveChanges();
|
||||
}
|
||||
}
|
||||
|
||||
public override string ColumnsForAdd => throw new NotImplementedException();
|
||||
public void Delete(Customer entity)
|
||||
{
|
||||
using (var context = new inventarisierungsloesungEntities())
|
||||
{
|
||||
var deleteCustomer = context.Customer.Where(c => c.customer_id == entity.customer_id).FirstOrDefault();
|
||||
context.Customer.Remove(deleteCustomer);
|
||||
context.SaveChanges();
|
||||
}
|
||||
}
|
||||
|
||||
public override string PrimaryKeyFromTable => throw new NotImplementedException();
|
||||
|
||||
public override void Add(Customer entity)
|
||||
public List<Customer> GetAll(string whereCondition, Dictionary<string, object> parameterValues)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void CallStoredProcedure(Customer entity)
|
||||
public List<Customer> GetAll()
|
||||
{
|
||||
using (var context = new inventarisierungsloesungEntities())
|
||||
{
|
||||
return context.Customer.ToList();
|
||||
}
|
||||
}
|
||||
|
||||
public Customer GetSingle<P>(P pkValue)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void Delete(Customer entity)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override List<Customer> GetAll(string whereCondition, Dictionary<string, object> parameterValues)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override List<Customer> GetAll()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override Customer GetSingle<P>(P pkValue)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void Update(Customer entity)
|
||||
public void Update(Customer entity)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ namespace LoggingClient.ViewModel
|
||||
private ICommand _btnLoadDataClick;
|
||||
private ICommand _btnDeleteDataClick;
|
||||
|
||||
private List<Customer> _customers;
|
||||
public List<Customer> Customers
|
||||
{
|
||||
get => _customers;
|
||||
@ -31,12 +32,21 @@ namespace LoggingClient.ViewModel
|
||||
OnPropertyChanged("Customers");
|
||||
}
|
||||
}
|
||||
private List<Customer> _customers;
|
||||
|
||||
public Customer NewCustomerEntry { get; set; }
|
||||
|
||||
private bool _EfIsChecked;
|
||||
private bool _LinqIsChecked;
|
||||
private long _customerId;
|
||||
public long customer_id
|
||||
{
|
||||
get { return _customerId; }
|
||||
set
|
||||
{
|
||||
_customerId = value;
|
||||
OnPropertyChanged(nameof(customer_id));
|
||||
}
|
||||
}
|
||||
|
||||
private bool _EfIsChecked;
|
||||
public bool EfIsChecked
|
||||
{
|
||||
get { return _EfIsChecked; }
|
||||
@ -47,6 +57,7 @@ namespace LoggingClient.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
private bool _LinqIsChecked;
|
||||
public bool LinqIsChecked
|
||||
{
|
||||
get { return _LinqIsChecked; }
|
||||
@ -56,6 +67,7 @@ namespace LoggingClient.ViewModel
|
||||
OnPropertyChanged(nameof(LinqIsChecked));
|
||||
}
|
||||
}
|
||||
public Customer SelectedItem { get; set; }
|
||||
|
||||
public CustomerViewModel()
|
||||
{
|
||||
@ -145,13 +157,10 @@ namespace LoggingClient.ViewModel
|
||||
{
|
||||
if (_EfIsChecked)
|
||||
{
|
||||
// TODO Implement Repository-Pattern
|
||||
try
|
||||
{
|
||||
using (var context = new inventarisierungsloesungEntities())
|
||||
{
|
||||
Customers = context.Customer.ToList();
|
||||
}
|
||||
var customerModelRepositoryEF = new CustomerRepositoryEF();
|
||||
Customers = customerModelRepositoryEF.GetAll();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -162,12 +171,12 @@ namespace LoggingClient.ViewModel
|
||||
{
|
||||
//TODO
|
||||
}
|
||||
if (!(_EfIsChecked && _LinqIsChecked))
|
||||
if (!_EfIsChecked && !_LinqIsChecked)
|
||||
{
|
||||
try
|
||||
{
|
||||
var customerModelRepository = new CustomerRepository(TxtConnectionString);
|
||||
this.Customers = customerModelRepository.GetAll().ToList();
|
||||
Customers = customerModelRepository.GetAll().ToList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -181,22 +190,9 @@ namespace LoggingClient.ViewModel
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var context = new inventarisierungsloesungEntities())
|
||||
{
|
||||
var Customer = new Customer()
|
||||
{
|
||||
customer_id = 6,
|
||||
firstname = "bvla",
|
||||
lastname = "asdf",
|
||||
customernumber = "asdf",
|
||||
kundenkonto_fk = 99,
|
||||
tel = "0798765432",
|
||||
email = "asdf@adsf.asdf",
|
||||
url = "www.asdf.ch",
|
||||
password = "password"
|
||||
};
|
||||
|
||||
}
|
||||
var customerModelRepositoryEF = new CustomerRepositoryEF();
|
||||
customerModelRepositoryEF.Add(NewCustomerEntry);
|
||||
Customers = customerModelRepositoryEF.GetAll();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -207,7 +203,7 @@ namespace LoggingClient.ViewModel
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
if (!(_EfIsChecked && _LinqIsChecked))
|
||||
if (!_EfIsChecked && !_LinqIsChecked)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -223,15 +219,31 @@ namespace LoggingClient.ViewModel
|
||||
}
|
||||
private void DeleteData()
|
||||
{
|
||||
try
|
||||
if (_EfIsChecked)
|
||||
{
|
||||
var customerModelRepository = new CustomerRepository(TxtConnectionString);
|
||||
customerModelRepository.Delete(this.NewCustomerEntry);
|
||||
this.Customers = customerModelRepository.GetAll().ToList();
|
||||
try
|
||||
{
|
||||
var customerModelRepositoryEF = new CustomerRepositoryEF();
|
||||
customerModelRepositoryEF.Delete(MySelectedItem);
|
||||
Customers = customerModelRepositoryEF.GetAll();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Error occurred: " + ex.Message);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
if (!_EfIsChecked && !_LinqIsChecked)
|
||||
{
|
||||
MessageBox.Show("Error occurred: " + ex.Message);
|
||||
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()
|
||||
|
@ -21,19 +21,135 @@
|
||||
<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=customernumber}" Header="CustomerNr" Width="100" IsReadOnly="True" />
|
||||
<DataGridTextColumn Binding="{Binding Path=kundenkonto_fk}" Header="Customer_FK" Width="100" IsReadOnly="True" />
|
||||
<DataGridTextColumn Binding="{Binding Path=kundenkonto_fk}" Header="CustAcc ID" Width="100" IsReadOnly="True" />
|
||||
<DataGridTextColumn Binding="{Binding Path=tel}" Header="PhoneNumber" Width="115" IsReadOnly="True" />
|
||||
<DataGridTextColumn Binding="{Binding Path=email}" 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>
|
||||
|
||||
<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"/>
|
||||
<TextBox HorizontalAlignment="Left" Height="23" Margin="248,22,0,0" TextWrapping="Wrap" Text="{Binding TxtConnectionString}" Name="TxtConnectionString" VerticalAlignment="Top" Width="525" />
|
||||
|
||||
<Label Content="Firstname" HorizontalAlignment="Left" Margin="10,290,0,0" VerticalAlignment="Top" Width="95"/>
|
||||
<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>
|
||||
|
||||
<Label Content="Lastname" HorizontalAlignment="Left" Margin="110,290,0,0" VerticalAlignment="Top" Width="95"/>
|
||||
<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>
|
||||
|
||||
<Label Content="CustomerNr" HorizontalAlignment="Left" Margin="210,290,0,0" VerticalAlignment="Top" Width="95"/>
|
||||
<TextBox HorizontalAlignment="Left" Height="25" Margin="210,321,0,0" TextWrapping="Wrap" Name="EnterCustomerNr" VerticalAlignment="Top" Width="95">
|
||||
<TextBox.Text>
|
||||
<Binding Path="NewCustomerEntry.customernumber" 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>
|
||||
|
||||
<Label Content="Url" HorizontalAlignment="Left" Margin="310,291,0,0" VerticalAlignment="Top" Width="95"/>
|
||||
<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>
|
||||
|
||||
<Label Content="CustAcc ID" HorizontalAlignment="Left" Margin="10,346,0,0" VerticalAlignment="Top" Width="95"/>
|
||||
<TextBox HorizontalAlignment="Left" Height="25" Margin="10,372,0,0" TextWrapping="Wrap" Name="EnterCustAccFk" VerticalAlignment="Top" Width="95">
|
||||
<TextBox.Text>
|
||||
<Binding Path="NewCustomerEntry.kundenkonto_fk" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
<validators:IntRangeValidationRule
|
||||
MinimumLength="1" MaximumLength="8"/>
|
||||
</Binding.ValidationRules>
|
||||
</Binding>
|
||||
</TextBox.Text>
|
||||
</TextBox>
|
||||
|
||||
<Label Content="Phone" HorizontalAlignment="Left" Margin="110,346,0,0" VerticalAlignment="Top" Width="95"/>
|
||||
<TextBox HorizontalAlignment="Left" Height="25" Margin="110,372,0,0" TextWrapping="Wrap" Name="EnterPhoneNumber" VerticalAlignment="Top" Width="95">
|
||||
<TextBox.Text>
|
||||
<Binding Path="NewCustomerEntry.tel" 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>
|
||||
|
||||
<Label Content="Email" HorizontalAlignment="Left" Margin="210,346,0,0" VerticalAlignment="Top" Width="95"/>
|
||||
<TextBox HorizontalAlignment="Left" Height="25" Margin="210,372,0,0" TextWrapping="Wrap" x:Name="EnterEmail" VerticalAlignment="Top" Width="95">
|
||||
<Binding Path="NewCustomerEntry.email" 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>
|
||||
|
||||
<Label Content="Password" HorizontalAlignment="Left" Margin="310,347,0,0" VerticalAlignment="Top" Width="95"/>
|
||||
<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="Select Strategy for SQL" HorizontalAlignment="Left" Margin="508,290,0,0" VerticalAlignment="Top" Width="175"/>
|
||||
<RadioButton Content="EF" IsChecked="{Binding EfIsChecked}" HorizontalAlignment="Left" Margin="508,341,0,0" VerticalAlignment="Top"/>
|
||||
<RadioButton Content="LINQ" IsChecked="{Binding LinqIsChecked}" HorizontalAlignment="Left" Margin="508,321,0,0" VerticalAlignment="Top"/>
|
||||
|
||||
<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">
|
||||
<DataTrigger Binding="{Binding Text.Length, ElementName=EnterFirstName, UpdateSourceTrigger=PropertyChanged}" Value="0">
|
||||
<Setter Property="IsEnabled" Value="False"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Text.Length, ElementName=EnterLastName, UpdateSourceTrigger=PropertyChanged}" Value="0">
|
||||
<Setter Property="IsEnabled" Value="False"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Text.Length, ElementName=EnterCustomerNr, UpdateSourceTrigger=PropertyChanged}" Value="0">
|
||||
<Setter Property="IsEnabled" Value="False"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Text.Length, ElementName=EnterUrl, UpdateSourceTrigger=PropertyChanged}" Value="0">
|
||||
<Setter Property="IsEnabled" Value="False"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Text.Length, ElementName=EnterCustAccFk, UpdateSourceTrigger=PropertyChanged}" Value="0">
|
||||
<Setter Property="IsEnabled" Value="False"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Text.Length, ElementName=EnterPhoneNumber, UpdateSourceTrigger=PropertyChanged}" Value="0">
|
||||
@ -42,9 +158,6 @@
|
||||
<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>
|
||||
@ -56,103 +169,6 @@
|
||||
<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"/>
|
||||
<Label Content="Select Strategy for SQL" HorizontalAlignment="Left" Margin="508,290,0,0" VerticalAlignment="Top" Width="175"/>
|
||||
<RadioButton Content="EF" IsChecked="{Binding EfIsChecked}" HorizontalAlignment="Left" Margin="508,341,0,0" VerticalAlignment="Top"/>
|
||||
<RadioButton Content="LINQ" IsChecked="{Binding LinqIsChecked}" HorizontalAlignment="Left" Margin="508,321,0,0" VerticalAlignment="Top"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
Loading…
Reference in New Issue
Block a user