готово всё

This commit is contained in:
dex_moth 2024-06-19 13:54:56 +04:00
parent 66238fe6f2
commit 48cbed7bab
14 changed files with 32 additions and 31 deletions

View File

@ -64,8 +64,7 @@ namespace FishFactory.Forms
{
if (MessageBox.Show("Удалить запись?", "Вопрос", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
int id =
Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
int id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
_logger.LogInformation("Удаление компонента");
try
{

View File

@ -38,15 +38,12 @@ namespace FishFactory.Forms
private void buttonAdd_Click(object sender, EventArgs e)
{
var service = Program.ServiceProvider?.GetService(typeof(FormImplementer));
if (service is FormImplementer form)
{
var form = DependencyManager.Instance.Resolve<FormImplementer>();
if (form.ShowDialog() == DialogResult.OK)
{
LoadData();
}
}
}
private void buttonUpd_Click(object sender, EventArgs e)
{

View File

@ -39,6 +39,7 @@ namespace FishFactory.Forms
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка загрузки заказов");
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void компонентыToolStripMenuItem_Click(object sender, EventArgs e)

View File

@ -1,8 +1,6 @@
using FishFactory.Forms;
using FishFactoryContracts.BusinessLogicsContracts;
using FishFactoryBusinessLogic.BusinessLogic;
using FishFactoryContracts.StoragesContracts;
using FishFactoryDatabaseImplement.Implements;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using NLog.Extensions.Logging;

View File

@ -9,7 +9,7 @@ namespace FishFactoryContracts.ViewModels
public int Id { get; set; }
[Column(title: "Название компонента", gridViewAutoSize: GridViewAutoSize.Fill, isUseAutoSize: true)]
public string ComponentName { get; set; } = string.Empty;
[Column(title: "Цена", width: 150)]
[Column(title: "Цена", width: 130)]
public double Cost { get; set; }
}
}

View File

@ -1,12 +1,12 @@
using FishFactoryContracts.Attributes;
using FishFactoryDataModel.Enums;
using System.ComponentModel;
using FishFactoryDataModel.Models;
namespace FishFactoryContracts.ViewModels
{
public class OrderViewModel
public class OrderViewModel : IOrderModel
{
[DisplayName("Номер")]
[Column(title: "Номер", width: 30)]
public int Id { get; set; }
[Column(visible: false)]

View File

@ -22,7 +22,7 @@
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="copy /Y &quot;$(TargetDir)*.dll&quot; &quot;$(SolutionDir)\..\ImplementationExtensions\*.dll&quot;" />
<Exec Command="copy /Y &quot;$(TargetDir)*.dll&quot; &quot;$(SolutionDir)\ImplementationExtensions\*.dll&quot;" />
</Target>
</Project>

View File

@ -3,7 +3,7 @@ using FishFactoryContracts.StoragesContracts;
namespace FishFactoryDatabaseImplement.Implements
{
public class ImplementationExtension
public class ImplementationExtension : IImplementationExtension
{
public int Priority => 2;

View File

@ -1,14 +1,20 @@
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
namespace FishFactoryDatabaseImplement.Models
{
[DataContract]
public class CannedComponent
{
[DataMember]
public int Id { get; set; }
[DataMember]
[Required]
public int CannedId { get; set; }
[DataMember]
[Required]
public int ComponentId { get; set; }
[DataMember]
[Required]
public int Count { get; set; }
public virtual Component Component { get; set; } = new();

View File

@ -12,7 +12,7 @@
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="copy /Y &quot;$(TargetDir)*.dll&quot; &quot;$(SolutionDir)\..\ImplementationExtensions\*.dll&quot;" />
<Exec Command="copy /Y &quot;$(TargetDir)*.dll&quot; &quot;$(SolutionDir)\ImplementationExtensions\*.dll&quot;" />
</Target>
</Project>

View File

@ -5,7 +5,7 @@ namespace FishFactoryFileImplement.Implements
{
public class ImplementationExtension : IImplementationExtension
{
public int Priority => 1;
public int Priority => 0;
public void RegisterServices()
{

View File

@ -13,6 +13,6 @@
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="copy /Y &quot;$(TargetDir)*.dll&quot; &quot;$(SolutionDir)\..\ImplementationExtensions\*.dll&quot;" />
<Exec Command="copy /Y &quot;$(TargetDir)*.dll&quot; &quot;$(SolutionDir)\ImplementationExtensions\*.dll&quot;" />
</Target>
</Project>

View File

@ -12,7 +12,7 @@
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "http://localhost:5284",
"environmentVariables": {
@ -22,7 +22,7 @@
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:7012;http://localhost:5284",
"environmentVariables": {