finskayMagazin/TovarV2/MainWindow.axaml.cs
2025-06-05 11:22:50 +03:00

49 lines
1.3 KiB
C#

using Avalonia.Controls;
using Avalonia.Interactivity;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.InteropServices.JavaScript;
namespace TovarV2
{
public partial class MainWindow : Window
{
public List<Product> products = new List<Product>();
public TextBox CodeInputBox => CodeInput;
public const string codeAdm = "0", codeUs = "1";
public static bool IsOpen { get; private set; }
public MainWindow()
{
InitializeComponent();
this.Opened += (_, _) => IsOpen = true;
this.Closed += (_, _) => IsOpen = false;
}
public void BtnVhod_OnClick(object? sender, RoutedEventArgs e)
{
string code = CodeInput.Text;
if (code == "0")
{
ListPr.codeUser = 0;
ProductEdit productEdit = new ProductEdit();
productEdit.Show();
}
else if (code == "1")
{
ListPr.codeUser = 1;
ProductEdit productEdit = new ProductEdit();
productEdit.Show();
}
this.Close();
}
}
}