Лабораторная работа №4 (1)
This commit is contained in:
parent
aa64ffa1c0
commit
ac67eff242
@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -10,12 +11,18 @@ public class Client
|
|||||||
{
|
{
|
||||||
public int Id { get; private set; }
|
public int Id { get; private set; }
|
||||||
|
|
||||||
|
[DisplayName("Имя")]
|
||||||
public string Name { get; private set; } = string.Empty;
|
public string Name { get; private set; } = string.Empty;
|
||||||
|
|
||||||
|
[DisplayName("Адрес")]
|
||||||
public string Address { get; private set; } = string.Empty;
|
public string Address { get; private set; } = string.Empty;
|
||||||
|
|
||||||
|
public string Info => $"{Name} {Address}";
|
||||||
|
|
||||||
|
[DisplayName("Возраст")]
|
||||||
public int Age { get; private set; }
|
public int Age { get; private set; }
|
||||||
|
|
||||||
|
[DisplayName("Заработок")]
|
||||||
public double Earnings { get; private set; }
|
public double Earnings { get; private set; }
|
||||||
|
|
||||||
public static Client CreateEntity(int id, string name, string address, int age, double earnings)
|
public static Client CreateEntity(int id, string name, string address, int age, double earnings)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
using FurnitureCompany.Entities.Enums;
|
using FurnitureCompany.Entities.Enums;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -11,10 +12,13 @@ public class Product
|
|||||||
{
|
{
|
||||||
public int Id { get; private set; }
|
public int Id { get; private set; }
|
||||||
|
|
||||||
|
[DisplayName("Название")]
|
||||||
public string Name { get; private set; } = string.Empty;
|
public string Name { get; private set; } = string.Empty;
|
||||||
|
|
||||||
|
[DisplayName("Метариал изделия")]
|
||||||
public Material Material { get; private set; }
|
public Material Material { get; private set; }
|
||||||
|
|
||||||
|
[DisplayName("Цена")]
|
||||||
public double Price { get; private set; }
|
public double Price { get; private set; }
|
||||||
|
|
||||||
public static Product CreateEntity(int id, Material material, string name, double price)
|
public static Product CreateEntity(int id, Material material, string name, double price)
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
using FurnitureCompany.Entities.Enums;
|
using DocumentFormat.OpenXml.Office2016.Drawing.ChartDrawing;
|
||||||
|
using DocumentFormat.OpenXml.Wordprocessing;
|
||||||
|
using FurnitureCompany.Entities.Enums;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -11,10 +14,15 @@ public class Worker
|
|||||||
{
|
{
|
||||||
public int Id { get; private set; }
|
public int Id { get; private set; }
|
||||||
|
|
||||||
|
[DisplayName("Имя")]
|
||||||
public string FirstName { get; private set; } = string.Empty;
|
public string FirstName { get; private set; } = string.Empty;
|
||||||
|
|
||||||
|
[DisplayName("Фамилия")]
|
||||||
public string LastName { get; private set; } = string.Empty;
|
public string LastName { get; private set; } = string.Empty;
|
||||||
|
|
||||||
|
public string FullName => $"{FirstName} {LastName}";
|
||||||
|
|
||||||
|
[DisplayName("Уровень опыта")]
|
||||||
public WorkerPost WorkerPost { get; private set; }
|
public WorkerPost WorkerPost { get; private set; }
|
||||||
|
|
||||||
public static Worker CreateEntity(int id, string firstName, string lastName, WorkerPost workerPost)
|
public static Worker CreateEntity(int id, string firstName, string lastName, WorkerPost workerPost)
|
||||||
|
@ -26,7 +26,7 @@ namespace FurnitureCompany.Forms
|
|||||||
throw new ArgumentNullException(nameof(deliveryRepository));
|
throw new ArgumentNullException(nameof(deliveryRepository));
|
||||||
|
|
||||||
comboBoxWorker.DataSource = workerRepository.ReadWorkers();
|
comboBoxWorker.DataSource = workerRepository.ReadWorkers();
|
||||||
comboBoxWorker.DisplayMember = "FirstName";
|
comboBoxWorker.DisplayMember = "FullName";
|
||||||
comboBoxWorker.ValueMember = "Id";
|
comboBoxWorker.ValueMember = "Id";
|
||||||
|
|
||||||
ColumnProduct.DataSource = productRepository.ReadProducts();
|
ColumnProduct.DataSource = productRepository.ReadProducts();
|
||||||
|
@ -27,7 +27,7 @@ namespace FurnitureCompany.Forms
|
|||||||
throw new ArgumentNullException(nameof(invoiceRepository));
|
throw new ArgumentNullException(nameof(invoiceRepository));
|
||||||
|
|
||||||
comboBoxWorker.DataSource = workerRepository.ReadWorkers();
|
comboBoxWorker.DataSource = workerRepository.ReadWorkers();
|
||||||
comboBoxWorker.DisplayMember = "FirstName";
|
comboBoxWorker.DisplayMember = "FullName";
|
||||||
comboBoxWorker.ValueMember = "Id";
|
comboBoxWorker.ValueMember = "Id";
|
||||||
|
|
||||||
comboBoxProduct.DataSource = productRepository.ReadProducts();
|
comboBoxProduct.DataSource = productRepository.ReadProducts();
|
||||||
@ -35,7 +35,7 @@ namespace FurnitureCompany.Forms
|
|||||||
comboBoxProduct.ValueMember = "Id";
|
comboBoxProduct.ValueMember = "Id";
|
||||||
|
|
||||||
comboBoxClient.DataSource = clientRepository.ReadClients();
|
comboBoxClient.DataSource = clientRepository.ReadClients();
|
||||||
comboBoxClient.DisplayMember = "Name";
|
comboBoxClient.DisplayMember = "Info";
|
||||||
comboBoxClient.ValueMember = "Id";
|
comboBoxClient.ValueMember = "Id";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user