CoreLine.Wpf.CatalogInterfaces.Avelikiu
1.0.1
dotnet add package CoreLine.Wpf.CatalogInterfaces.Avelikiu --version 1.0.1
NuGet\Install-Package CoreLine.Wpf.CatalogInterfaces.Avelikiu -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CoreLine.Wpf.CatalogInterfaces.Avelikiu" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CoreLine.Wpf.CatalogInterfaces.Avelikiu" Version="1.0.1" />
<PackageReference Include="CoreLine.Wpf.CatalogInterfaces.Avelikiu" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CoreLine.Wpf.CatalogInterfaces.Avelikiu --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: CoreLine.Wpf.CatalogInterfaces.Avelikiu, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CoreLine.Wpf.CatalogInterfaces.Avelikiu@1.0.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CoreLine.Wpf.CatalogInterfaces.Avelikiu&version=1.0.1
#tool nuget:?package=CoreLine.Wpf.CatalogInterfaces.Avelikiu&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
CoreLine.Wpf.CatalogInterfaces
Библиотека содержит готовые решения для WPF проекта.
MainWindow.xaml
<Window x:Class="KomarovExam.MainWindow"
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:KomarovExam"
mc:Ignorable="d" Background="#F5DEB3"
Title="Авторизация" Height="450" Width="800">
<Grid>
<StackPanel
Width="250"
VerticalAlignment="Center"
HorizontalAlignment="Center">
<TextBlock
Text="Авторизация" HorizontalAlignment="Center" FontSize="24" Foreground="White" Margin="0 0 0 20"></TextBlock>
<TextBlock Text="Логин" FontSize="14" Foreground="White" Margin="0 0 0 10"></TextBlock>
<TextBox Margin="0 0 0 10" Height="30" x:Name="tbLogin" ></TextBox>
<TextBlock Text="Пароль" FontSize="14" Foreground="White" Margin="0 0 0 10"></TextBlock>
<TextBox Margin="0 0 0 10" Height="30" x:Name="tbPassword" ></TextBox>
<Button Click="btLogin" FontSize="14" Content="Войти" Margin="0 0 0 10" Foreground="White" Background="#DEB887" Height="30"/>
</StackPanel>
</Grid>
</Window>
mainwindow.xaml.cs
using System.Linq;
using System.Windows;
using KomarovExam.BD;
namespace KomarovExam
{
public partial class MainWindow : Window
{
private BazaDan context;
public MainWindow()
{
InitializeComponent();
context = new BazaDan();
}
private void btLogin(object sender, RoutedEventArgs e)
{
string enteredLogin = tbLogin.Text.Trim();
string enteredPassword = tbPassword.Text;
User current = verificate(enteredLogin, enteredPassword);
if (current == null)
{
MessageFail();
return;
}
OpenWin(current);
}
private User verificate(string login, string password)
{
User result = context.User
.FirstOrDefault(u =>
u.Login == login &
u.Password == password);
return result;
}
private void MessageFail()
{
MessageBox.Show(
"Неверный логин или пароль",
"Ошибка входа",
MessageBoxButton.OK,
MessageBoxImage.Error);
}
private void OpenWin(User user)
{
ProductsRedactor window = new ProductsRedactor(user);
window.Show();
Close();
}
}
}
ProductsRedactor.xaml
<Window x:Class="BlinovExam.ProductsRedactor"
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:BlinovExam"
Title="Список товаров"
Height="670"
Width="1300"
Background="#F5DEB3">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="120"/>
</Grid.RowDefinitions>
<ListView x:Name="lvProducts"
Grid.Row="0"
FontFamily="Arial"
FontSize="14"
Margin="10"
MouseDoubleClick="lvProducts_MouseDoubleClick">
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
</Style>
</ListView.ItemContainerStyle>
<ListView.ItemTemplate>
<DataTemplate>
<Border BorderBrush="Black"
BorderThickness="1"
Margin="5"
Padding="8"
Background="{Binding RowBrush}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="140"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="120"/>
</Grid.ColumnDefinitions>
<Border Width="120"
Height="120"
BorderBrush="Black"
BorderThickness="1"
HorizontalAlignment="Center">
<Image Source="{Binding ImagePath}"
Stretch="Uniform"/>
</Border>
<StackPanel Grid.Column="1" Margin="10,0">
<TextBlock FontWeight="Bold">
<Run Text="{Binding CategoryName}"/>
<Run Text=" | "/>
<Run Text="{Binding TovarName}"/>
</TextBlock>
<TextBlock TextWrapping="Wrap" Margin="0,3,0,0">
<Run Text="Описание товара: "/>
<Run Text="{Binding Description}"/>
</TextBlock>
<TextBlock Margin="0,2,0,0">
<Run Text="Производитель: "/>
<Run Text="{Binding Manufacturer}"/>
</TextBlock>
<TextBlock Margin="0,2,0,0">
<Run Text="Поставщик: "/>
<Run Text="{Binding Supplier}"/>
</TextBlock>
<TextBlock Margin="0,2,0,0">
<Run Text="Цена: "/>
<Run Text="{Binding Cost}" TextDecorations="Strikethrough"/>
<Run Text=" руб." TextDecorations="Strikethrough"/>
</TextBlock>
<TextBlock Margin="0,2,0,0">
<Run Text="Ед. изм: "/>
<Run Text="{Binding Unit}"/>
</TextBlock>
<TextBlock Margin="0,2,0,0">
<Run Text="Склад: "/>
<Run Text="{Binding Stock}"/>
</TextBlock>
<TextBlock FontWeight="Bold" Margin="0,3,0,0">
<Run Text="Итого: "/>
<Run Text="{Binding FinalPrice}"/>
<Run Text=" руб."/>
</TextBlock>
</StackPanel>
<Border Grid.Column="2"
BorderBrush="#CCC"
BorderThickness="1"
Padding="5"
VerticalAlignment="Center">
<StackPanel HorizontalAlignment="Center">
<TextBlock Text="Скидка"
FontWeight="Bold"
TextAlignment="Center"/>
<TextBlock Text="{Binding Discount, StringFormat={}{0}%}"
FontSize="22"
FontWeight="Bold"
Foreground="Red"
HorizontalAlignment="Center"/>
</StackPanel>
</Border>
</Grid>
</Border>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<Border Grid.Row="1"
Background="#F5DEB3"
Padding="10">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal"
VerticalAlignment="Center">
<TextBox x:Name="tbSearch"
Width="224"
Height="32"
Margin="0,0,10,0"
TextChanged="tbSearch_TextChanged"/>
<ComboBox x:Name="cbSort"
Width="144"
Height="32"
Margin="0,0,10,0"
SelectionChanged="cbSort_SelectionChanged">
<ComboBoxItem Content="Цена по возрастанию"/>
<ComboBoxItem Content="Цена по убыванию"/>
<ComboBoxItem Content="Склад по возрастанию"/>
<ComboBoxItem Content="Склад по убыванию"/>
<ComboBoxItem Content="Товар по возрастанию"/>
<ComboBoxItem Content="Товар по убыванию"/>
</ComboBox>
<ComboBox x:Name="cbSupplierFilter"
Width="149"
Height="32"
Margin="0,0,10,0"
SelectionChanged="cbSupplierFilter_SelectionChanged"/>
<Button x:Name="btnAdd"
Content="Добавить"
Width="120"
Background="#DEB887"
Foreground="White"
Margin="0,0,10,0"
Click="Add_Click"/>
<Button x:Name="btnDelete"
Content="Удалить"
Width="120"
Margin="0,0,10,0"
Background="#DEB887"
Foreground="White"
Click="Delete_Click"/>
<Button x:Name="btnOrders"
Content="Заказы"
Width="120"
Margin="10,0"
Click="Orders_Click"
Background="#DEB887"
Foreground="White"/>
<Button Content="Выход"
Width="120"
Background="#DEB887"
Foreground="White"
Click="BtnExit_Click"/>
</StackPanel>
<StackPanel Grid.Column="1"
VerticalAlignment="Center" Margin="0,70,0,0"
HorizontalAlignment="Right">
<TextBlock x:Name="tbUser"
Foreground="White"
FontWeight="Bold"
FontFamily="Arial"
FontSize="14"
HorizontalAlignment="Right"/>
<TextBlock x:Name="tbRole"
Foreground="White"
FontFamily="Arial"
FontSize="14"
HorizontalAlignment="Right"/>
</StackPanel>
</Grid>
</Border>
</Grid>
</Window>
ProductsRedactor.xaml.cs
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
using KomarovExam.BD;
namespace KomarovExam
{
public partial class ProductsRedactor : Window
{
private BazaDan _db = new BazaDan();
private ObservableCollection<ProductItem> _data = new ObservableCollection<ProductItem>();
private ICollectionView _view;
private User _user;
private AddEditWindow _opened;
private string _search = "";
private string _supplier = "Все поставщики";
private bool _isGuest;
private bool _isClient;
private bool _isAdmin;
private bool _isManager;
public ProductsRedactor(User user)
{
InitializeComponent();
_user = user;
DetectRole();
SetUserInfo();
SetPermissions();
LoadData();
_view = CollectionViewSource.GetDefaultView(_data);
lvProducts.ItemsSource = _view;
}
private void DetectRole()
{
_isGuest = (_user == null);
if (_user != null && _user.Role != null)
{
_isClient = (_user.Role.RoleName == "Авторизированный клиент");
_isAdmin = (_user.Role.RoleName == "Администратор");
_isManager = (_user.Role.RoleName == "Менеджер");
}
}
private void SetUserInfo()
{
if (_user == null)
{
tbUser.Text = "Гость";
tbRole.Text = "Неавторизованный пользователь";
return;
}
tbUser.Text = _user.Familia + " " + _user.Imya + " " + _user.Otchestvo;
tbRole.Text = _user.Role.RoleName;
}
private void SetPermissions()
{
if (_isGuest || _isClient)
{
tbSearch.Visibility = Visibility.Collapsed;
cbSupplierFilter.Visibility = Visibility.Collapsed;
cbSort.Visibility = Visibility.Collapsed;
btnOrders.Visibility = Visibility.Collapsed;
btnAdd.Visibility = Visibility.Collapsed;
btnDelete.Visibility = Visibility.Collapsed;
}
else if (_isManager)
{
tbSearch.Visibility = Visibility.Visible;
cbSupplierFilter.Visibility = Visibility.Visible;
cbSort.Visibility = Visibility.Visible;
btnOrders.Visibility = Visibility.Visible;
btnAdd.Visibility = Visibility.Collapsed;
btnDelete.Visibility = Visibility.Collapsed;
}
else if (_isAdmin)
{
tbSearch.Visibility = Visibility.Visible;
cbSupplierFilter.Visibility = Visibility.Visible;
cbSort.Visibility = Visibility.Visible;
btnOrders.Visibility = Visibility.Visible;
btnAdd.Visibility = Visibility.Visible;
btnDelete.Visibility = Visibility.Visible;
}
}
private void LoadData()
{
_data.Clear();
List<ProductItem> list = new List<ProductItem>();
foreach (var p in _db.Tovar.ToList())
{
decimal cost = p.Cost;
int discount = p.Discount.HasValue ? p.Discount.Value : 0;
int stock = p.KolvoNaSklade.HasValue ? p.KolvoNaSklade.Value : 0;
decimal final = cost - (cost * discount / 100);
Brush row = Brushes.Transparent;
if (stock == 0)
{
row = Brushes.LightBlue;
}
else
{
if (discount > 17)
{
row = (Brush)new BrushConverter().ConvertFrom("#FFDEAD");
}
}
ProductItem item = new ProductItem();
item.Id = p.IDTovar;
item.TovarName = p.TovarName;
item.Description = p.Description;
item.CategoryName = p.TovarCategory != null ? p.TovarCategory.TovarCategoryName : "";
item.Manufacturer = p.Proizvoditeli != null ? p.Proizvoditeli.NameProizvoditelia : "";
item.Supplier = p.Postavshik != null ? p.Postavshik.PostavshikName : "";
item.Cost = cost;
item.FinalPrice = final;
item.Discount = discount;
item.Unit = p.EdIzmer != null ? p.EdIzmer.Edzm : "";
item.Stock = stock;
item.ImagePath = "/Resources/" + (p.Image != null ? p.Image : "picture.png");
item.RowBrush = row;
list.Add(item);
}
foreach (var x in list)
{
_data.Add(x);
}
List<string> suppliers = new List<string>();
foreach (var x in list)
{
if (x.Supplier != null && x.Supplier != "")
{
if (!suppliers.Contains(x.Supplier))
{
suppliers.Add(x.Supplier);
}
}
}
suppliers.Sort();
suppliers.Insert(0, "Все поставщики");
cbSupplierFilter.ItemsSource = suppliers;
cbSupplierFilter.SelectedIndex = 0;
_supplier = "Все поставщики";
}
private void ApplyFilter()
{
if (_view == null) return;
_view.Filter = delegate (object obj)
{
ProductItem p = obj as ProductItem;
if (p == null) return false;
bool searchOk = false;
if (_search == "")
{
searchOk = true;
}
else
{
if ((p.TovarName != null && p.TovarName.ToLower().Contains(_search)) ||
(p.Description != null && p.Description.ToLower().Contains(_search)) ||
(p.Manufacturer != null && p.Manufacturer.ToLower().Contains(_search)) ||
(p.Supplier != null && p.Supplier.ToLower().Contains(_search)))
{
searchOk = true;
}
}
bool supplierOk = false;
if (_supplier == "Все поставщики")
{
supplierOk = true;
}
else
{
supplierOk = (p.Supplier == _supplier);
}
return searchOk && supplierOk;
};
}
private void tbSearch_TextChanged(object sender, TextChangedEventArgs e)
{
_search = tbSearch.Text.ToLower().Trim();
ApplyFilter();
}
private void cbSupplierFilter_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (cbSupplierFilter.SelectedItem == null) return;
_supplier = cbSupplierFilter.SelectedItem.ToString();
ApplyFilter();
}
private void cbSort_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (_view == null) return;
_view.SortDescriptions.Clear();
int i = cbSort.SelectedIndex;
if (i == 0)
_view.SortDescriptions.Add(new SortDescription("Cost", ListSortDirection.Ascending));
else if (i == 1)
_view.SortDescriptions.Add(new SortDescription("Cost", ListSortDirection.Descending));
else if (i == 2)
_view.SortDescriptions.Add(new SortDescription("Stock", ListSortDirection.Ascending));
else if (i == 3)
_view.SortDescriptions.Add(new SortDescription("Stock", ListSortDirection.Descending));
else if (i == 4)
_view.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
else if (i == 5)
_view.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Descending));
}
private void lvProducts_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
ProductItem selected = lvProducts.SelectedItem as ProductItem;
if (selected == null) return;
if (_isAdmin == false)
{
MessageBox.Show("Только администратор может редактировать");
return;
}
var entity = _db.Tovar
.Include("TovarCategory")
.Include("Proizvoditeli")
.Include("Postavshik")
.Include("EdIzmer")
.FirstOrDefault(x => x.IDTovar == selected.Id);
if (entity == null)
{
MessageBox.Show("Не найден товар");
return;
}
AddEditWindow win = new AddEditWindow(entity);
if (win.ShowDialog() == true)
{
_db.SaveChanges();
LoadData();
}
}
private void Add_Click(object sender, RoutedEventArgs e)
{
if (_opened != null) return;
Tovar t = new Tovar();
_opened = new AddEditWindow(t);
if (_opened.ShowDialog() == true)
{
LoadData();
}
_opened = null;
}
private void Delete_Click(object sender, RoutedEventArgs e)
{
ProductItem selected = lvProducts.SelectedItem as ProductItem;
if (selected == null) return;
var entity = _db.Tovar.FirstOrDefault(x => x.IDTovar == selected.Id);
if (entity == null) return;
bool used = _db.Zakaz.Any(x => x.IDTovar == entity.IDTovar);
if (used)
{
MessageBox.Show("Нельзя удалить — есть в заказах");
return;
}
if (MessageBox.Show("Удалить товар?", "Внимание",
MessageBoxButton.YesNo, MessageBoxImage.Warning) != MessageBoxResult.Yes)
return;
_db.Tovar.Remove(entity);
_db.SaveChanges();
LoadData();
}
private void BtnExit_Click(object sender, RoutedEventArgs e)
{
MainWindow w = new MainWindow();
w.Show();
this.Close();
}
public class ProductItem
{
public int Id { get; set; }
public string CategoryName { get; set; }
public string TovarName { get; set; }
public string Description { get; set; }
public string Manufacturer { get; set; }
public string Supplier { get; set; }
public decimal Cost { get; set; }
public decimal FinalPrice { get; set; }
public int Discount { get; set; }
public string Unit { get; set; }
public int Stock { get; set; }
public string ImagePath { get; set; }
public Brush RowBrush { get; set; }
}
private void Orders_Click(object sender, RoutedEventArgs e)
{
OrdersWindow window = new OrdersWindow(_user);
window.Show();
this.Close();
}
}
}
OrdersWindow.xaml
<Window x:Class="KomarovExam.OrdersWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Заказы"
Height="600"
Width="900"
Background="#F5DEB3">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="60"/>
</Grid.RowDefinitions>
<ListView x:Name="lvOrders"
MouseDoubleClick="lvOrders_MouseDoubleClick"
Margin="10">
<ListView.ItemTemplate>
<DataTemplate>
<Border BorderBrush="Black"
BorderThickness="1"
Margin="5"
Padding="10">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="180" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0">
<TextBlock Text="{Binding Article}"
FontWeight="Bold"
FontSize="14"/>
<TextBlock>
<Run Text="Статус: "/>
<Run Text="{Binding Status}"/>
</TextBlock>
<TextBlock TextWrapping="Wrap">
<Run Text="Адрес пункта выдачи: "/>
<Run Text="{Binding Address}"/>
</TextBlock>
<TextBlock>
<Run Text="Дата заказа: "/>
<Run Text="{Binding OrderDate}"/>
</TextBlock>
</StackPanel>
<Border Grid.Column="1"
BorderBrush="Black"
BorderThickness="1"
Margin="10,0,0,0"
Padding="10"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<StackPanel HorizontalAlignment="Center"
VerticalAlignment="Center">
<TextBlock Text="Дата доставки"
FontWeight="Bold"
HorizontalAlignment="Center"/>
<TextBlock Text="{Binding DeliveryDate}"
FontSize="14"
HorizontalAlignment="Center"/>
</StackPanel>
</Border>
</Grid>
</Border>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<StackPanel Grid.Row="1"
Orientation="Horizontal"
HorizontalAlignment="Center">
<Button x:Name="btnAdd"
Content="Добавить заказ"
Width="140"
Margin="10"
Background="#DEB887"
Foreground="White"
Click="Add_Click"/>
<Button x:Name="btnDelete"
Content="Удалить"
Width="120"
Margin="10"
Background="#DEB887"
Foreground="White"
Click="Delete_Click"/>
<Button Content="Назад"
Width="120"
Height="39"
Background="#DEB887"
Foreground="White"
Click="Back_Click"/>
</StackPanel>
</Grid>
</Window>
OrdersWindow.xaml.cs
using System;
using System.Collections.ObjectModel;
using System.Linq;
using System.Windows;
using KomarovExam.BD;
namespace KomarovExam
{
public partial class OrdersWindow : Window
{
private BazaDan db = new BazaDan();
private ObservableCollection<OrderItem> list;
private User currentUser;
public OrdersWindow(User user)
{
InitializeComponent();
currentUser = user;
LoadOrders();
if (currentUser == null || currentUser.Role.RoleName != "Администратор")
{
btnAdd.Visibility = Visibility.Collapsed;
btnDelete.Visibility = Visibility.Collapsed;
}
}
private void ReloadDb()
{
db.Dispose();
db = new BazaDan();
}
private void LoadOrders()
{
list = new ObservableCollection<OrderItem>();
foreach (var item in db.Zakaz.AsNoTracking().ToList())
{
string address = "";
if (item.PunktVidachi != null)
{
address =
item.PunktVidachi.AdressIndex + ", " +
item.PunktVidachi.Street + " " +
(item.PunktVidachi.StreetNumber.HasValue
? item.PunktVidachi.StreetNumber.ToString()
: "");
}
list.Add(new OrderItem
{
Id = item.IDZakaza,
Number = item.NomerZakaza.ToString(),
Article = item.Tovar != null ? item.Tovar.Article : "",
Status = item.StatusZakaza != null ? item.StatusZakaza.StatusZakazaName : "",
Address = address,
OrderDate = item.DateZakaza,
DeliveryDate = item.DateDelivery,
Count = item.Kolvo ?? 0
});
}
lvOrders.ItemsSource = null;
lvOrders.ItemsSource = list;
}
private void Add_Click(object sender, RoutedEventArgs e)
{
if (currentUser == null)
{
MessageBox.Show("Нет пользователя");
return;
}
var window = new OrderEditWindow(db, null, currentUser);
if (window.ShowDialog() == true)
{
LoadOrders();
}
}
private void lvOrders_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
if (currentUser.Role.RoleName != "Администратор")
return;
OrderItem selected = lvOrders.SelectedItem as OrderItem;
if (selected == null) return;
var order = db.Zakaz.First(x => x.IDZakaza == selected.Id);
var window = new OrderEditWindow(db, order, currentUser);
if (window.ShowDialog() == true)
{
LoadOrders();
}
}
private void Delete_Click(object sender, RoutedEventArgs e)
{
OrderItem selected = lvOrders.SelectedItem as OrderItem;
if (selected == null) return;
Zakaz order = db.Zakaz.First(x => x.IDZakaza == selected.Id);
if (MessageBox.Show("Удалить заказ?", "Подтверждение",
MessageBoxButton.YesNo) == MessageBoxResult.Yes)
{
db.Zakaz.Remove(order);
db.SaveChanges();
ReloadDb();
LoadOrders();
}
}
private void Back_Click(object sender, RoutedEventArgs e)
{
ProductsRedactor p = new ProductsRedactor(currentUser);
p.Show();
Close();
}
public class OrderItem
{
public int Id { get; set; }
public string Number { get; set; }
public string Article { get; set; }
public string Status { get; set; }
public string Address { get; set; }
public DateTime? OrderDate { get; set; }
public DateTime? DeliveryDate { get; set; }
public int Count { get; set; }
}
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.1 | 122 | 6/22/2026 |