Частичная готовность

This commit is contained in:
GokaPek 2024-04-20 14:07:58 +04:00
parent 39a2ace734
commit 917c17228f
16 changed files with 394 additions and 155 deletions

View File

@ -12,7 +12,8 @@ namespace AbstractLawFirmContracts.BindingModels
{ {
public int Id { get; set; } public int Id { get; set; }
public int DocumentId { get; set; } public int DocumentId { get; set; }
public int Count { get; set; } public int ClientId { get; set; }
public int Count { get; set; }
public double Sum { get; set; } public double Sum { get; set; }
public OrderStatus Status { get; set; } = OrderStatus.Неизвестен; public OrderStatus Status { get; set; } = OrderStatus.Неизвестен;
public DateTime DateCreate { get; set; } = DateTime.Now; public DateTime DateCreate { get; set; } = DateTime.Now;

View File

@ -11,5 +11,6 @@ namespace AbstractLawFirmContracts.SearchModels
public int? Id { get; set; } public int? Id { get; set; }
public DateTime? DateFrom { get; set; } public DateTime? DateFrom { get; set; }
public DateTime? DateTo { get; set; } public DateTime? DateTo { get; set; }
public int? ClientId { get; set; }
} }
} }

View File

@ -16,6 +16,9 @@ namespace AbstractLawFirmContracts.ViewModels
public int DocumentId { get; set; } public int DocumentId { get; set; }
[DisplayName("Пакет документов")] [DisplayName("Пакет документов")]
public string DocumentName { get; set; } = string.Empty; public string DocumentName { get; set; } = string.Empty;
public int ClientId { get; set; }
[DisplayName("ФИО клиента")]
public string ClientFIO { get; set; } = string.Empty;
[DisplayName("Количество")] [DisplayName("Количество")]
public int Count { get; set; } public int Count { get; set; }
[DisplayName("Сумма")] [DisplayName("Сумма")]

View File

@ -11,6 +11,7 @@ namespace AbstractLawFirmDataModels.Models
public interface IOrderModel : IId public interface IOrderModel : IId
{ {
int DocumentId { get; } int DocumentId { get; }
int ClientId { get; }
int Count { get; } int Count { get; }
double Sum { get; } double Sum { get; }
OrderStatus Status { get; } OrderStatus Status { get; }

View File

@ -23,6 +23,7 @@ namespace AbstractLawFirmDataBaseImplement
public virtual DbSet<Document> Documents { set; get; } public virtual DbSet<Document> Documents { set; get; }
public virtual DbSet<DocumentComponent> DocumentComponents { set; get; } public virtual DbSet<DocumentComponent> DocumentComponents { set; get; }
public virtual DbSet<Order> Orders { set; get; } public virtual DbSet<Order> Orders { set; get; }
public virtual DbSet<Client> Clients { set; get; }
} }
} }

View File

@ -0,0 +1,85 @@
using AbstractLawFirmContracts.BindingModels;
using AbstractLawFirmContracts.SearchModels;
using AbstractLawFirmContracts.StoragesContracts;
using AbstractLawFirmContracts.ViewModels;
using AbstractLawFirmDataBaseImplement.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AbstractLawFirmDataBaseImplement.Implements
{
public class ClientStorage : IClientStorage
{
public ClientViewModel? GetElement(ClientSearchModel model)
{
if (string.IsNullOrEmpty(model.Email) && !model.Id.HasValue)
{
return null;
}
using var context = new AbstractLawFirmDatabase();
return context.Clients.FirstOrDefault(x =>
(!string.IsNullOrEmpty(model.Email) && x.Email == model.Email)
|| (model.Id.HasValue && x.Id == model.Id))?.GetViewModel;
}
public List<ClientViewModel> GetFilteredList(ClientSearchModel model)
{
if (string.IsNullOrEmpty(model.Email))
{
return new();
}
using var context = new AbstractLawFirmDatabase();
return context.Clients
.Where(x => x.Email.Contains(model.Email))
.Select(x => x.GetViewModel)
.ToList();
}
public List<ClientViewModel> GetFullList()
{
using var context = new AbstractLawFirmDatabase();
return context.Clients.Select(x => x.GetViewModel).ToList();
}
public ClientViewModel? Insert(ClientBindingModel model)
{
var newClient = Client.Create(model);
if (newClient == null)
{
return null;
}
using var context = new AbstractLawFirmDatabase();
context.Clients.Add(newClient);
context.SaveChanges();
return newClient.GetViewModel;
}
public ClientViewModel? Update(ClientBindingModel model)
{
using var context = new AbstractLawFirmDatabase();
var client = context.Clients.FirstOrDefault(x => x.Id == model.Id);
if (client == null)
{
return null;
}
client.Update(model);
context.SaveChanges();
return client.GetViewModel;
}
public ClientViewModel? Delete(ClientBindingModel model)
{
using var context = new AbstractLawFirmDatabase();
var client = context.Clients.FirstOrDefault(x => x.Id == model.Id);
if (client == null)
{
return null;
}
context.Clients.Remove(client);
context.SaveChanges();
return client.GetViewModel;
}
}
}

View File

@ -28,14 +28,15 @@ namespace AbstractLawFirmDatabaseImplement.Implements
public List<OrderViewModel> GetFilteredList(OrderSearchModel model) public List<OrderViewModel> GetFilteredList(OrderSearchModel model)
{ {
if (!model.Id.HasValue && !model.DateFrom.HasValue && !model.DateTo.HasValue) if (!model.Id.HasValue && !model.DateFrom.HasValue && !model.DateTo.HasValue && !model.ClientId.HasValue)
{ {
return new(); return new();
} }
using var context = new AbstractLawFirmDatabase(); using var context = new AbstractLawFirmDatabase();
return context.Orders return context.Orders
.Where(x => x.Id == model.Id || model.DateFrom <= x.DateCreate && x.DateCreate <= model.DateTo) .Where(x => x.Id == model.Id || model.DateFrom <= x.DateCreate && x.DateCreate <= model.DateTo || x.ClientId == model.ClientId)
.Include(x => x.Document) .Include(x => x.Document)
.Include(x => x.Client)
.Select(x => x.GetViewModel) .Select(x => x.GetViewModel)
.ToList(); .ToList();
} }
@ -43,7 +44,7 @@ namespace AbstractLawFirmDatabaseImplement.Implements
public List<OrderViewModel> GetFullList() public List<OrderViewModel> GetFullList()
{ {
using var context = new AbstractLawFirmDatabase(); using var context = new AbstractLawFirmDatabase();
return context.Orders.Include(x => x.Document).Select(x => x.GetViewModel).ToList(); return context.Orders.Include(x => x.Document).Include(x => x.Client).Select(x => x.GetViewModel).ToList();
} }
public OrderViewModel? Insert(OrderBindingModel model) public OrderViewModel? Insert(OrderBindingModel model)
@ -56,7 +57,7 @@ namespace AbstractLawFirmDatabaseImplement.Implements
using var context = new AbstractLawFirmDatabase(); using var context = new AbstractLawFirmDatabase();
context.Orders.Add(newOrder); context.Orders.Add(newOrder);
context.SaveChanges(); context.SaveChanges();
return context.Orders.Include(x => x.Document).FirstOrDefault(x => x.Id == newOrder.Id)?.GetViewModel; return context.Orders.Include(x => x.Document).Include(x => x.Client).FirstOrDefault(x => x.Id == newOrder.Id)?.GetViewModel;
} }
public OrderViewModel? Update(OrderBindingModel model) public OrderViewModel? Update(OrderBindingModel model)
@ -69,7 +70,7 @@ namespace AbstractLawFirmDatabaseImplement.Implements
} }
order.Update(model); order.Update(model);
context.SaveChanges(); context.SaveChanges();
return context.Orders.Include(x => x.Document).FirstOrDefault(x => x.Id == model.Id)?.GetViewModel; return context.Orders.Include(x => x.Document).Include(x => x.Client).FirstOrDefault(x => x.Id == model.Id)?.GetViewModel;
} }
public OrderViewModel? Delete(OrderBindingModel model) public OrderViewModel? Delete(OrderBindingModel model)
{ {

View File

@ -0,0 +1,65 @@
using AbstractLawFirmDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AbstractLawFirmDatabaseImplement.Models;
using AbstractLawFirmContracts.BindingModels;
using AbstractLawFirmContracts.ViewModels;
namespace AbstractLawFirmDataBaseImplement.Models
{
public class Client : IClientModel
{
public int Id { get; private set; }
[Required]
public string ClientFIO { get; private set; } = string.Empty;
[Required]
public string Email { get; private set; } = string.Empty;
[Required]
public string Password { get; private set; } = string.Empty;
[ForeignKey("ClientId")]
public virtual List<Order> Orders { get; set; } = new();
public static Client? Create(ClientBindingModel model)
{
if (model == null)
{
return null;
}
return new()
{
Id = model.Id,
ClientFIO = model.ClientFIO,
Email = model.Email,
Password = model.Password
};
}
public void Update(ClientBindingModel model)
{
if (model == null)
{
return;
}
ClientFIO = model.ClientFIO;
Email = model.Email;
Password = model.Password;
}
public ClientViewModel GetViewModel => new()
{
Id = Id,
ClientFIO = ClientFIO,
Email = Email,
Password = Password,
};
}
}

View File

@ -1,5 +1,6 @@
using AbstractLawFirmContracts.BindingModels; using AbstractLawFirmContracts.BindingModels;
using AbstractLawFirmContracts.ViewModels; using AbstractLawFirmContracts.ViewModels;
using AbstractLawFirmDataBaseImplement.Models;
using AbstractLawFirmDataModels.Enums; using AbstractLawFirmDataModels.Enums;
using AbstractLawFirmDataModels.Models; using AbstractLawFirmDataModels.Models;
using System; using System;
@ -17,6 +18,8 @@ namespace AbstractLawFirmDatabaseImplement.Models
[Required] [Required]
public int DocumentId { get; private set; } public int DocumentId { get; private set; }
[Required] [Required]
public int ClientId { get; private set; }
[Required]
public int Count { get; private set; } public int Count { get; private set; }
[Required] [Required]
public double Sum { get; private set; } public double Sum { get; private set; }
@ -27,6 +30,7 @@ namespace AbstractLawFirmDatabaseImplement.Models
public DateTime? DateImplement { get; private set; } public DateTime? DateImplement { get; private set; }
public virtual Document Document { get; set; } public virtual Document Document { get; set; }
public virtual Client Client { get; set; }
public static Order? Create(OrderBindingModel? model) public static Order? Create(OrderBindingModel? model)
{ {
@ -37,6 +41,7 @@ namespace AbstractLawFirmDatabaseImplement.Models
return new Order return new Order
{ {
DocumentId = model.DocumentId, DocumentId = model.DocumentId,
ClientId = model.ClientId,
Count = model.Count, Count = model.Count,
Sum = model.Sum, Sum = model.Sum,
Status = model.Status, Status = model.Status,
@ -59,13 +64,15 @@ namespace AbstractLawFirmDatabaseImplement.Models
public OrderViewModel GetViewModel => new OrderViewModel public OrderViewModel GetViewModel => new OrderViewModel
{ {
DocumentId = DocumentId, DocumentId = DocumentId,
ClientId = ClientId,
Count = Count, Count = Count,
Sum = Sum, Sum = Sum,
DateCreate = DateCreate, DateCreate = DateCreate,
DateImplement = DateImplement, DateImplement = DateImplement,
Id = Id, Id = Id,
Status = Status, Status = Status,
DocumentName = Document?.DocumentName ?? string.Empty // Безопасное использование DocumentName DocumentName = Document?.DocumentName ?? string.Empty,
ClientFIO = Client.ClientFIO
}; };
} }
} }

View File

@ -16,6 +16,7 @@ namespace AbstractLawFirmFileImplement.Models
{ {
public int Id { get; private set; } public int Id { get; private set; }
public int DocumentId { get; private set; } public int DocumentId { get; private set; }
public int ClientId { get; private set; }
public int Count { get; private set; } public int Count { get; private set; }
public double Sum { get; private set; } public double Sum { get; private set; }
public OrderStatus Status { get; private set; } = OrderStatus.Неизвестен; public OrderStatus Status { get; private set; } = OrderStatus.Неизвестен;

View File

@ -14,6 +14,7 @@ namespace AbstractLawFirmListImplement.Models
{ {
public int Id { get; private set; } public int Id { get; private set; }
public int DocumentId { get; private set; } public int DocumentId { get; private set; }
public int ClientId { get; private set; }
public int Count { get; private set; } public int Count { get; private set; }
public double Sum { get; private set; } public double Sum { get; private set; }
public OrderStatus Status { get; private set; } public OrderStatus Status { get; private set; }

View File

@ -19,12 +19,14 @@ namespace LawFirmView
private readonly ILogger _logger; private readonly ILogger _logger;
private readonly IDocumentLogic _logicD; private readonly IDocumentLogic _logicD;
private readonly IOrderLogic _logicO; private readonly IOrderLogic _logicO;
public FormCreateOrder(ILogger<FormCreateOrder> logger, IDocumentLogic logicD, IOrderLogic logicO) private readonly IClientLogic _logicC;
public FormCreateOrder(ILogger<FormCreateOrder> logger, IDocumentLogic logicD, IOrderLogic logicO, IClientLogic logicC)
{ {
InitializeComponent(); InitializeComponent();
_logger = logger; _logger = logger;
_logicD = logicD; _logicD = logicD;
_logicO = logicO; _logicO = logicO;
_logicC = logicC;
} }
private void FormCreateOrder_Load(object sender, EventArgs e) private void FormCreateOrder_Load(object sender, EventArgs e)
@ -48,6 +50,24 @@ namespace LawFirmView
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK,
MessageBoxIcon.Error); MessageBoxIcon.Error);
} }
_logger.LogInformation("Загрузка клиентов для заказа");
try
{
var list = _logicC.ReadList(null);
if (list != null)
{
comboBoxClient.DisplayMember = "ClientFIO";
comboBoxClient.ValueMember = "Id";
comboBoxClient.DataSource = list;
comboBoxClient.SelectedItem = null;
}
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка загрузки списка клиентов");
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
} }
private void CalcSum() private void CalcSum()
{ {
@ -105,12 +125,18 @@ namespace LawFirmView
MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBoxButtons.OK, MessageBoxIcon.Error);
return; return;
} }
if (comboBoxClient.SelectedValue == null)
{
MessageBox.Show("Выберите клиента", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
_logger.LogInformation("Создание заказа"); _logger.LogInformation("Создание заказа");
try try
{ {
var operationResult = _logicO.CreateOrder(new OrderBindingModel var operationResult = _logicO.CreateOrder(new OrderBindingModel
{ {
DocumentId = Convert.ToInt32(comboBoxDocument.SelectedValue), DocumentId = Convert.ToInt32(comboBoxDocument.SelectedValue),
ClientId = Convert.ToInt32(comboBoxClient.SelectedValue),
Count = Convert.ToInt32(textBoxCount.Text), Count = Convert.ToInt32(textBoxCount.Text),
Sum = Convert.ToDouble(textBoxSum.Text) Sum = Convert.ToDouble(textBoxSum.Text)
}); });

View File

@ -36,12 +36,14 @@
label3 = new Label(); label3 = new Label();
buttonSave = new Button(); buttonSave = new Button();
buttonCancel = new Button(); buttonCancel = new Button();
comboBoxClient = new ComboBox();
label4 = new Label();
SuspendLayout(); SuspendLayout();
// //
// comboBoxDocument // comboBoxDocument
// //
comboBoxDocument.FormattingEnabled = true; comboBoxDocument.FormattingEnabled = true;
comboBoxDocument.Location = new Point(133, 16); comboBoxDocument.Location = new Point(147, 16);
comboBoxDocument.Margin = new Padding(3, 4, 3, 4); comboBoxDocument.Margin = new Padding(3, 4, 3, 4);
comboBoxDocument.Name = "comboBoxDocument"; comboBoxDocument.Name = "comboBoxDocument";
comboBoxDocument.Size = new Size(226, 28); comboBoxDocument.Size = new Size(226, 28);
@ -50,7 +52,7 @@
// //
// textBoxCount // textBoxCount
// //
textBoxCount.Location = new Point(133, 55); textBoxCount.Location = new Point(147, 52);
textBoxCount.Margin = new Padding(3, 4, 3, 4); textBoxCount.Margin = new Padding(3, 4, 3, 4);
textBoxCount.Name = "textBoxCount"; textBoxCount.Name = "textBoxCount";
textBoxCount.Size = new Size(226, 27); textBoxCount.Size = new Size(226, 27);
@ -59,7 +61,7 @@
// //
// textBoxSum // textBoxSum
// //
textBoxSum.Location = new Point(133, 93); textBoxSum.Location = new Point(147, 93);
textBoxSum.Margin = new Padding(3, 4, 3, 4); textBoxSum.Margin = new Padding(3, 4, 3, 4);
textBoxSum.Name = "textBoxSum"; textBoxSum.Name = "textBoxSum";
textBoxSum.Size = new Size(226, 27); textBoxSum.Size = new Size(226, 27);
@ -115,11 +117,30 @@
buttonCancel.UseVisualStyleBackColor = true; buttonCancel.UseVisualStyleBackColor = true;
buttonCancel.Click += buttonCancel_Click; buttonCancel.Click += buttonCancel_Click;
// //
// comboBoxClient
//
comboBoxClient.FormattingEnabled = true;
comboBoxClient.Location = new Point(147, 128);
comboBoxClient.Name = "comboBoxClient";
comboBoxClient.Size = new Size(226, 28);
comboBoxClient.TabIndex = 8;
//
// label4
//
label4.AutoSize = true;
label4.Location = new Point(3, 131);
label4.Name = "label4";
label4.Size = new Size(61, 20);
label4.TabIndex = 9;
label4.Text = "Клиент:";
//
// FormCreateOrder // FormCreateOrder
// //
AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(509, 211); ClientSize = new Size(509, 211);
Controls.Add(label4);
Controls.Add(comboBoxClient);
Controls.Add(buttonCancel); Controls.Add(buttonCancel);
Controls.Add(buttonSave); Controls.Add(buttonSave);
Controls.Add(label3); Controls.Add(label3);
@ -146,5 +167,7 @@
private Label label3; private Label label3;
private Button buttonSave; private Button buttonSave;
private Button buttonCancel; private Button buttonCancel;
private ComboBox comboBoxClient;
private Label label4;
} }
} }

View File

@ -34,7 +34,8 @@ namespace LawFirmView
{ {
dataGridView.DataSource = list; dataGridView.DataSource = list;
dataGridView.Columns["DocumentId"].Visible = false; dataGridView.Columns["DocumentId"].Visible = false;
dataGridView.Columns["DocumentName"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; dataGridView.Columns["ClientId"].Visible = false;
} }
_logger.LogInformation("Загрузка заказов"); _logger.LogInformation("Загрузка заказов");
} }
@ -204,5 +205,14 @@ namespace LawFirmView
form.ShowDialog(); form.ShowDialog();
} }
} }
private void клиентыToolStripMenuItem_Click(object sender, EventArgs e)
{
var service = Program.ServiceProvider?.GetService(typeof(FormClients));
if (service is FormClients form)
{
form.ShowDialog();
}
}
} }
} }

View File

@ -28,172 +28,180 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
menuStrip1 = new MenuStrip(); this.menuStrip1 = new System.Windows.Forms.MenuStrip();
toolStripMenuItemCatalogs = new ToolStripMenuItem(); this.toolStripMenuItemCatalogs = new System.Windows.Forms.ToolStripMenuItem();
компонентыToolStripMenuItem = new ToolStripMenuItem(); this.компонентыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
пакетыДокументовToolStripMenuItem = new ToolStripMenuItem(); this.пакетыДокументовToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
dataGridView = new DataGridView(); this.клиентыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
buttonCreateOrder = new Button(); this.отчётыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
buttonTakeOrderInWork = new Button(); this.списокПакетовДокументовToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
buttonOrderReady = new Button(); this.компонентыПоПакетамДокументовToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
buttonIssuedOrder = new Button(); this.списокЗаказовToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
buttonRef = new Button(); this.dataGridView = new System.Windows.Forms.DataGridView();
отчётыToolStripMenuItem = new ToolStripMenuItem(); this.buttonCreateOrder = new System.Windows.Forms.Button();
списокЗаказовToolStripMenuItem1 = new ToolStripMenuItem(); this.buttonTakeOrderInWork = new System.Windows.Forms.Button();
списокПакетовToolStripMenuItem = new ToolStripMenuItem(); this.buttonOrderReady = new System.Windows.Forms.Button();
компонентыПоПакетамToolStripMenuItem = new ToolStripMenuItem(); this.buttonIssuedOrder = new System.Windows.Forms.Button();
menuStrip1.SuspendLayout(); this.buttonRef = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit(); this.menuStrip1.SuspendLayout();
SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
this.SuspendLayout();
// //
// menuStrip1 // menuStrip1
// //
menuStrip1.ImageScalingSize = new Size(20, 20); this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
menuStrip1.Items.AddRange(new ToolStripItem[] { toolStripMenuItemCatalogs, отчётыToolStripMenuItem }); this.toolStripMenuItemCatalogs,
menuStrip1.Location = new Point(0, 0); this.отчётыToolStripMenuItem});
menuStrip1.Name = "menuStrip1"; this.menuStrip1.Location = new System.Drawing.Point(0, 0);
menuStrip1.Padding = new Padding(7, 3, 0, 3); this.menuStrip1.Name = "menuStrip1";
menuStrip1.Size = new Size(1040, 30); this.menuStrip1.Size = new System.Drawing.Size(1047, 24);
menuStrip1.TabIndex = 0; this.menuStrip1.TabIndex = 0;
menuStrip1.Text = "Справочники"; this.menuStrip1.Text = "Справочники";
// //
// toolStripMenuItemCatalogs // toolStripMenuItemCatalogs
// //
toolStripMenuItemCatalogs.DropDownItems.AddRange(new ToolStripItem[] { компонентыToolStripMenuItem, пакетыДокументовToolStripMenuItem }); this.toolStripMenuItemCatalogs.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
toolStripMenuItemCatalogs.Name = "toolStripMenuItemCatalogs"; this.компонентыToolStripMenuItem,
toolStripMenuItemCatalogs.Size = new Size(117, 24); this.пакетыДокументовToolStripMenuItem,
toolStripMenuItemCatalogs.Text = "Справочники"; this.клиентыToolStripMenuItem});
this.toolStripMenuItemCatalogs.Name = "toolStripMenuItemCatalogs";
this.toolStripMenuItemCatalogs.Size = new System.Drawing.Size(94, 20);
this.toolStripMenuItemCatalogs.Text = "Справочники";
// //
// компонентыToolStripMenuItem // компонентыToolStripMenuItem
// //
компонентыToolStripMenuItem.Name = омпонентыToolStripMenuItem"; this.компонентыToolStripMenuItem.Name = омпонентыToolStripMenuItem";
компонентыToolStripMenuItem.Size = new Size(259, 26); this.компонентыToolStripMenuItem.Size = new System.Drawing.Size(183, 22);
компонентыToolStripMenuItem.Text = "Компоненты"; this.компонентыToolStripMenuItem.Text = "Компоненты";
компонентыToolStripMenuItem.Click += компонентыToolStripMenuItem_Click; this.компонентыToolStripMenuItem.Click += new System.EventHandler(this.компонентыToolStripMenuItem_Click);
// //
// пакетыДокументовToolStripMenuItem // пакетыДокументовToolStripMenuItem
// //
пакетыДокументовToolStripMenuItem.Name = "пакетыДокументовToolStripMenuItem"; this.пакетыДокументовToolStripMenuItem.Name = "пакетыДокументовToolStripMenuItem";
пакетыДокументовToolStripMenuItem.Size = new Size(259, 26); this.пакетыДокументовToolStripMenuItem.Size = new System.Drawing.Size(183, 22);
пакетыДокументовToolStripMenuItem.Text = "Пакеты документов"; this.пакетыДокументовToolStripMenuItem.Text = "Пакеты документов";
пакетыДокументовToolStripMenuItem.Click += пакетыДокументовToolStripMenuItem_Click; this.пакетыДокументовToolStripMenuItem.Click += new System.EventHandler(this.пакетыДокументовToolStripMenuItem_Click);
// //
// dataGridView // клиентыToolStripMenuItem
// //
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.клиентыToolStripMenuItem.Name = "клиентыToolStripMenuItem";
dataGridView.Location = new Point(0, 36); this.клиентыToolStripMenuItem.Size = new System.Drawing.Size(183, 22);
dataGridView.Margin = new Padding(3, 4, 3, 4); this.клиентыToolStripMenuItem.Text = "Клиенты";
dataGridView.Name = "dataGridView"; this.клиентыToolStripMenuItem.Click += new System.EventHandler(this.клиентыToolStripMenuItem_Click);
dataGridView.RowHeadersWidth = 51;
dataGridView.RowTemplate.Height = 25;
dataGridView.Size = new Size(841, 548);
dataGridView.TabIndex = 1;
//
// buttonCreateOrder
//
buttonCreateOrder.Location = new Point(848, 52);
buttonCreateOrder.Margin = new Padding(3, 4, 3, 4);
buttonCreateOrder.Name = "buttonCreateOrder";
buttonCreateOrder.Size = new Size(178, 35);
buttonCreateOrder.TabIndex = 2;
buttonCreateOrder.Text = "Создать заказ";
buttonCreateOrder.UseVisualStyleBackColor = true;
buttonCreateOrder.Click += buttonCreateOrder_Click;
//
// buttonTakeOrderInWork
//
buttonTakeOrderInWork.Location = new Point(848, 95);
buttonTakeOrderInWork.Margin = new Padding(3, 4, 3, 4);
buttonTakeOrderInWork.Name = "buttonTakeOrderInWork";
buttonTakeOrderInWork.Size = new Size(178, 31);
buttonTakeOrderInWork.TabIndex = 3;
buttonTakeOrderInWork.Text = "Отдать на выполнение";
buttonTakeOrderInWork.UseVisualStyleBackColor = true;
buttonTakeOrderInWork.Click += buttonTakeOrderInWork_Click;
//
// buttonOrderReady
//
buttonOrderReady.Location = new Point(848, 133);
buttonOrderReady.Margin = new Padding(3, 4, 3, 4);
buttonOrderReady.Name = "buttonOrderReady";
buttonOrderReady.Size = new Size(178, 31);
buttonOrderReady.TabIndex = 4;
buttonOrderReady.Text = "Заказ готов";
buttonOrderReady.UseVisualStyleBackColor = true;
buttonOrderReady.Click += buttonOrderReady_Click;
//
// buttonIssuedOrder
//
buttonIssuedOrder.Location = new Point(848, 172);
buttonIssuedOrder.Margin = new Padding(3, 4, 3, 4);
buttonIssuedOrder.Name = "buttonIssuedOrder";
buttonIssuedOrder.Size = new Size(178, 31);
buttonIssuedOrder.TabIndex = 5;
buttonIssuedOrder.Text = "Заказ выдан";
buttonIssuedOrder.UseVisualStyleBackColor = true;
buttonIssuedOrder.Click += buttonIssuedOrder_Click;
//
// buttonRef
//
buttonRef.Location = new Point(848, 211);
buttonRef.Margin = new Padding(3, 4, 3, 4);
buttonRef.Name = "buttonRef";
buttonRef.Size = new Size(178, 31);
buttonRef.TabIndex = 6;
buttonRef.Text = "Обновить список";
buttonRef.UseVisualStyleBackColor = true;
buttonRef.Click += buttonRef_Click;
// //
// отчётыToolStripMenuItem // отчётыToolStripMenuItem
// //
отчётыToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { списокЗаказовToolStripMenuItem1, списокПакетовToolStripMenuItem, компонентыПоПакетамToolStripMenuItem }); this.отчётыToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
отчётыToolStripMenuItem.Name = "отчётыToolStripMenuItem"; this.списокПакетовДокументовToolStripMenuItem,
отчётыToolStripMenuItem.Size = new Size(73, 24); this.компонентыПоПакетамДокументовToolStripMenuItem,
отчётыToolStripMenuItem.Text = "Отчёты"; this.списокЗаказовToolStripMenuItem});
this.отчётыToolStripMenuItem.Name = "отчётыToolStripMenuItem";
this.отчётыToolStripMenuItem.Size = new System.Drawing.Size(60, 20);
this.отчётыToolStripMenuItem.Text = "Отчёты";
// //
// списокЗаказовToolStripMenuItem1 // списокПакетовДокументовToolStripMenuItem
// //
списокЗаказовToolStripMenuItem1.Name = "списокЗаказовToolStripMenuItem1"; this.списокПакетовДокументовToolStripMenuItem.Name = "списокПакетовДокументовToolStripMenuItem";
списокЗаказовToolStripMenuItem1.Size = new Size(265, 26); this.списокПакетовДокументовToolStripMenuItem.Size = new System.Drawing.Size(278, 22);
списокЗаказовToolStripMenuItem1.Text = "Список заказов"; this.списокПакетовДокументовToolStripMenuItem.Text = "Список пакетов документов";
списокЗаказовToolStripMenuItem1.Click += списокЗаказовToolStripMenuItem_Click; this.списокПакетовДокументовToolStripMenuItem.Click += new System.EventHandler(this.списокПакетовДокументовToolStripMenuItem_Click);
// //
// списокПакетовToolStripMenuItem // компонентыПоПакетамДокументовToolStripMenuItem
// //
списокПакетовToolStripMenuItem.Name = "списокПакетовToolStripMenuItem"; this.компонентыПоПакетамДокументовToolStripMenuItem.Name = омпонентыПоПакетамДокументовToolStripMenuItem";
списокПакетовToolStripMenuItem.Size = new Size(265, 26); this.компонентыПоПакетамДокументовToolStripMenuItem.Size = new System.Drawing.Size(278, 22);
списокПакетовToolStripMenuItem.Text = "Список пакетов"; this.компонентыПоПакетамДокументовToolStripMenuItem.Text = "Компоненты по пакетам документов";
списокПакетовToolStripMenuItem.Click += списокПакетовДокументовToolStripMenuItem_Click; this.компонентыПоПакетамДокументовToolStripMenuItem.Click += new System.EventHandler(this.компонентыПоПакетамДокументовToolStripMenuItem_Click);
// //
// компонентыПоПакетамToolStripMenuItem // списокЗаказовToolStripMenuItem
// //
компонентыПоПакетамToolStripMenuItem.Name = омпонентыПоПакетамToolStripMenuItem"; this.списокЗаказовToolStripMenuItem.Name = "списокЗаказовToolStripMenuItem";
компонентыПоПакетамToolStripMenuItem.Size = new Size(265, 26); this.списокЗаказовToolStripMenuItem.Size = new System.Drawing.Size(278, 22);
компонентыПоПакетамToolStripMenuItem.Text = "Компоненты по пакетам"; this.списокЗаказовToolStripMenuItem.Text = "Список заказов";
компонентыПоПакетамToolStripMenuItem.Click += компонентыПоПакетамДокументовToolStripMenuItem_Click; this.списокЗаказовToolStripMenuItem.Click += new System.EventHandler(this.списокЗаказовToolStripMenuItem_Click);
//
// dataGridView
//
this.dataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView.Location = new System.Drawing.Point(0, 27);
this.dataGridView.Name = "dataGridView";
this.dataGridView.RowTemplate.Height = 25;
this.dataGridView.Size = new System.Drawing.Size(873, 411);
this.dataGridView.TabIndex = 1;
//
// buttonCreateOrder
//
this.buttonCreateOrder.Location = new System.Drawing.Point(879, 39);
this.buttonCreateOrder.Name = "buttonCreateOrder";
this.buttonCreateOrder.Size = new System.Drawing.Size(156, 26);
this.buttonCreateOrder.TabIndex = 2;
this.buttonCreateOrder.Text = "Создать заказ";
this.buttonCreateOrder.UseVisualStyleBackColor = true;
this.buttonCreateOrder.Click += new System.EventHandler(this.buttonCreateOrder_Click);
//
// buttonTakeOrderInWork
//
this.buttonTakeOrderInWork.Location = new System.Drawing.Point(879, 71);
this.buttonTakeOrderInWork.Name = "buttonTakeOrderInWork";
this.buttonTakeOrderInWork.Size = new System.Drawing.Size(156, 23);
this.buttonTakeOrderInWork.TabIndex = 3;
this.buttonTakeOrderInWork.Text = "Отдать на выполнение";
this.buttonTakeOrderInWork.UseVisualStyleBackColor = true;
this.buttonTakeOrderInWork.Click += new System.EventHandler(this.buttonTakeOrderInWork_Click);
//
// buttonOrderReady
//
this.buttonOrderReady.Location = new System.Drawing.Point(879, 100);
this.buttonOrderReady.Name = "buttonOrderReady";
this.buttonOrderReady.Size = new System.Drawing.Size(156, 23);
this.buttonOrderReady.TabIndex = 4;
this.buttonOrderReady.Text = "Заказ готов";
this.buttonOrderReady.UseVisualStyleBackColor = true;
this.buttonOrderReady.Click += new System.EventHandler(this.buttonOrderReady_Click);
//
// buttonIssuedOrder
//
this.buttonIssuedOrder.Location = new System.Drawing.Point(879, 129);
this.buttonIssuedOrder.Name = "buttonIssuedOrder";
this.buttonIssuedOrder.Size = new System.Drawing.Size(156, 23);
this.buttonIssuedOrder.TabIndex = 5;
this.buttonIssuedOrder.Text = "Заказ выдан";
this.buttonIssuedOrder.UseVisualStyleBackColor = true;
this.buttonIssuedOrder.Click += new System.EventHandler(this.buttonIssuedOrder_Click);
//
// buttonRef
//
this.buttonRef.Location = new System.Drawing.Point(879, 158);
this.buttonRef.Name = "buttonRef";
this.buttonRef.Size = new System.Drawing.Size(156, 23);
this.buttonRef.TabIndex = 6;
this.buttonRef.Text = "Обновить список";
this.buttonRef.UseVisualStyleBackColor = true;
this.buttonRef.Click += new System.EventHandler(this.buttonRef_Click);
// //
// FormMain // FormMain
// //
AutoScaleDimensions = new SizeF(8F, 20F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
ClientSize = new Size(1040, 636); this.ClientSize = new System.Drawing.Size(1047, 477);
Controls.Add(buttonRef); this.Controls.Add(this.buttonRef);
Controls.Add(buttonIssuedOrder); this.Controls.Add(this.buttonIssuedOrder);
Controls.Add(buttonOrderReady); this.Controls.Add(this.buttonOrderReady);
Controls.Add(buttonTakeOrderInWork); this.Controls.Add(this.buttonTakeOrderInWork);
Controls.Add(buttonCreateOrder); this.Controls.Add(this.buttonCreateOrder);
Controls.Add(dataGridView); this.Controls.Add(this.dataGridView);
Controls.Add(menuStrip1); this.Controls.Add(this.menuStrip1);
MainMenuStrip = menuStrip1; this.MainMenuStrip = this.menuStrip1;
Margin = new Padding(3, 4, 3, 4); this.Name = "FormMain";
Name = "FormMain"; this.Text = "FormMain";
Text = "FormMain"; this.Load += new System.EventHandler(this.FormMain_Load);
Load += FormMain_Load; this.menuStrip1.ResumeLayout(false);
menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout();
menuStrip1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); this.ResumeLayout(false);
ResumeLayout(false); this.PerformLayout();
PerformLayout();
} }
#endregion #endregion
@ -209,8 +217,9 @@
private Button buttonIssuedOrder; private Button buttonIssuedOrder;
private Button buttonRef; private Button buttonRef;
private ToolStripMenuItem отчётыToolStripMenuItem; private ToolStripMenuItem отчётыToolStripMenuItem;
private ToolStripMenuItem списокЗаказовToolStripMenuItem1; private ToolStripMenuItem списокПакетовДокументовToolStripMenuItem;
private ToolStripMenuItem списокПакетовToolStripMenuItem; private ToolStripMenuItem компонентыПоПакетамДокументовToolStripMenuItem;
private ToolStripMenuItem компонентыПоПакетамToolStripMenuItem; private ToolStripMenuItem списокЗаказовToolStripMenuItem;
private ToolStripMenuItem клиентыToolStripMenuItem;
} }
} }

View File

@ -8,6 +8,7 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using NLog.Extensions.Logging; using NLog.Extensions.Logging;
using System; using System;
using AbstractLawFirmDataBaseImplement.Implements;
namespace LawFirmView namespace LawFirmView
{ {
@ -39,7 +40,9 @@ namespace LawFirmView
services.AddTransient<IComponentStorage, ComponentStorage>(); services.AddTransient<IComponentStorage, ComponentStorage>();
services.AddTransient<IOrderStorage, OrderStorage>(); services.AddTransient<IOrderStorage, OrderStorage>();
services.AddTransient<IDocumentStorage, DocumentStorage>(); services.AddTransient<IDocumentStorage, DocumentStorage>();
services.AddTransient<IClientStorage, ClientStorage>();
services.AddTransient<IComponentLogic, ComponentLogic>(); services.AddTransient<IComponentLogic, ComponentLogic>();
services.AddTransient<IClientLogic, ClientLogic>();
services.AddTransient<IOrderLogic, OrderLogic>(); services.AddTransient<IOrderLogic, OrderLogic>();
services.AddTransient<IDocumentLogic, DocumentLogic>(); services.AddTransient<IDocumentLogic, DocumentLogic>();
services.AddTransient<IReportLogic, ReportLogic>(); services.AddTransient<IReportLogic, ReportLogic>();
@ -49,6 +52,7 @@ namespace LawFirmView
services.AddTransient<FormMain>(); services.AddTransient<FormMain>();
services.AddTransient<FormComponent>(); services.AddTransient<FormComponent>();
services.AddTransient<FormComponents>(); services.AddTransient<FormComponents>();
services.AddTransient<FormClients>();
services.AddTransient<FormCreateOrder>(); services.AddTransient<FormCreateOrder>();
services.AddTransient<FormDocument>(); services.AddTransient<FormDocument>();
services.AddTransient<FormDocumentComponent>(); services.AddTransient<FormDocumentComponent>();