To Be Continued
parent
69e1117916
commit
147ed9b1e8
|
|
@ -75,12 +75,39 @@ public class EmployeeRepository : BaseRepository<Employee>, IDisposable
|
||||||
|
|
||||||
public override bool Update(Employee item)
|
public override bool Update(Employee item)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
string sql = "UPDATE TechInventory.Employees SET FullName=@FullName, PositionId=@PositionId WHERE Id=@Id;";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using var mc = new MySqlCommand(sql, connection);
|
||||||
|
mc.Parameters.AddWithValue("@Id", item.Id);
|
||||||
|
mc.Parameters.AddWithValue("@FullName", item.FullName);
|
||||||
|
mc.Parameters.AddWithValue("@PositionId", item.PositionId);
|
||||||
|
mc.ExecuteNonQuery();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Console.WriteLine(e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Add(Employee item)
|
public override bool Add(Employee item)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
string sql = "INSERT INTO TechInventory.Employees (FullName, PositionId) VALUES(@FullName, @PositionId);";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using var mc = new MySqlCommand(sql, connection);
|
||||||
|
mc.Parameters.AddWithValue("@FullName", item.FullName);
|
||||||
|
mc.Parameters.AddWithValue("@PositionId", item.PositionId);
|
||||||
|
mc.ExecuteNonQuery();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Console.WriteLine(e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
|
|
|
||||||
|
|
@ -58,11 +58,48 @@ public class EquipmentRepository : BaseRepository<Equipment>, IDisposable
|
||||||
|
|
||||||
public override bool Update(Equipment item)
|
public override bool Update(Equipment item)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
string sql = "UPDATE TechInventory.Equipment SET InvNumber=@InvNum, Name=@Name, PurchaseDate=@Date, Cost=@Cost, IsWrittenOff=@IsWrittenOff, CurrentEmployeeId=@CurrentEmployeeId WHERE Id=@Id;";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using var mc = new MySqlCommand(sql, connection);
|
||||||
|
mc.Parameters.AddWithValue("@Id", item.Id);
|
||||||
|
mc.Parameters.AddWithValue("@InvNum", item.InvNumber);
|
||||||
|
mc.Parameters.AddWithValue("@Name", item.Name);
|
||||||
|
mc.Parameters.AddWithValue("@Date", item.Date);
|
||||||
|
mc.Parameters.AddWithValue("@Cost", item.Cost);
|
||||||
|
mc.Parameters.AddWithValue("@IsWrittenOff", item.IsWrittenOff?1:0);
|
||||||
|
mc.Parameters.AddWithValue("@CurrentEmployeeId", item.CurrentEmployeeId);
|
||||||
|
mc.ExecuteNonQuery();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Console.WriteLine(e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Add(Equipment item)
|
public override bool Add(Equipment item)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
string sql = "INSERT INTO TechInventory.Equipment (InvNumber, Name, PurchaseDate, Cost, IsWrittenOff, CurrentEmployeeId) VALUES(@InvNum, @Name, @Date, @Cost, @IsWrittenOff, @CurrentEmployeeId)";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var mc = new MySqlCommand(sql, connection);
|
||||||
|
mc.Parameters.AddWithValue("@InvNum", item.InvNumber);
|
||||||
|
mc.Parameters.AddWithValue("@Name", item.Name);
|
||||||
|
mc.Parameters.AddWithValue("@Date", item.Date);
|
||||||
|
mc.Parameters.AddWithValue("@Cost", item.Cost);
|
||||||
|
mc.Parameters.AddWithValue("@IsWrittenOff", item.IsWrittenOff);
|
||||||
|
mc.Parameters.AddWithValue("@CurrentEmployeeId", item.CurrentEmployeeId);
|
||||||
|
mc.ExecuteNonQuery();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Console.WriteLine(e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -13,7 +13,8 @@ public static class EquipmentFactory
|
||||||
result.Name = visual.Name;
|
result.Name = visual.Name;
|
||||||
result.Date = DateOnly.FromDateTime(visual.Date.Value.DateTime);
|
result.Date = DateOnly.FromDateTime(visual.Date.Value.DateTime);
|
||||||
result.Cost = visual.Cost;
|
result.Cost = visual.Cost;
|
||||||
result.IsWrittenOff = visual.IsWrittenOff != "Нет";
|
result.IsWrittenOff = visual.IsWrittenOff;
|
||||||
|
result.Id = visual.Id;
|
||||||
result.CurrentEmployeeId = visual.CurrentEmployee.Id;
|
result.CurrentEmployeeId = visual.CurrentEmployee.Id;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,8 @@ public static class EquipmentVisualFactory
|
||||||
result.Name = equipment.Name;
|
result.Name = equipment.Name;
|
||||||
result.Date = new DateTimeOffset(equipment.Date.ToDateTime(TimeOnly.MinValue));
|
result.Date = new DateTimeOffset(equipment.Date.ToDateTime(TimeOnly.MinValue));
|
||||||
result.Cost = equipment.Cost;
|
result.Cost = equipment.Cost;
|
||||||
result.IsWrittenOff = equipment.IsWrittenOff?"Да":"Нет";
|
result.IsWrittenOff = equipment.IsWrittenOff;
|
||||||
|
result.IsWrittenOffString = equipment.IsWrittenOff ? "Да" : "Нет";
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,11 @@ namespace AvaloniaApplication14_Inventory_300326.Models.Models;
|
||||||
|
|
||||||
public class Employee : DBObj
|
public class Employee : DBObj
|
||||||
{
|
{
|
||||||
public string FullName { get; set; }
|
public string FullName { get; set; } = "";
|
||||||
public int PositionId { get; set; }
|
public int PositionId { get; set; }
|
||||||
|
|
||||||
|
public bool IsNew()
|
||||||
|
{
|
||||||
|
return FullName == "" && PositionId == 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4,11 +4,23 @@ namespace AvaloniaApplication14_Inventory_300326.Models.Models;
|
||||||
|
|
||||||
public class Equipment : DBObj
|
public class Equipment : DBObj
|
||||||
{
|
{
|
||||||
public string InvNumber { get; set; }
|
public string InvNumber { get; set; } = "";
|
||||||
public string Name { get; set; }
|
public string Name { get; set; } = "";
|
||||||
public DateOnly Date { get; set; }
|
public DateOnly Date { get; set; } = DateOnly.FromDateTime(DateTime.Now);
|
||||||
public decimal Cost { get; set; }
|
public decimal Cost { get; set; } = 0;
|
||||||
public bool IsWrittenOff {get; set;}
|
public bool IsWrittenOff {get; set;} = false;
|
||||||
public int CurrentEmployeeId { get; set; }
|
public int CurrentEmployeeId { get; set; } = 0;
|
||||||
|
|
||||||
|
public bool IsNew()
|
||||||
|
{
|
||||||
|
if (InvNumber == "" && Name == "" && Date == DateOnly.FromDateTime(DateTime.Now) && Cost == 0 && !IsWrittenOff && CurrentEmployeeId == 0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -9,7 +9,8 @@ public class EquipmentVisual
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public DateTimeOffset? Date { get; set; }
|
public DateTimeOffset? Date { get; set; }
|
||||||
public decimal Cost { get; set; }
|
public decimal Cost { get; set; }
|
||||||
public string IsWrittenOff { get; set; }
|
public bool IsWrittenOff { get; set; }
|
||||||
|
public string IsWrittenOffString { get; set; }
|
||||||
public Employee CurrentEmployee { get; set; }
|
public Employee CurrentEmployee { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,6 +1,31 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using AvaloniaApplication14_Inventory_300326.Models.DataBase;
|
||||||
|
using AvaloniaApplication14_Inventory_300326.Models.Models;
|
||||||
|
using AvaloniaApplication14_Inventory_300326.Views;
|
||||||
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
namespace AvaloniaApplication14_Inventory_300326.ViewModels;
|
namespace AvaloniaApplication14_Inventory_300326.ViewModels;
|
||||||
|
|
||||||
public class EmployeeEditingWindowViewModel : ViewModelBase
|
public partial class EmployeeEditingWindowViewModel : ViewModelBase
|
||||||
{
|
{
|
||||||
|
private EmployeeEditingWindow _currentWindow;
|
||||||
|
private IServiceProvider _serviceProvider;
|
||||||
|
private bool _isEditing;
|
||||||
|
|
||||||
|
[ObservableProperty] private ObservableCollection<Position> _positions;
|
||||||
|
public EmployeeEditingWindowViewModel(IServiceProvider serviceProvider, Employee employee)
|
||||||
|
{
|
||||||
|
_serviceProvider = serviceProvider;
|
||||||
|
using (var repo = _serviceProvider.GetService<PositionRepository>())
|
||||||
|
{
|
||||||
|
Positions = new ObservableCollection<Position>(repo.GetAll());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetScreen(EmployeeEditingWindow window)
|
||||||
|
{
|
||||||
|
_currentWindow = window;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,29 +1,85 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using AvaloniaApplication14_Inventory_300326.Models.DataBase;
|
||||||
using AvaloniaApplication14_Inventory_300326.Models.Factoryes;
|
using AvaloniaApplication14_Inventory_300326.Models.Factoryes;
|
||||||
using AvaloniaApplication14_Inventory_300326.Models.Models;
|
using AvaloniaApplication14_Inventory_300326.Models.Models;
|
||||||
using AvaloniaApplication14_Inventory_300326.Views;
|
using AvaloniaApplication14_Inventory_300326.Views;
|
||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
using CommunityToolkit.Mvvm.Input;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
namespace AvaloniaApplication14_Inventory_300326.ViewModels;
|
namespace AvaloniaApplication14_Inventory_300326.ViewModels;
|
||||||
|
|
||||||
public partial class EquipmentEditingWindowViewModel : ViewModelBase
|
public partial class EquipmentEditingWindowViewModel : ViewModelBase
|
||||||
{
|
{
|
||||||
private EquipmentEditingWindow _currentWindow;
|
private EquipmentEditingWindow _currentWindow;
|
||||||
[ObservableProperty] private EquipmentVisual _equipment;
|
private bool _isEditing;
|
||||||
|
private EquipmentVisual _equipment;
|
||||||
|
private IServiceProvider _serviceProvider;
|
||||||
|
|
||||||
public EquipmentEditingWindowViewModel(Equipment equipment)
|
[ObservableProperty] private string _name;
|
||||||
|
[ObservableProperty] private string _invNumber;
|
||||||
|
[ObservableProperty] private DateTimeOffset? _date;
|
||||||
|
[ObservableProperty] private decimal _cost;
|
||||||
|
[ObservableProperty] private bool _isWrittenOff;
|
||||||
|
[ObservableProperty] private Employee _currentEmployee;
|
||||||
|
[ObservableProperty] private ObservableCollection<Employee> _employees;
|
||||||
|
|
||||||
|
[RelayCommand]
|
||||||
|
private void Confrm()
|
||||||
{
|
{
|
||||||
Equipment = EquipmentVisualFactory.CreateFromEquipment(equipment);
|
_equipment.InvNumber = InvNumber;
|
||||||
|
_equipment.Date = Date;
|
||||||
|
_equipment.Cost = Cost;
|
||||||
|
_equipment.IsWrittenOff = IsWrittenOff;
|
||||||
|
_equipment.CurrentEmployee = CurrentEmployee;
|
||||||
|
_equipment.Name = Name;
|
||||||
|
|
||||||
|
using (var repo = _serviceProvider.GetService<EquipmentRepository>())
|
||||||
|
{
|
||||||
|
if (_isEditing)
|
||||||
|
{
|
||||||
|
repo.Update(EquipmentFactory.CreateFromVisual(_equipment));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
repo.Add(EquipmentFactory.CreateFromVisual(_equipment));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_currentWindow.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
[RelayCommand]
|
||||||
|
private void Close()
|
||||||
|
{
|
||||||
|
_currentWindow.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
public EquipmentEditingWindowViewModel(IServiceProvider serviceProvider, Equipment equipment)
|
||||||
|
{
|
||||||
|
_serviceProvider = serviceProvider;
|
||||||
|
_isEditing = !equipment.IsNew();
|
||||||
|
using (var repo = _serviceProvider.GetService<EmployeeRepository>())
|
||||||
|
{
|
||||||
|
_equipment = EquipmentVisualFactory.CreateFromEquipment(equipment);
|
||||||
|
_equipment.CurrentEmployee = repo.GetById(equipment.CurrentEmployeeId);
|
||||||
|
}
|
||||||
|
Name = _equipment.Name;
|
||||||
|
InvNumber = _equipment.InvNumber;
|
||||||
|
Date = _equipment.Date;
|
||||||
|
Cost = _equipment.Cost;
|
||||||
|
IsWrittenOff = _equipment.IsWrittenOff;
|
||||||
|
using (var repo = _serviceProvider.GetService<EmployeeRepository>())
|
||||||
|
{
|
||||||
|
Employees = new ObservableCollection<Employee>(repo.GetAll());
|
||||||
|
}
|
||||||
|
|
||||||
|
CurrentEmployee = Employees.FirstOrDefault(o => o.Id == equipment.CurrentEmployeeId);
|
||||||
}
|
}
|
||||||
public void SetWindow(EquipmentEditingWindow window)
|
public void SetWindow(EquipmentEditingWindow window)
|
||||||
{
|
{
|
||||||
_currentWindow = window;
|
_currentWindow = window;
|
||||||
if (Equipment == EquipmentVisualFactory.CreateFromEquipment(new Equipment()))
|
_currentWindow.OkButton.Content = _isEditing ? "Изменить" : "Добавить";
|
||||||
{
|
|
||||||
_currentWindow.OkButton.Content = "Изменить";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_currentWindow.OkButton.Content = "Добавить";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Data;
|
using Avalonia.Data;
|
||||||
using Avalonia.Input;
|
using Avalonia.Input;
|
||||||
|
|
@ -31,6 +32,36 @@ public partial class MainWindowViewModel : ViewModelBase
|
||||||
[ObservableProperty] private EmployeeVisual _selectedEmployeeVisual;
|
[ObservableProperty] private EmployeeVisual _selectedEmployeeVisual;
|
||||||
[ObservableProperty] private Position _selectedPosition;
|
[ObservableProperty] private Position _selectedPosition;
|
||||||
|
|
||||||
|
|
||||||
|
[RelayCommand]
|
||||||
|
private async Task AddEntity()
|
||||||
|
{
|
||||||
|
switch (SelectedEntity.Id)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
|
||||||
|
var equipment = new Equipment();
|
||||||
|
var EquipmentVm = ActivatorUtilities.CreateInstance<EquipmentEditingWindowViewModel>(_serviceProvider, equipment);
|
||||||
|
var EquipmentWin = ActivatorUtilities.CreateInstance<EquipmentEditingWindow>(_serviceProvider, EquipmentVm);
|
||||||
|
await EquipmentWin.ShowDialog(_currentWindow);
|
||||||
|
GetTeches();
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
|
||||||
|
var employee = new Employee();
|
||||||
|
var EmployeeVm = ActivatorUtilities.CreateInstance<EmployeeEditingWindowViewModel>(_serviceProvider, employee);
|
||||||
|
var EmployeeWin = ActivatorUtilities.CreateInstance<EmployeeEditingWindow>(_serviceProvider, EmployeeVm);
|
||||||
|
await EmployeeWin.ShowDialog(_currentWindow);
|
||||||
|
GetTeches();
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
partial void OnSelectedEntityChanged(Entity value)
|
partial void OnSelectedEntityChanged(Entity value)
|
||||||
{
|
{
|
||||||
if (_currentWindow != null)
|
if (_currentWindow != null)
|
||||||
|
|
@ -135,11 +166,12 @@ public partial class MainWindowViewModel : ViewModelBase
|
||||||
_currentWindow.ScrollViewerDataGridPos.IsVisible = true;
|
_currentWindow.ScrollViewerDataGridPos.IsVisible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DoubleTappedTechDataGrid()
|
private async Task DoubleTappedTechDataGrid()
|
||||||
{
|
{
|
||||||
var vm = ActivatorUtilities.CreateInstance<EquipmentEditingWindowViewModel>(_serviceProvider, EquipmentFactory.CreateFromVisual(SelectedEquipmentVisual));
|
var vm = ActivatorUtilities.CreateInstance<EquipmentEditingWindowViewModel>(_serviceProvider, EquipmentFactory.CreateFromVisual(SelectedEquipmentVisual));
|
||||||
var win = ActivatorUtilities.CreateInstance<EquipmentEditingWindow>(_serviceProvider, vm);
|
var win = ActivatorUtilities.CreateInstance<EquipmentEditingWindow>(_serviceProvider, vm);
|
||||||
win.ShowDialog(_currentWindow);
|
await win.ShowDialog(_currentWindow);
|
||||||
|
GetTeches();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DoubleTappedEmployeeDataGrid()
|
private void DoubleTappedEmployeeDataGrid()
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,23 @@
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:vm="using:AvaloniaApplication14_Inventory_300326.ViewModels"
|
||||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
x:Class="AvaloniaApplication14_Inventory_300326.Views.EmployeeEditingWindow"
|
x:Class="AvaloniaApplication14_Inventory_300326.Views.EmployeeEditingWindow"
|
||||||
Title="EmployeeEditingWindow">
|
Title="EmployeeWindow"
|
||||||
|
x:DataType="vm:EmployeeEditingWindowViewModel"
|
||||||
|
SizeToContent="WidthAndHeight"
|
||||||
|
WindowStartupLocation="CenterOwner">
|
||||||
|
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<Label Content="Фамилия Имя отчество: "></Label>
|
||||||
<TextBox Watermark="ФИО"></TextBox>
|
<TextBox Watermark="ФИО"></TextBox>
|
||||||
<ComboBox></ComboBox>
|
</StackPanel>
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<Label Content="Должность: "></Label>
|
||||||
|
<ComboBox ItemsSource="{Binding Positions}"></ComboBox>
|
||||||
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
</Window>
|
</Window>
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,16 @@
|
||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
using Avalonia.Markup.Xaml;
|
||||||
|
using AvaloniaApplication14_Inventory_300326.ViewModels;
|
||||||
|
|
||||||
namespace AvaloniaApplication14_Inventory_300326.Views;
|
namespace AvaloniaApplication14_Inventory_300326.Views;
|
||||||
|
|
||||||
public partial class EmployeeEditingWindow : Window
|
public partial class EmployeeEditingWindow : Window
|
||||||
{
|
{
|
||||||
public EmployeeEditingWindow()
|
public EmployeeEditingWindow(EmployeeEditingWindowViewModel viewModel)
|
||||||
{
|
{
|
||||||
|
DataContext = viewModel;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
viewModel.SetScreen(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -6,42 +6,50 @@
|
||||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
x:Class="AvaloniaApplication14_Inventory_300326.Views.EquipmentEditingWindow"
|
x:Class="AvaloniaApplication14_Inventory_300326.Views.EquipmentEditingWindow"
|
||||||
x:DataType="vm:EquipmentEditingWindowViewModel"
|
x:DataType="vm:EquipmentEditingWindowViewModel"
|
||||||
Title="EquipmentEditingWindow">
|
Title="EquipmentEditingWindow"
|
||||||
|
SizeToContent="WidthAndHeight"
|
||||||
|
WindowStartupLocation="CenterOwner">
|
||||||
<StackPanel HorizontalAlignment="Left">
|
<StackPanel HorizontalAlignment="Left">
|
||||||
|
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<Label Content="Инвентарный номер: "></Label>
|
<Label Content="Инвентарный номер: "></Label>
|
||||||
<TextBox Text="{Binding Equipment.InvNumber}"></TextBox>
|
<TextBox Text="{Binding InvNumber}"></TextBox>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<Label Content="Название: "></Label>
|
<Label Content="Название: "></Label>
|
||||||
<TextBox Text="{Binding Equipment.Name}"></TextBox>
|
<TextBox Text="{Binding Name}"></TextBox>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<Label Content="Дата приобретения: "></Label>
|
<Label Content="Дата приобретения: "></Label>
|
||||||
<DatePicker SelectedDate="{Binding Equipment.Date}"></DatePicker>
|
<DatePicker SelectedDate="{Binding Date}"></DatePicker>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<Label Content="Цена: "></Label>
|
<Label Content="Цена: "></Label>
|
||||||
<TextBox></TextBox>
|
<TextBox Text="{Binding Cost}"></TextBox>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<Label Content="Списано ли: "></Label>
|
<Label Content="Списано ли: "></Label>
|
||||||
<TextBox></TextBox>
|
<CheckBox IsChecked="{Binding IsWrittenOff}"></CheckBox>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<Label Content="Текущий ответственный: "></Label>
|
<Label Content="Текущий ответственный: "></Label>
|
||||||
<ComboBox></ComboBox>
|
<ComboBox ItemsSource="{Binding Employees}" SelectedItem="{Binding CurrentEmployee}">
|
||||||
|
<ComboBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Label Content="{Binding FullName}"></Label>
|
||||||
|
</DataTemplate>
|
||||||
|
</ComboBox.ItemTemplate>
|
||||||
|
</ComboBox>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||||
<Button x:Name="OkButton"></Button>
|
<Button x:Name="OkButton" Command="{Binding ConfrmCommand}"></Button>
|
||||||
<Button Content="Отменить"></Button>
|
<Button Content="Отменить" Command="{Binding CloseCommand}"></Button>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Window>
|
</Window>
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ComboBox.ItemTemplate>
|
</ComboBox.ItemTemplate>
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
<Button Content="Добавить" Margin="10,0,0,0"></Button>
|
<Button Content="Добавить" Margin="10,0,0,0" Command="{Binding AddEntityCommand}"></Button>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<ScrollViewer Grid.Row="1" x:Name="ScrollViewerDataGridTech">
|
<ScrollViewer Grid.Row="1" x:Name="ScrollViewerDataGridTech">
|
||||||
<DataGrid x:Name="DataGridTech" ItemsSource="{Binding Techs}" SelectedItem="{Binding SelectedEquipmentVisual}" IsReadOnly="True">
|
<DataGrid x:Name="DataGridTech" ItemsSource="{Binding Techs}" SelectedItem="{Binding SelectedEquipmentVisual}" IsReadOnly="True">
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
<DataGridTextColumn Header="Название" Binding="{Binding Name}"></DataGridTextColumn>
|
<DataGridTextColumn Header="Название" Binding="{Binding Name}"></DataGridTextColumn>
|
||||||
<DataGridTextColumn Header="Дата приобретения" Binding="{Binding Date}"></DataGridTextColumn>
|
<DataGridTextColumn Header="Дата приобретения" Binding="{Binding Date}"></DataGridTextColumn>
|
||||||
<DataGridTextColumn Header="Стоимость" Binding="{Binding Cost}"></DataGridTextColumn>
|
<DataGridTextColumn Header="Стоимость" Binding="{Binding Cost}"></DataGridTextColumn>
|
||||||
<DataGridTextColumn Header="Списано ли" Binding="{Binding IsWrittenOff}"></DataGridTextColumn>
|
<DataGridTextColumn Header="Списано ли" Binding="{Binding IsWrittenOffString}"></DataGridTextColumn>
|
||||||
<DataGridTextColumn Header="Текущий ответственный" Binding="{Binding CurrentEmployee.FullName}"></DataGridTextColumn>
|
<DataGridTextColumn Header="Текущий ответственный" Binding="{Binding CurrentEmployee.FullName}"></DataGridTextColumn>
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -13,7 +13,7 @@ using System.Reflection;
|
||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("AvaloniaApplication14_Inventory_300326")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("AvaloniaApplication14_Inventory_300326")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+211c219a7b912ccb4d85ae18d8c9a6ea6db420d4")]
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+69e11179169a76d62cd0fe7694460e08d81c7480")]
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("AvaloniaApplication14_Inventory_300326")]
|
[assembly: System.Reflection.AssemblyProductAttribute("AvaloniaApplication14_Inventory_300326")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("AvaloniaApplication14_Inventory_300326")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("AvaloniaApplication14_Inventory_300326")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
454401d59e479b388b4887324f8782d3eb2b2898eabb3e94f09f42fd002f2e16
|
0576c4c81a455eeddc7b366511b3dde5f0890ec0fb52f054b63d3c32f7eb7b1c
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue