курсовая агентсво недвижимости. Проектирование и внедрение базы данных агентства по аренде квартир
Скачать 338.06 Kb.
|
Приложение 2Листинг программы Окно в WPF “MainWindow.xaml”. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:Kursov" mc:Ignorable="d" Title="MainWindow" Height="450" Width="800"> Margin="10,0,0,10" Name="tbLog"/> Content="Логин"/> Margin="10,0,0,10" Name="tbPass"/> Content="Пароль"/> x:Name="btIn" Click="btIn_Click"/> Окно в WPF кода “MainWindow.xaml.cs”. 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 Kursov { /// /// Логика взаимодействия для MainWindow.xaml /// public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); tbPass.Password = "admin"; tbPass.PasswordChar = '*'; tbLog.Text = "admin"; } private void btIn_Click(object sender, RoutedEventArgs e) { if (tbPass.Password == "admin" && tbLog.Text == "admin") { Forms.Apartment menuForm = new Forms.Apartment(); menuForm.Show(); this.Close(); } } } } “Apartment.xaml”. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:Kursov.Forms" mc:Ignorable="d" Title="Apartment" Height="450" Width="800"> RenderTransformOrigin="0.5,0.5" Click="btHome_Click" > Width="100" Grid.Row="0" Grid.Column="0" Grid.RowSpan="4" > Text="{Binding Address}" /> “Apartment.xaml.cs”. 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.Shapes; namespace Kursov.Forms { /// /// Логика взаимодействия для Apartment.xaml /// public partial class Apartment: Window { public Apartment () { InitializeComponent(); bv.KursovEntities entities = new bv.KursovEntities(); lbServis.ItemsSource = entities.Apartment.ToList(); } private void btHome_Click(object sender, RoutedEventArgs e) { MainWindow menuFotr = new MainWindow(); menuFotr.Show(); this.Close(); } } } “Apartment.cs”.
|