Лови аптечку
This commit is contained in:
parent
e8749062be
commit
ad215334b3
@ -6,37 +6,39 @@ namespace SewingDressesClientApp
|
|||||||
{
|
{
|
||||||
public static class APIClient
|
public static class APIClient
|
||||||
{
|
{
|
||||||
private static readonly HttpClient _client = new();
|
private static readonly HttpClient _client = new();
|
||||||
public static ClientViewModel? Client { get; set; } = null;
|
public static ClientViewModel? Client { get; set; } = null;
|
||||||
public static void Connect(IConfiguration configuration)
|
public static void Connect(IConfiguration configuration)
|
||||||
{
|
{
|
||||||
_client.BaseAddress = new Uri(configuration["IPAddress"]!);
|
_client.BaseAddress = new Uri(configuration["IPAddress"]);
|
||||||
_client.DefaultRequestHeaders.Accept.Clear();
|
_client.DefaultRequestHeaders.Accept.Clear();
|
||||||
_client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
|
_client.DefaultRequestHeaders.Accept.Add(new
|
||||||
}
|
MediaTypeWithQualityHeaderValue("application/json"));
|
||||||
public static T? GetRequest<T>(string requestUrl)
|
}
|
||||||
{
|
public static T? GetRequest<T>(string requestUrl)
|
||||||
var response = _client.GetAsync(requestUrl);
|
{
|
||||||
var result = response.Result.Content.ReadAsStringAsync().Result;
|
var response = _client.GetAsync(requestUrl);
|
||||||
if (response.Result.IsSuccessStatusCode)
|
var result = response.Result.Content.ReadAsStringAsync().Result;
|
||||||
{
|
if (response.Result.IsSuccessStatusCode)
|
||||||
return JsonConvert.DeserializeObject<T>(result);
|
{
|
||||||
}
|
return JsonConvert.DeserializeObject<T>(result);
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
throw new Exception(result);
|
{
|
||||||
}
|
throw new Exception(result);
|
||||||
}
|
}
|
||||||
public static void PostRequest<T>(string requestUrl, T model)
|
}
|
||||||
{
|
public static void PostRequest<T>(string requestUrl, T model)
|
||||||
var json = JsonConvert.SerializeObject(model);
|
{
|
||||||
var data = new StringContent(json, Encoding.UTF8, "application/json");
|
var json = JsonConvert.SerializeObject(model);
|
||||||
var response = _client.PostAsync(requestUrl, data);
|
var data = new StringContent(json, Encoding.UTF8,
|
||||||
var result = response.Result.Content.ReadAsStringAsync().Result;
|
"application/json");
|
||||||
if (!response.Result.IsSuccessStatusCode)
|
var response = _client.PostAsync(requestUrl, data);
|
||||||
{
|
var result = response.Result.Content.ReadAsStringAsync().Result;
|
||||||
throw new Exception(result);
|
if (!response.Result.IsSuccessStatusCode)
|
||||||
}
|
{
|
||||||
}
|
throw new Exception(result);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,17 +17,16 @@ namespace SewingDressesClientApp.Controllers
|
|||||||
{
|
{
|
||||||
if (APIClient.Client == null)
|
if (APIClient.Client == null)
|
||||||
{
|
{
|
||||||
return View("Enter");
|
return Redirect("~/Home/Enter");
|
||||||
}
|
}
|
||||||
return
|
return View(APIClient.GetRequest<List<OrderViewModel>>($"api/main/getorders?clientId={APIClient.Client.Id}"));
|
||||||
View(APIClient.GetRequest<List<OrderViewModel>>($"api/main/getorders?clientId={APIClient.Client.Id}"));
|
|
||||||
}
|
}
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public IActionResult Privacy()
|
public IActionResult Privacy()
|
||||||
{
|
{
|
||||||
if (APIClient.Client == null)
|
if (APIClient.Client == null)
|
||||||
{
|
{
|
||||||
return View("Enter");
|
return Redirect("~/Home/Enter");
|
||||||
}
|
}
|
||||||
return View(APIClient.Client);
|
return View(APIClient.Client);
|
||||||
}
|
}
|
||||||
@ -78,8 +77,7 @@ namespace SewingDressesClientApp.Controllers
|
|||||||
{
|
{
|
||||||
throw new Exception("Введите логин и пароль");
|
throw new Exception("Введите логин и пароль");
|
||||||
}
|
}
|
||||||
APIClient.Client =
|
APIClient.Client = APIClient.GetRequest<ClientViewModel>($"api/client/login?login={login}&password={password}");
|
||||||
APIClient.GetRequest<ClientViewModel>($"api/client/login?login={login}&password={password}");
|
|
||||||
if (APIClient.Client == null)
|
if (APIClient.Client == null)
|
||||||
{
|
{
|
||||||
throw new Exception("Неверный логин/пароль");
|
throw new Exception("Неверный логин/пароль");
|
||||||
@ -112,8 +110,7 @@ namespace SewingDressesClientApp.Controllers
|
|||||||
[HttpGet]
|
[HttpGet]
|
||||||
public IActionResult Create()
|
public IActionResult Create()
|
||||||
{
|
{
|
||||||
ViewBag.IceCreams =
|
ViewBag.Dresses = APIClient.GetRequest<List<DressViewModel>>("api/main/getdresslist");
|
||||||
APIClient.GetRequest<List<DressViewModel>>("api/main/getdresslist");
|
|
||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
@ -140,9 +137,7 @@ namespace SewingDressesClientApp.Controllers
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public double Calc(int count, int dress)
|
public double Calc(int count, int dress)
|
||||||
{
|
{
|
||||||
var _dress =
|
var _dress = APIClient.GetRequest<DressViewModel>($"api/main/getdress?dressid={dress}");
|
||||||
APIClient.GetRequest<DressViewModel>($"api/main/getdress?dressid={dress}"
|
|
||||||
);
|
|
||||||
return Math.Round(count * (_dress?.Price ?? 1), 2);
|
return Math.Round(count * (_dress?.Price ?? 1), 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,16 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\SewingDressesContracts\SewingDressesContracts.csproj" />
|
<ProjectReference Include="..\SewingDressesContracts\SewingDressesContracts.csproj" />
|
||||||
|
<ProjectReference Include="..\SewingDressesRestApi\SewingDressesRestApi.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Update="Views\Home\Create.cshtml">
|
||||||
|
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Views\Home\Enter.cshtml">
|
||||||
|
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
Номер
|
Номер
|
||||||
</th>
|
</th>
|
||||||
<th>
|
<th>
|
||||||
Изделие
|
Платье
|
||||||
</th>
|
</th>
|
||||||
<th>
|
<th>
|
||||||
Дата создания
|
Дата создания
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<header>
|
<header>
|
||||||
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
|
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">Абстрактный магазин</a>
|
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">Пошив платьев #БЕТА</a>
|
||||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
|
||||||
aria-expanded="false" aria-label="Toggle navigation">
|
aria-expanded="false" aria-label="Toggle navigation">
|
||||||
<span class="navbar-toggler-icon"></span>
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
@ -6,5 +6,5 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"AllowedHosts": "*",
|
"AllowedHosts": "*",
|
||||||
"IPAddress": "http://localhost:7225/"
|
"IPAddress": "http://localhost:5299/"
|
||||||
}
|
}
|
@ -21,9 +21,11 @@ namespace SewingDressesDatabaseImplement.Implements
|
|||||||
}
|
}
|
||||||
using var context = new SewingDressesDatabase();
|
using var context = new SewingDressesDatabase();
|
||||||
if (model.Id.HasValue)
|
if (model.Id.HasValue)
|
||||||
return context.Orders.Where(x => x.Id == model.Id).Where(x => x.ClientId == model.ClientId).Select(x => AcessDressesStorage(x.GetViewModel, context)).ToList();
|
return context.Orders.Where(x => x.Id == model.Id).Select(x => AcessDressesStorage(x.GetViewModel, context)).ToList();
|
||||||
else
|
else if (model.ClientId.HasValue)
|
||||||
return context.Orders.Where(x => x.DateCreate >= model.DateFrom).Where(x => x.ClientId == model.ClientId).Where(x => x.DateCreate <= model.DateTo).Select(x => AcessDressesStorage(x.GetViewModel, context)).ToList();
|
return context.Orders.Where(x => x.ClientId == model.ClientId).Select(x => AcessDressesStorage(x.GetViewModel, context)).ToList();
|
||||||
|
else
|
||||||
|
return context.Orders.Where(x => x.DateCreate >= model.DateFrom).Where(x => x.DateCreate <= model.DateTo).Select(x => AcessDressesStorage(x.GetViewModel, context)).ToList();
|
||||||
}
|
}
|
||||||
public OrderViewModel? GetElement(OrderSearchModel model)
|
public OrderViewModel? GetElement(OrderSearchModel model)
|
||||||
{
|
{
|
||||||
|
@ -6,63 +6,59 @@ using Microsoft.AspNetCore.Mvc;
|
|||||||
|
|
||||||
namespace SewingDressesRestApi.Controllers
|
namespace SewingDressesRestApi.Controllers
|
||||||
{
|
{
|
||||||
[Route("api/[controller]/[action]")]
|
[Route("api/[controller]/[action]")]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
public class ClientController : Controller
|
public class ClientController : Controller
|
||||||
{
|
{
|
||||||
private readonly ILogger _logger;
|
private readonly ILogger _logger;
|
||||||
private readonly IClientLogic _logic;
|
private readonly IClientLogic _logic;
|
||||||
public ClientController(IClientLogic logic, ILogger<ClientController> logger)
|
public ClientController(IClientLogic logic, ILogger<ClientController> logger)
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_logic = logic;
|
_logic = logic;
|
||||||
}
|
}
|
||||||
|
[HttpGet]
|
||||||
[HttpGet]
|
public ClientViewModel? Login(string login, string password)
|
||||||
public ClientViewModel? Login(string login, string password)
|
{
|
||||||
{
|
try
|
||||||
try
|
{
|
||||||
{
|
return _logic.ReadElement(new ClientSearchModel
|
||||||
return _logic.ReadElement(new ClientSearchModel
|
{
|
||||||
{
|
Email = login,
|
||||||
Email = login,
|
Password = password
|
||||||
Password = password
|
});
|
||||||
});
|
}
|
||||||
}
|
catch (Exception ex)
|
||||||
catch (Exception ex)
|
{
|
||||||
{
|
_logger.LogError(ex, "Ошибка входа в систему");
|
||||||
_logger.LogError(ex, "Ошибка входа в систему");
|
throw;
|
||||||
throw;
|
}
|
||||||
}
|
}
|
||||||
}
|
[HttpPost]
|
||||||
|
public void Register(ClientBindingModel model)
|
||||||
[HttpPost]
|
{
|
||||||
public void Register(ClientBindingModel model)
|
try
|
||||||
{
|
{
|
||||||
try
|
_logic.Create(model);
|
||||||
{
|
}
|
||||||
_logic.Create(model);
|
catch (Exception ex)
|
||||||
}
|
{
|
||||||
catch (Exception ex)
|
_logger.LogError(ex, "Ошибка регистрации");
|
||||||
{
|
throw;
|
||||||
_logger.LogError(ex, "Ошибка регистрации");
|
}
|
||||||
throw;
|
}
|
||||||
}
|
[HttpPost]
|
||||||
}
|
public void UpdateData(ClientBindingModel model)
|
||||||
|
{
|
||||||
[HttpPost]
|
try
|
||||||
public void UpdateData(ClientBindingModel model)
|
{
|
||||||
{
|
_logic.Update(model);
|
||||||
try
|
}
|
||||||
{
|
catch (Exception ex)
|
||||||
_logic.Update(model);
|
{
|
||||||
}
|
_logger.LogError(ex, "Ошибка обновления данных");
|
||||||
catch (Exception ex)
|
throw;
|
||||||
{
|
}
|
||||||
_logger.LogError(ex, "Ошибка обновления данных");
|
}
|
||||||
throw;
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@ using SewingDressesContracts.BusinessLogicsContracts;
|
|||||||
using SewingDressesContracts.StoragesContracts;
|
using SewingDressesContracts.StoragesContracts;
|
||||||
using SewingDressesDatabaseImplement.Implements;
|
using SewingDressesDatabaseImplement.Implements;
|
||||||
using Microsoft.OpenApi.Models;
|
using Microsoft.OpenApi.Models;
|
||||||
using NLog.Extensions.Logging;
|
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
|
90
SewingDresses/SewingDressesView/ClientsForm.Designer.cs
generated
Normal file
90
SewingDresses/SewingDressesView/ClientsForm.Designer.cs
generated
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
namespace SewingDressesView
|
||||||
|
{
|
||||||
|
partial class ClientsForm
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
dataGridView = new DataGridView();
|
||||||
|
buttonDelete = new Button();
|
||||||
|
buttonUpdate = new Button();
|
||||||
|
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// dataGridView
|
||||||
|
//
|
||||||
|
dataGridView.AllowUserToAddRows = false;
|
||||||
|
dataGridView.AllowUserToDeleteRows = false;
|
||||||
|
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
|
dataGridView.Location = new Point(12, 12);
|
||||||
|
dataGridView.Name = "dataGridView";
|
||||||
|
dataGridView.ReadOnly = true;
|
||||||
|
dataGridView.RowHeadersWidth = 51;
|
||||||
|
dataGridView.RowTemplate.Height = 29;
|
||||||
|
dataGridView.Size = new Size(568, 358);
|
||||||
|
dataGridView.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// buttonDelete
|
||||||
|
//
|
||||||
|
buttonDelete.Location = new Point(654, 46);
|
||||||
|
buttonDelete.Name = "buttonDelete";
|
||||||
|
buttonDelete.Size = new Size(94, 29);
|
||||||
|
buttonDelete.TabIndex = 1;
|
||||||
|
buttonDelete.Text = "Удалить";
|
||||||
|
buttonDelete.UseVisualStyleBackColor = true;
|
||||||
|
buttonDelete.Click += buttonDelete_Click;
|
||||||
|
//
|
||||||
|
// buttonUpdate
|
||||||
|
//
|
||||||
|
buttonUpdate.Location = new Point(654, 105);
|
||||||
|
buttonUpdate.Name = "buttonUpdate";
|
||||||
|
buttonUpdate.Size = new Size(94, 29);
|
||||||
|
buttonUpdate.TabIndex = 2;
|
||||||
|
buttonUpdate.Text = "Обновить";
|
||||||
|
buttonUpdate.UseVisualStyleBackColor = true;
|
||||||
|
buttonUpdate.Click += buttonUpdate_Click;
|
||||||
|
//
|
||||||
|
// ClientsForm
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
ClientSize = new Size(800, 374);
|
||||||
|
Controls.Add(buttonUpdate);
|
||||||
|
Controls.Add(buttonDelete);
|
||||||
|
Controls.Add(dataGridView);
|
||||||
|
Name = "ClientsForm";
|
||||||
|
Text = "ClientsForm";
|
||||||
|
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||||
|
ResumeLayout(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private DataGridView dataGridView;
|
||||||
|
private Button buttonDelete;
|
||||||
|
private Button buttonUpdate;
|
||||||
|
}
|
||||||
|
}
|
83
SewingDresses/SewingDressesView/ClientsForm.cs
Normal file
83
SewingDresses/SewingDressesView/ClientsForm.cs
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using SewingDressesContracts.BindingModels;
|
||||||
|
using SewingDressesContracts.BusinessLogicsContracts;
|
||||||
|
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;
|
||||||
|
|
||||||
|
namespace SewingDressesView
|
||||||
|
{
|
||||||
|
public partial class ClientsForm : Form
|
||||||
|
{
|
||||||
|
private readonly ILogger _logger;
|
||||||
|
private readonly IClientLogic _clientLogic;
|
||||||
|
|
||||||
|
public ClientsForm(ILogger<ClientsForm> logger, IClientLogic clientLogic)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_logger = logger;
|
||||||
|
_clientLogic = clientLogic;
|
||||||
|
LoadData();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buttonDelete_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (dataGridView.SelectedRows.Count == 1)
|
||||||
|
{
|
||||||
|
if (MessageBox.Show("Удалить запись?", "Вопрос", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||||
|
{
|
||||||
|
int id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
|
||||||
|
_logger.LogInformation("Delete client");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (!_clientLogic.Delete(new ClientBindingModel
|
||||||
|
{
|
||||||
|
Id = id
|
||||||
|
}))
|
||||||
|
{
|
||||||
|
throw new Exception("Ошибка при удалении. Дополнительная информация в логах.");
|
||||||
|
}
|
||||||
|
LoadData();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Delete client error");
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
private void LoadData()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var list = _clientLogic.ReadList(null);
|
||||||
|
if (list != null)
|
||||||
|
{
|
||||||
|
dataGridView.DataSource = list;
|
||||||
|
dataGridView.Columns["Id"].Visible = false;
|
||||||
|
dataGridView.Columns["ClientFIO"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
|
||||||
|
dataGridView.Columns["Password"].Visible = false;
|
||||||
|
}
|
||||||
|
_logger.LogInformation("Load clients");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Load clients error");
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buttonUpdate_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
LoadData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
120
SewingDresses/SewingDressesView/ClientsForm.resx
Normal file
120
SewingDresses/SewingDressesView/ClientsForm.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
409
SewingDresses/SewingDressesView/MainForm.Designer.cs
generated
409
SewingDresses/SewingDressesView/MainForm.Designer.cs
generated
@ -1,208 +1,217 @@
|
|||||||
namespace SewingDressesView
|
namespace SewingDressesView
|
||||||
{
|
{
|
||||||
partial class MainForm
|
partial class MainForm
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Required designer variable.
|
/// Required designer variable.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private System.ComponentModel.IContainer components = null;
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Clean up any resources being used.
|
/// Clean up any resources being used.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
protected override void Dispose(bool disposing)
|
protected override void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
if (disposing && (components != null))
|
if (disposing && (components != null))
|
||||||
{
|
{
|
||||||
components.Dispose();
|
components.Dispose();
|
||||||
}
|
}
|
||||||
base.Dispose(disposing);
|
base.Dispose(disposing);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Windows Form Designer generated code
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Required method for Designer support - do not modify
|
/// Required method for Designer support - do not modify
|
||||||
/// the contents of this method with the code editor.
|
/// the contents of this method with the code editor.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
dataGridView = new DataGridView();
|
dataGridView = new DataGridView();
|
||||||
buttonCreate = new Button();
|
buttonCreate = new Button();
|
||||||
buttonDoOrder = new Button();
|
buttonDoOrder = new Button();
|
||||||
buttonOrderReady = new Button();
|
buttonOrderReady = new Button();
|
||||||
buttonOrderGive = new Button();
|
buttonOrderGive = new Button();
|
||||||
buttonOrderUpdate = new Button();
|
buttonOrderUpdate = new Button();
|
||||||
menuStrip1 = new MenuStrip();
|
menuStrip1 = new MenuStrip();
|
||||||
справочникиToolStripMenuItem = new ToolStripMenuItem();
|
справочникиToolStripMenuItem = new ToolStripMenuItem();
|
||||||
компонентыToolStripMenuItem = new ToolStripMenuItem();
|
компонентыToolStripMenuItem = new ToolStripMenuItem();
|
||||||
платьяToolStripMenuItem = new ToolStripMenuItem();
|
платьяToolStripMenuItem = new ToolStripMenuItem();
|
||||||
отчетыToolStripMenuItem = new ToolStripMenuItem();
|
отчетыToolStripMenuItem = new ToolStripMenuItem();
|
||||||
DressesReportToolStripMenuItem = new ToolStripMenuItem();
|
DressesReportToolStripMenuItem = new ToolStripMenuItem();
|
||||||
компонентыПоИзделиямToolStripMenuItem = new ToolStripMenuItem();
|
компонентыПоИзделиямToolStripMenuItem = new ToolStripMenuItem();
|
||||||
списокЗаказовToolStripMenuItem = new ToolStripMenuItem();
|
списокЗаказовToolStripMenuItem = new ToolStripMenuItem();
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
clientsToolStripMenuItem = new ToolStripMenuItem();
|
||||||
menuStrip1.SuspendLayout();
|
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||||
SuspendLayout();
|
menuStrip1.SuspendLayout();
|
||||||
//
|
SuspendLayout();
|
||||||
// dataGridView
|
//
|
||||||
//
|
// dataGridView
|
||||||
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
//
|
||||||
dataGridView.Location = new Point(2, 39);
|
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
dataGridView.Name = "dataGridView";
|
dataGridView.Location = new Point(2, 39);
|
||||||
dataGridView.RowHeadersWidth = 51;
|
dataGridView.Name = "dataGridView";
|
||||||
dataGridView.RowTemplate.Height = 29;
|
dataGridView.RowHeadersWidth = 51;
|
||||||
dataGridView.Size = new Size(804, 447);
|
dataGridView.RowTemplate.Height = 29;
|
||||||
dataGridView.TabIndex = 0;
|
dataGridView.Size = new Size(804, 447);
|
||||||
//
|
dataGridView.TabIndex = 0;
|
||||||
// buttonCreate
|
//
|
||||||
//
|
// buttonCreate
|
||||||
buttonCreate.Location = new Point(854, 62);
|
//
|
||||||
buttonCreate.Name = "buttonCreate";
|
buttonCreate.Location = new Point(854, 62);
|
||||||
buttonCreate.Size = new Size(194, 37);
|
buttonCreate.Name = "buttonCreate";
|
||||||
buttonCreate.TabIndex = 1;
|
buttonCreate.Size = new Size(194, 37);
|
||||||
buttonCreate.Text = "Создать заказ";
|
buttonCreate.TabIndex = 1;
|
||||||
buttonCreate.UseVisualStyleBackColor = true;
|
buttonCreate.Text = "Создать заказ";
|
||||||
buttonCreate.Click += buttonCreate_Click;
|
buttonCreate.UseVisualStyleBackColor = true;
|
||||||
//
|
buttonCreate.Click += buttonCreate_Click;
|
||||||
// buttonDoOrder
|
//
|
||||||
//
|
// buttonDoOrder
|
||||||
buttonDoOrder.Location = new Point(854, 130);
|
//
|
||||||
buttonDoOrder.Name = "buttonDoOrder";
|
buttonDoOrder.Location = new Point(854, 130);
|
||||||
buttonDoOrder.Size = new Size(194, 37);
|
buttonDoOrder.Name = "buttonDoOrder";
|
||||||
buttonDoOrder.TabIndex = 2;
|
buttonDoOrder.Size = new Size(194, 37);
|
||||||
buttonDoOrder.Text = "Отдать на выполнение";
|
buttonDoOrder.TabIndex = 2;
|
||||||
buttonDoOrder.UseVisualStyleBackColor = true;
|
buttonDoOrder.Text = "Отдать на выполнение";
|
||||||
buttonDoOrder.Click += buttonDoOrder_Click;
|
buttonDoOrder.UseVisualStyleBackColor = true;
|
||||||
//
|
buttonDoOrder.Click += buttonDoOrder_Click;
|
||||||
// buttonOrderReady
|
//
|
||||||
//
|
// buttonOrderReady
|
||||||
buttonOrderReady.Location = new Point(854, 205);
|
//
|
||||||
buttonOrderReady.Name = "buttonOrderReady";
|
buttonOrderReady.Location = new Point(854, 205);
|
||||||
buttonOrderReady.Size = new Size(194, 37);
|
buttonOrderReady.Name = "buttonOrderReady";
|
||||||
buttonOrderReady.TabIndex = 3;
|
buttonOrderReady.Size = new Size(194, 37);
|
||||||
buttonOrderReady.Text = "Заказ готов";
|
buttonOrderReady.TabIndex = 3;
|
||||||
buttonOrderReady.UseVisualStyleBackColor = true;
|
buttonOrderReady.Text = "Заказ готов";
|
||||||
buttonOrderReady.Click += buttonOrderReady_Click;
|
buttonOrderReady.UseVisualStyleBackColor = true;
|
||||||
//
|
buttonOrderReady.Click += buttonOrderReady_Click;
|
||||||
// buttonOrderGive
|
//
|
||||||
//
|
// buttonOrderGive
|
||||||
buttonOrderGive.Location = new Point(854, 280);
|
//
|
||||||
buttonOrderGive.Name = "buttonOrderGive";
|
buttonOrderGive.Location = new Point(854, 280);
|
||||||
buttonOrderGive.Size = new Size(194, 37);
|
buttonOrderGive.Name = "buttonOrderGive";
|
||||||
buttonOrderGive.TabIndex = 4;
|
buttonOrderGive.Size = new Size(194, 37);
|
||||||
buttonOrderGive.Text = "Заказ выдан";
|
buttonOrderGive.TabIndex = 4;
|
||||||
buttonOrderGive.UseVisualStyleBackColor = true;
|
buttonOrderGive.Text = "Заказ выдан";
|
||||||
buttonOrderGive.Click += buttonOrderGive_Click;
|
buttonOrderGive.UseVisualStyleBackColor = true;
|
||||||
//
|
buttonOrderGive.Click += buttonOrderGive_Click;
|
||||||
// buttonOrderUpdate
|
//
|
||||||
//
|
// buttonOrderUpdate
|
||||||
buttonOrderUpdate.Location = new Point(854, 357);
|
//
|
||||||
buttonOrderUpdate.Name = "buttonOrderUpdate";
|
buttonOrderUpdate.Location = new Point(854, 357);
|
||||||
buttonOrderUpdate.Size = new Size(194, 37);
|
buttonOrderUpdate.Name = "buttonOrderUpdate";
|
||||||
buttonOrderUpdate.TabIndex = 5;
|
buttonOrderUpdate.Size = new Size(194, 37);
|
||||||
buttonOrderUpdate.Text = "Обновить список";
|
buttonOrderUpdate.TabIndex = 5;
|
||||||
buttonOrderUpdate.UseVisualStyleBackColor = true;
|
buttonOrderUpdate.Text = "Обновить список";
|
||||||
buttonOrderUpdate.Click += buttonOrderUpdate_Click;
|
buttonOrderUpdate.UseVisualStyleBackColor = true;
|
||||||
//
|
buttonOrderUpdate.Click += buttonOrderUpdate_Click;
|
||||||
// menuStrip1
|
//
|
||||||
//
|
// menuStrip1
|
||||||
menuStrip1.ImageScalingSize = new Size(20, 20);
|
//
|
||||||
menuStrip1.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem, отчетыToolStripMenuItem });
|
menuStrip1.ImageScalingSize = new Size(20, 20);
|
||||||
menuStrip1.Location = new Point(0, 0);
|
menuStrip1.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem, отчетыToolStripMenuItem });
|
||||||
menuStrip1.Name = "menuStrip1";
|
menuStrip1.Location = new Point(0, 0);
|
||||||
menuStrip1.Size = new Size(1096, 28);
|
menuStrip1.Name = "menuStrip1";
|
||||||
menuStrip1.TabIndex = 6;
|
menuStrip1.Size = new Size(1096, 28);
|
||||||
menuStrip1.Text = "menuStrip1";
|
menuStrip1.TabIndex = 6;
|
||||||
//
|
menuStrip1.Text = "menuStrip1";
|
||||||
// справочникиToolStripMenuItem
|
//
|
||||||
//
|
// справочникиToolStripMenuItem
|
||||||
справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { компонентыToolStripMenuItem, платьяToolStripMenuItem });
|
//
|
||||||
справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem";
|
справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { компонентыToolStripMenuItem, платьяToolStripMenuItem, clientsToolStripMenuItem });
|
||||||
справочникиToolStripMenuItem.Size = new Size(117, 24);
|
справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem";
|
||||||
справочникиToolStripMenuItem.Text = "Справочники";
|
справочникиToolStripMenuItem.Size = new Size(117, 24);
|
||||||
//
|
справочникиToolStripMenuItem.Text = "Справочники";
|
||||||
// компонентыToolStripMenuItem
|
//
|
||||||
//
|
// компонентыToolStripMenuItem
|
||||||
компонентыToolStripMenuItem.Name = "компонентыToolStripMenuItem";
|
//
|
||||||
компонентыToolStripMenuItem.Size = new Size(182, 26);
|
компонентыToolStripMenuItem.Name = "компонентыToolStripMenuItem";
|
||||||
компонентыToolStripMenuItem.Text = "Компоненты";
|
компонентыToolStripMenuItem.Size = new Size(224, 26);
|
||||||
компонентыToolStripMenuItem.Click += ComponentsToolStripMenuItem_Click;
|
компонентыToolStripMenuItem.Text = "Компоненты";
|
||||||
//
|
компонентыToolStripMenuItem.Click += ComponentsToolStripMenuItem_Click;
|
||||||
// платьяToolStripMenuItem
|
//
|
||||||
//
|
// платьяToolStripMenuItem
|
||||||
платьяToolStripMenuItem.Name = "платьяToolStripMenuItem";
|
//
|
||||||
платьяToolStripMenuItem.Size = new Size(182, 26);
|
платьяToolStripMenuItem.Name = "платьяToolStripMenuItem";
|
||||||
платьяToolStripMenuItem.Text = "Платья";
|
платьяToolStripMenuItem.Size = new Size(224, 26);
|
||||||
платьяToolStripMenuItem.Click += DressesToolStripMenuItem_Click;
|
платьяToolStripMenuItem.Text = "Платья";
|
||||||
//
|
платьяToolStripMenuItem.Click += DressesToolStripMenuItem_Click;
|
||||||
// отчетыToolStripMenuItem
|
//
|
||||||
//
|
// отчетыToolStripMenuItem
|
||||||
отчетыToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { DressesReportToolStripMenuItem, компонентыПоИзделиямToolStripMenuItem, списокЗаказовToolStripMenuItem });
|
//
|
||||||
отчетыToolStripMenuItem.Name = "отчетыToolStripMenuItem";
|
отчетыToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { DressesReportToolStripMenuItem, компонентыПоИзделиямToolStripMenuItem, списокЗаказовToolStripMenuItem });
|
||||||
отчетыToolStripMenuItem.Size = new Size(73, 24);
|
отчетыToolStripMenuItem.Name = "отчетыToolStripMenuItem";
|
||||||
отчетыToolStripMenuItem.Text = "Отчеты";
|
отчетыToolStripMenuItem.Size = new Size(73, 24);
|
||||||
//
|
отчетыToolStripMenuItem.Text = "Отчеты";
|
||||||
// DressesReportToolStripMenuItem
|
//
|
||||||
//
|
// DressesReportToolStripMenuItem
|
||||||
DressesReportToolStripMenuItem.Name = "DressesReportToolStripMenuItem";
|
//
|
||||||
DressesReportToolStripMenuItem.Size = new Size(276, 26);
|
DressesReportToolStripMenuItem.Name = "DressesReportToolStripMenuItem";
|
||||||
DressesReportToolStripMenuItem.Text = "Список платьев";
|
DressesReportToolStripMenuItem.Size = new Size(276, 26);
|
||||||
DressesReportToolStripMenuItem.Click += DressesToolStripMenuItemReport_Click;
|
DressesReportToolStripMenuItem.Text = "Список платьев";
|
||||||
//
|
DressesReportToolStripMenuItem.Click += DressesToolStripMenuItemReport_Click;
|
||||||
// компонентыПоИзделиямToolStripMenuItem
|
//
|
||||||
//
|
// компонентыПоИзделиямToolStripMenuItem
|
||||||
компонентыПоИзделиямToolStripMenuItem.Name = "компонентыПоИзделиямToolStripMenuItem";
|
//
|
||||||
компонентыПоИзделиямToolStripMenuItem.Size = new Size(276, 26);
|
компонентыПоИзделиямToolStripMenuItem.Name = "компонентыПоИзделиямToolStripMenuItem";
|
||||||
компонентыПоИзделиямToolStripMenuItem.Text = "Компоненты по изделиям";
|
компонентыПоИзделиямToolStripMenuItem.Size = new Size(276, 26);
|
||||||
компонентыПоИзделиямToolStripMenuItem.Click += ComponentProductsToolStripMenuItemReport_Click;
|
компонентыПоИзделиямToolStripMenuItem.Text = "Компоненты по изделиям";
|
||||||
//
|
компонентыПоИзделиямToolStripMenuItem.Click += ComponentProductsToolStripMenuItemReport_Click;
|
||||||
// списокЗаказовToolStripMenuItem
|
//
|
||||||
//
|
// списокЗаказовToolStripMenuItem
|
||||||
списокЗаказовToolStripMenuItem.Name = "списокЗаказовToolStripMenuItem";
|
//
|
||||||
списокЗаказовToolStripMenuItem.Size = new Size(276, 26);
|
списокЗаказовToolStripMenuItem.Name = "списокЗаказовToolStripMenuItem";
|
||||||
списокЗаказовToolStripMenuItem.Text = "Список заказов";
|
списокЗаказовToolStripMenuItem.Size = new Size(276, 26);
|
||||||
списокЗаказовToolStripMenuItem.Click += OrdersToolStripMenuItemReport_Click;
|
списокЗаказовToolStripMenuItem.Text = "Список заказов";
|
||||||
//
|
списокЗаказовToolStripMenuItem.Click += OrdersToolStripMenuItemReport_Click;
|
||||||
// MainForm
|
//
|
||||||
//
|
// clientsToolStripMenuItem
|
||||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
//
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
clientsToolStripMenuItem.Name = "clientsToolStripMenuItem";
|
||||||
ClientSize = new Size(1096, 493);
|
clientsToolStripMenuItem.Size = new Size(224, 26);
|
||||||
Controls.Add(buttonOrderUpdate);
|
clientsToolStripMenuItem.Text = "Клиенты";
|
||||||
Controls.Add(buttonOrderGive);
|
clientsToolStripMenuItem.Click += clientsToolStripMenuItem_Click;
|
||||||
Controls.Add(buttonOrderReady);
|
//
|
||||||
Controls.Add(buttonDoOrder);
|
// MainForm
|
||||||
Controls.Add(buttonCreate);
|
//
|
||||||
Controls.Add(dataGridView);
|
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||||
Controls.Add(menuStrip1);
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
MainMenuStrip = menuStrip1;
|
ClientSize = new Size(1096, 493);
|
||||||
Name = "MainForm";
|
Controls.Add(buttonOrderUpdate);
|
||||||
Text = "Магазин пошива одежды";
|
Controls.Add(buttonOrderGive);
|
||||||
Load += MainForm_Load;
|
Controls.Add(buttonOrderReady);
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
Controls.Add(buttonDoOrder);
|
||||||
menuStrip1.ResumeLayout(false);
|
Controls.Add(buttonCreate);
|
||||||
menuStrip1.PerformLayout();
|
Controls.Add(dataGridView);
|
||||||
ResumeLayout(false);
|
Controls.Add(menuStrip1);
|
||||||
PerformLayout();
|
MainMenuStrip = menuStrip1;
|
||||||
}
|
Name = "MainForm";
|
||||||
|
Text = "Магазин пошива одежды";
|
||||||
|
Load += MainForm_Load;
|
||||||
|
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||||
|
menuStrip1.ResumeLayout(false);
|
||||||
|
menuStrip1.PerformLayout();
|
||||||
|
ResumeLayout(false);
|
||||||
|
PerformLayout();
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private DataGridView dataGridView;
|
private DataGridView dataGridView;
|
||||||
private Button buttonCreate;
|
private Button buttonCreate;
|
||||||
private Button buttonDoOrder;
|
private Button buttonDoOrder;
|
||||||
private Button buttonOrderReady;
|
private Button buttonOrderReady;
|
||||||
private Button buttonOrderGive;
|
private Button buttonOrderGive;
|
||||||
private Button buttonOrderUpdate;
|
private Button buttonOrderUpdate;
|
||||||
private MenuStrip menuStrip1;
|
private MenuStrip menuStrip1;
|
||||||
private ToolStripMenuItem справочникиToolStripMenuItem;
|
private ToolStripMenuItem справочникиToolStripMenuItem;
|
||||||
private ToolStripMenuItem компонентыToolStripMenuItem;
|
private ToolStripMenuItem компонентыToolStripMenuItem;
|
||||||
private ToolStripMenuItem платьяToolStripMenuItem;
|
private ToolStripMenuItem платьяToolStripMenuItem;
|
||||||
private ToolStripMenuItem отчетыToolStripMenuItem;
|
private ToolStripMenuItem отчетыToolStripMenuItem;
|
||||||
private ToolStripMenuItem DressesReportToolStripMenuItem;
|
private ToolStripMenuItem DressesReportToolStripMenuItem;
|
||||||
private ToolStripMenuItem компонентыПоИзделиямToolStripMenuItem;
|
private ToolStripMenuItem компонентыПоИзделиямToolStripMenuItem;
|
||||||
private ToolStripMenuItem списокЗаказовToolStripMenuItem;
|
private ToolStripMenuItem списокЗаказовToolStripMenuItem;
|
||||||
}
|
private ToolStripMenuItem clientsToolStripMenuItem;
|
||||||
|
}
|
||||||
}
|
}
|
@ -6,177 +6,187 @@ using SewingDressesBusinessLogic.BusinessLogic;
|
|||||||
|
|
||||||
namespace SewingDressesView
|
namespace SewingDressesView
|
||||||
{
|
{
|
||||||
public partial class MainForm : Form
|
public partial class MainForm : Form
|
||||||
{
|
{
|
||||||
private readonly ILogger _logger;
|
private readonly ILogger _logger;
|
||||||
private readonly IOrderLogic _orderLogic;
|
private readonly IOrderLogic _orderLogic;
|
||||||
private readonly IReportLogic _reportLogic;
|
private readonly IReportLogic _reportLogic;
|
||||||
public MainForm(ILogger<MainForm> logger, IOrderLogic orderLogic, IReportLogic reportLogic)
|
public MainForm(ILogger<MainForm> logger, IOrderLogic orderLogic, IReportLogic reportLogic)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_orderLogic = orderLogic;
|
_orderLogic = orderLogic;
|
||||||
_reportLogic = reportLogic;
|
_reportLogic = reportLogic;
|
||||||
}
|
}
|
||||||
private void LoadData()
|
private void LoadData()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var list = _orderLogic.ReadList(null);
|
var list = _orderLogic.ReadList(null);
|
||||||
if (list != null)
|
if (list != null)
|
||||||
{
|
{
|
||||||
dataGridView.DataSource = list;
|
dataGridView.DataSource = list;
|
||||||
dataGridView.Columns["DressId"].Visible = false;
|
dataGridView.Columns["DressId"].Visible = false;
|
||||||
}
|
dataGridView.Columns["ClientId"].Visible = false;
|
||||||
_logger.LogInformation("Load orders");
|
}
|
||||||
}
|
_logger.LogInformation("Load orders");
|
||||||
catch (Exception ex)
|
}
|
||||||
{
|
catch (Exception ex)
|
||||||
_logger.LogError(ex, "Load orders error");
|
{
|
||||||
}
|
_logger.LogError(ex, "Load orders error");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void ComponentsToolStripMenuItem_Click(object sender, EventArgs e)
|
private void ComponentsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var service = Program.ServiceProvider?.GetService(typeof(ComponentsForm));
|
var service = Program.ServiceProvider?.GetService(typeof(ComponentsForm));
|
||||||
if (service is ComponentsForm form)
|
if (service is ComponentsForm form)
|
||||||
{
|
{
|
||||||
form.ShowDialog();
|
form.ShowDialog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DressesToolStripMenuItem_Click(object sender, EventArgs e)
|
private void DressesToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var service = Program.ServiceProvider?.GetService(typeof(DressesForm));
|
var service = Program.ServiceProvider?.GetService(typeof(DressesForm));
|
||||||
if (service is DressesForm form)
|
if (service is DressesForm form)
|
||||||
{
|
{
|
||||||
form.ShowDialog();
|
form.ShowDialog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void buttonCreate_Click(object sender, EventArgs e)
|
private void buttonCreate_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var service = Program.ServiceProvider?.GetService(typeof(OrderForm));
|
var service = Program.ServiceProvider?.GetService(typeof(OrderForm));
|
||||||
if (service is OrderForm form)
|
if (service is OrderForm form)
|
||||||
{
|
{
|
||||||
form.ShowDialog();
|
form.ShowDialog();
|
||||||
LoadData();
|
LoadData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void buttonDoOrder_Click(object sender, EventArgs e)
|
private void buttonDoOrder_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (dataGridView.SelectedRows.Count == 1)
|
if (dataGridView.SelectedRows.Count == 1)
|
||||||
{
|
{
|
||||||
int id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
|
int id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
|
||||||
_logger.LogInformation("Order №{id}. Change Status on 'In work'", id);
|
_logger.LogInformation("Order №{id}. Change Status on 'In work'", id);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var operationResult = _orderLogic.TakeOrderInWork(new OrderBindingModel { Id = id });
|
var operationResult = _orderLogic.TakeOrderInWork(new OrderBindingModel { Id = id });
|
||||||
if (!operationResult)
|
if (!operationResult)
|
||||||
{
|
{
|
||||||
throw new Exception("Ошибка при сохранении. Дополнительная информация в логах.");
|
throw new Exception("Ошибка при сохранении. Дополнительная информация в логах.");
|
||||||
}
|
}
|
||||||
LoadData();
|
LoadData();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "Change Status on 'In work' error");
|
_logger.LogError(ex, "Change Status on 'In work' error");
|
||||||
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void buttonOrderReady_Click(object sender, EventArgs e)
|
private void buttonOrderReady_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (dataGridView.SelectedRows.Count == 1)
|
if (dataGridView.SelectedRows.Count == 1)
|
||||||
{
|
{
|
||||||
int id =
|
int id =
|
||||||
Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
|
Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
|
||||||
_logger.LogInformation("Order №{id}. Change status on 'Ready'",
|
_logger.LogInformation("Order №{id}. Change status on 'Ready'",
|
||||||
id);
|
id);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var operationResult = _orderLogic.FinishOrder(new
|
var operationResult = _orderLogic.FinishOrder(new
|
||||||
OrderBindingModel
|
OrderBindingModel
|
||||||
{ Id = id });
|
{ Id = id });
|
||||||
if (!operationResult)
|
if (!operationResult)
|
||||||
{
|
{
|
||||||
throw new Exception("Ошибка при сохранении. Дополнительная информация в логах.");
|
throw new Exception("Ошибка при сохранении. Дополнительная информация в логах.");
|
||||||
}
|
}
|
||||||
LoadData();
|
LoadData();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "Change status on 'Ready' error");
|
_logger.LogError(ex, "Change status on 'Ready' error");
|
||||||
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void buttonOrderGive_Click(object sender, EventArgs e)
|
private void buttonOrderGive_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (dataGridView.SelectedRows.Count == 1)
|
if (dataGridView.SelectedRows.Count == 1)
|
||||||
{
|
{
|
||||||
int id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
|
int id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
|
||||||
_logger.LogInformation("Order №{id}. Status change on 'Given'", id);
|
_logger.LogInformation("Order №{id}. Status change on 'Given'", id);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var operationResult = _orderLogic.DeliveryOrder(new OrderBindingModel { Id = id });
|
var operationResult = _orderLogic.DeliveryOrder(new OrderBindingModel { Id = id });
|
||||||
if (!operationResult)
|
if (!operationResult)
|
||||||
{
|
{
|
||||||
throw new Exception("Ошибка при сохранении. Дополнительная информация в логах.");
|
throw new Exception("Ошибка при сохранении. Дополнительная информация в логах.");
|
||||||
}
|
}
|
||||||
_logger.LogInformation("Order №{id} given", id);
|
_logger.LogInformation("Order №{id} given", id);
|
||||||
LoadData();
|
LoadData();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "Change status on 'Give' error");
|
_logger.LogError(ex, "Change status on 'Give' error");
|
||||||
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void buttonOrderUpdate_Click(object sender, EventArgs e)
|
private void buttonOrderUpdate_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
LoadData();
|
LoadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MainForm_Load(object sender, EventArgs e)
|
private void MainForm_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
LoadData();
|
LoadData();
|
||||||
}
|
}
|
||||||
private void ComponentProductsToolStripMenuItemReport_Click(object sender, EventArgs e)
|
private void ComponentProductsToolStripMenuItemReport_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var service = Program.ServiceProvider?.GetService(typeof(ReportDressComponentsForm));
|
var service = Program.ServiceProvider?.GetService(typeof(ReportDressComponentsForm));
|
||||||
if (service is ReportDressComponentsForm form)
|
if (service is ReportDressComponentsForm form)
|
||||||
{
|
{
|
||||||
form.ShowDialog();
|
form.ShowDialog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void OrdersToolStripMenuItemReport_Click(object sender, EventArgs e)
|
private void OrdersToolStripMenuItemReport_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var service = Program.ServiceProvider?.GetService(typeof(ReportOrdersForm));
|
var service = Program.ServiceProvider?.GetService(typeof(ReportOrdersForm));
|
||||||
if (service is ReportOrdersForm form)
|
if (service is ReportOrdersForm form)
|
||||||
{
|
{
|
||||||
form.ShowDialog();
|
form.ShowDialog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DressesToolStripMenuItemReport_Click(object sender, EventArgs e)
|
private void DressesToolStripMenuItemReport_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
using var dialog = new SaveFileDialog { Filter = "docx|*.docx" };
|
using var dialog = new SaveFileDialog { Filter = "docx|*.docx" };
|
||||||
if (dialog.ShowDialog() == DialogResult.OK)
|
if (dialog.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
_reportLogic.SaveComponentsToWordFile(new ReportBindingModel
|
_reportLogic.SaveComponentsToWordFile(new ReportBindingModel
|
||||||
{
|
{
|
||||||
FileName = dialog.FileName
|
FileName = dialog.FileName
|
||||||
});
|
});
|
||||||
MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
private void clientsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var service = Program.ServiceProvider?.GetService(typeof(ClientsForm));
|
||||||
|
if (service is ClientsForm form)
|
||||||
|
{
|
||||||
|
form.ShowDialog();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
293
SewingDresses/SewingDressesView/OrderForm.Designer.cs
generated
293
SewingDresses/SewingDressesView/OrderForm.Designer.cs
generated
@ -1,143 +1,166 @@
|
|||||||
namespace SewingDressesView
|
namespace SewingDressesView
|
||||||
{
|
{
|
||||||
partial class OrderForm
|
partial class OrderForm
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Required designer variable.
|
/// Required designer variable.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private System.ComponentModel.IContainer components = null;
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Clean up any resources being used.
|
/// Clean up any resources being used.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
protected override void Dispose(bool disposing)
|
protected override void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
if (disposing && (components != null))
|
if (disposing && (components != null))
|
||||||
{
|
{
|
||||||
components.Dispose();
|
components.Dispose();
|
||||||
}
|
}
|
||||||
base.Dispose(disposing);
|
base.Dispose(disposing);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Windows Form Designer generated code
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Required method for Designer support - do not modify
|
/// Required method for Designer support - do not modify
|
||||||
/// the contents of this method with the code editor.
|
/// the contents of this method with the code editor.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
label1 = new Label();
|
label1 = new Label();
|
||||||
label2 = new Label();
|
label2 = new Label();
|
||||||
label3 = new Label();
|
label3 = new Label();
|
||||||
comboBoxDress = new ComboBox();
|
comboBoxDress = new ComboBox();
|
||||||
textBoxCount = new TextBox();
|
textBoxCount = new TextBox();
|
||||||
textBoxSum = new TextBox();
|
textBoxSum = new TextBox();
|
||||||
buttonSave = new Button();
|
buttonSave = new Button();
|
||||||
buttonCancel = new Button();
|
buttonCancel = new Button();
|
||||||
SuspendLayout();
|
comboBoxClient = new ComboBox();
|
||||||
//
|
label4 = new Label();
|
||||||
// label1
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
label1.AutoSize = true;
|
// label1
|
||||||
label1.Location = new Point(26, 21);
|
//
|
||||||
label1.Name = "label1";
|
label1.AutoSize = true;
|
||||||
label1.Size = new Size(61, 20);
|
label1.Location = new Point(26, 21);
|
||||||
label1.TabIndex = 0;
|
label1.Name = "label1";
|
||||||
label1.Text = "Платье:";
|
label1.Size = new Size(61, 20);
|
||||||
//
|
label1.TabIndex = 0;
|
||||||
// label2
|
label1.Text = "Платье:";
|
||||||
//
|
//
|
||||||
label2.AutoSize = true;
|
// label2
|
||||||
label2.Location = new Point(26, 65);
|
//
|
||||||
label2.Name = "label2";
|
label2.AutoSize = true;
|
||||||
label2.Size = new Size(93, 20);
|
label2.Location = new Point(26, 95);
|
||||||
label2.TabIndex = 1;
|
label2.Name = "label2";
|
||||||
label2.Text = "Количество:";
|
label2.Size = new Size(93, 20);
|
||||||
//
|
label2.TabIndex = 1;
|
||||||
// label3
|
label2.Text = "Количество:";
|
||||||
//
|
//
|
||||||
label3.AutoSize = true;
|
// label3
|
||||||
label3.Location = new Point(26, 107);
|
//
|
||||||
label3.Name = "label3";
|
label3.AutoSize = true;
|
||||||
label3.Size = new Size(55, 20);
|
label3.Location = new Point(26, 137);
|
||||||
label3.TabIndex = 2;
|
label3.Name = "label3";
|
||||||
label3.Text = "Сумма";
|
label3.Size = new Size(55, 20);
|
||||||
//
|
label3.TabIndex = 2;
|
||||||
// comboBoxDress
|
label3.Text = "Сумма";
|
||||||
//
|
//
|
||||||
comboBoxDress.FormattingEnabled = true;
|
// comboBoxDress
|
||||||
comboBoxDress.Location = new Point(142, 21);
|
//
|
||||||
comboBoxDress.Name = "comboBoxDress";
|
comboBoxDress.FormattingEnabled = true;
|
||||||
comboBoxDress.Size = new Size(288, 28);
|
comboBoxDress.Location = new Point(142, 21);
|
||||||
comboBoxDress.TabIndex = 3;
|
comboBoxDress.Name = "comboBoxDress";
|
||||||
comboBoxDress.SelectedIndexChanged += comboBoxDress_SelectedIndexChanged;
|
comboBoxDress.Size = new Size(288, 28);
|
||||||
//
|
comboBoxDress.TabIndex = 3;
|
||||||
// textBoxCount
|
comboBoxDress.SelectedIndexChanged += comboBoxDress_SelectedIndexChanged;
|
||||||
//
|
//
|
||||||
textBoxCount.Location = new Point(142, 62);
|
// textBoxCount
|
||||||
textBoxCount.Name = "textBoxCount";
|
//
|
||||||
textBoxCount.Size = new Size(288, 27);
|
textBoxCount.Location = new Point(142, 92);
|
||||||
textBoxCount.TabIndex = 4;
|
textBoxCount.Name = "textBoxCount";
|
||||||
textBoxCount.TextChanged += textBoxCount_TextChanged;
|
textBoxCount.Size = new Size(288, 27);
|
||||||
//
|
textBoxCount.TabIndex = 4;
|
||||||
// textBoxSum
|
textBoxCount.TextChanged += textBoxCount_TextChanged;
|
||||||
//
|
//
|
||||||
textBoxSum.Location = new Point(142, 100);
|
// textBoxSum
|
||||||
textBoxSum.Name = "textBoxSum";
|
//
|
||||||
textBoxSum.Size = new Size(288, 27);
|
textBoxSum.Location = new Point(142, 130);
|
||||||
textBoxSum.TabIndex = 5;
|
textBoxSum.Name = "textBoxSum";
|
||||||
//
|
textBoxSum.Size = new Size(288, 27);
|
||||||
// buttonSave
|
textBoxSum.TabIndex = 5;
|
||||||
//
|
//
|
||||||
buttonSave.Location = new Point(222, 145);
|
// buttonSave
|
||||||
buttonSave.Name = "buttonSave";
|
//
|
||||||
buttonSave.Size = new Size(94, 29);
|
buttonSave.Location = new Point(222, 175);
|
||||||
buttonSave.TabIndex = 6;
|
buttonSave.Name = "buttonSave";
|
||||||
buttonSave.Text = "Сохранить";
|
buttonSave.Size = new Size(94, 29);
|
||||||
buttonSave.UseVisualStyleBackColor = true;
|
buttonSave.TabIndex = 6;
|
||||||
buttonSave.Click += buttonSave_Click;
|
buttonSave.Text = "Сохранить";
|
||||||
//
|
buttonSave.UseVisualStyleBackColor = true;
|
||||||
// buttonCancel
|
buttonSave.Click += buttonSave_Click;
|
||||||
//
|
//
|
||||||
buttonCancel.Location = new Point(336, 145);
|
// buttonCancel
|
||||||
buttonCancel.Name = "buttonCancel";
|
//
|
||||||
buttonCancel.Size = new Size(94, 29);
|
buttonCancel.Location = new Point(336, 175);
|
||||||
buttonCancel.TabIndex = 7;
|
buttonCancel.Name = "buttonCancel";
|
||||||
buttonCancel.Text = "Отмена";
|
buttonCancel.Size = new Size(94, 29);
|
||||||
buttonCancel.UseVisualStyleBackColor = true;
|
buttonCancel.TabIndex = 7;
|
||||||
buttonCancel.Click += buttonCancel_Click;
|
buttonCancel.Text = "Отмена";
|
||||||
//
|
buttonCancel.UseVisualStyleBackColor = true;
|
||||||
// OrderForm
|
buttonCancel.Click += buttonCancel_Click;
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
// comboBoxClient
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
//
|
||||||
ClientSize = new Size(484, 198);
|
comboBoxClient.FormattingEnabled = true;
|
||||||
Controls.Add(buttonCancel);
|
comboBoxClient.Location = new Point(142, 58);
|
||||||
Controls.Add(buttonSave);
|
comboBoxClient.Name = "comboBoxClient";
|
||||||
Controls.Add(textBoxSum);
|
comboBoxClient.Size = new Size(288, 28);
|
||||||
Controls.Add(textBoxCount);
|
comboBoxClient.TabIndex = 9;
|
||||||
Controls.Add(comboBoxDress);
|
//
|
||||||
Controls.Add(label3);
|
// label4
|
||||||
Controls.Add(label2);
|
//
|
||||||
Controls.Add(label1);
|
label4.AutoSize = true;
|
||||||
Name = "OrderForm";
|
label4.Location = new Point(26, 58);
|
||||||
Text = "Форма заказа";
|
label4.Name = "label4";
|
||||||
Load += OrderForm_Load;
|
label4.Size = new Size(61, 20);
|
||||||
ResumeLayout(false);
|
label4.TabIndex = 8;
|
||||||
PerformLayout();
|
label4.Text = "Клиент:";
|
||||||
}
|
//
|
||||||
|
// OrderForm
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
ClientSize = new Size(484, 235);
|
||||||
|
Controls.Add(comboBoxClient);
|
||||||
|
Controls.Add(label4);
|
||||||
|
Controls.Add(buttonCancel);
|
||||||
|
Controls.Add(buttonSave);
|
||||||
|
Controls.Add(textBoxSum);
|
||||||
|
Controls.Add(textBoxCount);
|
||||||
|
Controls.Add(comboBoxDress);
|
||||||
|
Controls.Add(label3);
|
||||||
|
Controls.Add(label2);
|
||||||
|
Controls.Add(label1);
|
||||||
|
Name = "OrderForm";
|
||||||
|
Text = "Форма заказа";
|
||||||
|
Load += OrderForm_Load;
|
||||||
|
ResumeLayout(false);
|
||||||
|
PerformLayout();
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private Label label1;
|
private Label label1;
|
||||||
private Label label2;
|
private Label label2;
|
||||||
private Label label3;
|
private Label label3;
|
||||||
private ComboBox comboBoxDress;
|
private ComboBox comboBoxDress;
|
||||||
private TextBox textBoxCount;
|
private TextBox textBoxCount;
|
||||||
private TextBox textBoxSum;
|
private TextBox textBoxSum;
|
||||||
private Button buttonSave;
|
private Button buttonSave;
|
||||||
private Button buttonCancel;
|
private Button buttonCancel;
|
||||||
}
|
private ComboBox comboBoxClient;
|
||||||
|
private Label label4;
|
||||||
|
}
|
||||||
}
|
}
|
@ -6,113 +6,122 @@ using Microsoft.Extensions.Logging;
|
|||||||
|
|
||||||
namespace SewingDressesView
|
namespace SewingDressesView
|
||||||
{
|
{
|
||||||
public partial class OrderForm : Form
|
public partial class OrderForm : Form
|
||||||
{
|
{
|
||||||
private readonly ILogger _logger;
|
private readonly ILogger _logger;
|
||||||
private readonly IDressLogic _logicD;
|
private readonly IDressLogic _logicD;
|
||||||
private readonly IOrderLogic _logicO;
|
private readonly IOrderLogic _logicO;
|
||||||
|
private readonly IClientLogic _logicC;
|
||||||
|
|
||||||
public OrderForm(ILogger<OrderForm> logger, IDressLogic logicD, IOrderLogic logicO)
|
public OrderForm(ILogger<OrderForm> logger, IDressLogic logicD, IOrderLogic logicO, IClientLogic logicC)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_logicD = logicD;
|
_logicD = logicD;
|
||||||
_logicO = logicO;
|
_logicO = logicO;
|
||||||
}
|
_logicC = logicC;
|
||||||
|
}
|
||||||
|
|
||||||
private void buttonCancel_Click(object sender, EventArgs e)
|
private void buttonCancel_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
DialogResult = DialogResult.Cancel;
|
DialogResult = DialogResult.Cancel;
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void buttonSave_Click(object sender, EventArgs e)
|
private void buttonSave_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(textBoxCount.Text))
|
if (string.IsNullOrEmpty(textBoxCount.Text))
|
||||||
{
|
{
|
||||||
MessageBox.Show("Заполните поле Количество", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
MessageBox.Show("Заполните поле Количество", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (comboBoxDress.SelectedValue == null)
|
if (comboBoxDress.SelectedValue == null)
|
||||||
{
|
{
|
||||||
MessageBox.Show("Выберите изделие", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
MessageBox.Show("Выберите изделие", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_logger.LogInformation("Создание заказа");
|
_logger.LogInformation("Создание заказа");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var operationResult = _logicO.CreateOrder(new OrderBindingModel
|
var operationResult = _logicO.CreateOrder(new OrderBindingModel
|
||||||
{
|
{
|
||||||
DressId = Convert.ToInt32(comboBoxDress.SelectedValue),
|
DressId = Convert.ToInt32(comboBoxDress.SelectedValue),
|
||||||
Count = Convert.ToInt32(textBoxCount.Text),
|
Count = Convert.ToInt32(textBoxCount.Text),
|
||||||
Sum = Convert.ToDouble(textBoxSum.Text)
|
Sum = Convert.ToDouble(textBoxSum.Text)
|
||||||
});
|
});
|
||||||
if (!operationResult)
|
if (!operationResult)
|
||||||
{
|
{
|
||||||
throw new Exception("Ошибка при создании заказа. Дополнительная информация в логах.");
|
throw new Exception("Ошибка при создании заказа. Дополнительная информация в логах.");
|
||||||
}
|
}
|
||||||
MessageBox.Show("Сохранение прошло успешно", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
MessageBox.Show("Сохранение прошло успешно", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
DialogResult = DialogResult.OK;
|
DialogResult = DialogResult.OK;
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "Create order error");
|
_logger.LogError(ex, "Create order error");
|
||||||
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void CalcSum()
|
private void CalcSum()
|
||||||
{
|
{
|
||||||
if (comboBoxDress.SelectedValue != null && !string.IsNullOrEmpty(textBoxCount.Text))
|
if (comboBoxDress.SelectedValue != null && !string.IsNullOrEmpty(textBoxCount.Text))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
int id = Convert.ToInt32(comboBoxDress.SelectedValue);
|
int id = Convert.ToInt32(comboBoxDress.SelectedValue);
|
||||||
var dress = _logicD.ReadElement(new DressSearchModel
|
var dress = _logicD.ReadElement(new DressSearchModel
|
||||||
{
|
{
|
||||||
Id = id
|
Id = id
|
||||||
});
|
});
|
||||||
int count = Convert.ToInt32(textBoxCount.Text);
|
int count = Convert.ToInt32(textBoxCount.Text);
|
||||||
textBoxSum.Text = Math.Round(count * dress?.Price ?? 0, 2).ToString();
|
textBoxSum.Text = Math.Round(count * dress?.Price ?? 0, 2).ToString();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "Calculate sum order error");
|
_logger.LogError(ex, "Calculate sum order error");
|
||||||
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void comboBoxDress_SelectedIndexChanged(object sender, EventArgs e)
|
private void comboBoxDress_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
CalcSum();
|
CalcSum();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void textBoxCount_TextChanged(object sender, EventArgs e)
|
private void textBoxCount_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
CalcSum();
|
CalcSum();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OrderForm_Load(object sender, EventArgs e)
|
private void OrderForm_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var list = _logicD.ReadList(null);
|
var listD = _logicD.ReadList(null);
|
||||||
if (list != null)
|
if (listD != null)
|
||||||
{
|
{
|
||||||
comboBoxDress.DisplayMember = "DressName";
|
comboBoxDress.DisplayMember = "DressName";
|
||||||
comboBoxDress.ValueMember = "Id";
|
comboBoxDress.ValueMember = "Id";
|
||||||
comboBoxDress.DataSource = list;
|
comboBoxDress.DataSource = listD;
|
||||||
comboBoxDress.SelectedItem = null;
|
comboBoxDress.SelectedItem = null;
|
||||||
_logger.LogInformation("Load dress for order");
|
_logger.LogInformation("Load dress for order");
|
||||||
}
|
}
|
||||||
}
|
var listC = _logicC.ReadList(null);
|
||||||
catch (Exception ex)
|
if (listC != null )
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "Load dress for order error");
|
comboBoxClient.DisplayMember = "ClientName";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
catch (Exception ex)
|
||||||
}
|
{
|
||||||
|
_logger.LogError(ex, "Load dress for order error");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,10 +34,12 @@ namespace SewingDressesView
|
|||||||
services.AddTransient<IComponentStorage, ComponentStorage>();
|
services.AddTransient<IComponentStorage, ComponentStorage>();
|
||||||
services.AddTransient<IOrderStorage, OrderStorage>();
|
services.AddTransient<IOrderStorage, OrderStorage>();
|
||||||
services.AddTransient<IDressStorage, DressStorage>();
|
services.AddTransient<IDressStorage, DressStorage>();
|
||||||
|
services.AddTransient<IClientStorage, ClientStorage>();
|
||||||
services.AddTransient<IComponentLogic, ComponentLogic>();
|
services.AddTransient<IComponentLogic, ComponentLogic>();
|
||||||
services.AddTransient<IOrderLogic, OrderLogic>();
|
services.AddTransient<IOrderLogic, OrderLogic>();
|
||||||
services.AddTransient<IDressLogic, DressLogic>();
|
services.AddTransient<IDressLogic, DressLogic>();
|
||||||
services.AddTransient<IReportLogic, ReportLogic>();
|
services.AddTransient<IReportLogic, ReportLogic>();
|
||||||
|
services.AddTransient<IClientLogic, ClientLogic>();
|
||||||
services.AddTransient<AbstractSaveToExcel, SaveToExcel>();
|
services.AddTransient<AbstractSaveToExcel, SaveToExcel>();
|
||||||
services.AddTransient<AbstractSaveToPdf, SaveToPdf>();
|
services.AddTransient<AbstractSaveToPdf, SaveToPdf>();
|
||||||
services.AddTransient<AbstractSaveToWord, SaveToWord>();
|
services.AddTransient<AbstractSaveToWord, SaveToWord>();
|
||||||
@ -47,6 +49,7 @@ namespace SewingDressesView
|
|||||||
services.AddTransient<OrderForm>();
|
services.AddTransient<OrderForm>();
|
||||||
services.AddTransient<DressForm>();
|
services.AddTransient<DressForm>();
|
||||||
services.AddTransient<DressComponentForm>();
|
services.AddTransient<DressComponentForm>();
|
||||||
|
services.AddTransient<ClientsForm>();
|
||||||
services.AddTransient<DressesForm>();
|
services.AddTransient<DressesForm>();
|
||||||
services.AddTransient<ReportDressComponentsForm>();
|
services.AddTransient<ReportDressComponentsForm>();
|
||||||
services.AddTransient<ReportOrdersForm>();
|
services.AddTransient<ReportOrdersForm>();
|
||||||
|
Loading…
Reference in New Issue
Block a user