exam/WinFormsApp3/MainForm.cs
2026-05-15 12:01:42 +04:00

37 lines
953 B
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.EntityFrameworkCore;
using WinFormsApp3.Models;
namespace WinFormsApp3
{
public partial class MainForm : Form
{
private PozorispSosnContext context;
private string userRole;
private string userName;
public MainForm(string role, string name = "")
{
InitializeComponent();
userRole = role?.Trim();
userName = string.IsNullOrEmpty(name) ? GetDefaultName(role): name;
label1.Text = $"Пользователь: {userName}";
label2.Text = $"Роль: {userRole}";
textBox1.TextChanged += (s, e) => LoadMaterial();
ComboBox1.SelectedIndexChanged += (s,e) => LoadMaterial
}
}
}