Сделана 2 лаба

This commit is contained in:
ArtemEmelyanov 2023-05-03 21:15:06 +04:00
parent d8d2daf4ab
commit ebe66e3421
10 changed files with 367 additions and 101 deletions

View File

@ -37,9 +37,10 @@
this.изделияToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.компонентыToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.консервыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.магазиныStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.ButtonAddInShop = new System.Windows.Forms.Button();
this.магазиныStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ButtonSell = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
@ -66,7 +67,7 @@
//
// ButtonTakeOrderInWork
//
this.ButtonTakeOrderInWork.Location = new System.Drawing.Point(786, 83);
this.ButtonTakeOrderInWork.Location = new System.Drawing.Point(786, 61);
this.ButtonTakeOrderInWork.Name = "ButtonTakeOrderInWork";
this.ButtonTakeOrderInWork.Size = new System.Drawing.Size(186, 23);
this.ButtonTakeOrderInWork.TabIndex = 2;
@ -76,7 +77,7 @@
//
// ButtonOrderReady
//
this.ButtonOrderReady.Location = new System.Drawing.Point(786, 137);
this.ButtonOrderReady.Location = new System.Drawing.Point(786, 90);
this.ButtonOrderReady.Name = "ButtonOrderReady";
this.ButtonOrderReady.Size = new System.Drawing.Size(186, 23);
this.ButtonOrderReady.TabIndex = 3;
@ -86,7 +87,7 @@
//
// ButtonIssuedOrder
//
this.ButtonIssuedOrder.Location = new System.Drawing.Point(786, 194);
this.ButtonIssuedOrder.Location = new System.Drawing.Point(786, 119);
this.ButtonIssuedOrder.Name = "ButtonIssuedOrder";
this.ButtonIssuedOrder.Size = new System.Drawing.Size(186, 23);
this.ButtonIssuedOrder.TabIndex = 4;
@ -96,7 +97,7 @@
//
// ButtonRef
//
this.ButtonRef.Location = new System.Drawing.Point(786, 250);
this.ButtonRef.Location = new System.Drawing.Point(786, 148);
this.ButtonRef.Name = "ButtonRef";
this.ButtonRef.Size = new System.Drawing.Size(186, 23);
this.ButtonRef.TabIndex = 5;
@ -117,17 +118,24 @@
// компонентыToolStripMenuItem1
//
this.компонентыToolStripMenuItem1.Name = омпонентыToolStripMenuItem1";
this.компонентыToolStripMenuItem1.Size = new System.Drawing.Size(180, 22);
this.компонентыToolStripMenuItem1.Size = new System.Drawing.Size(145, 22);
this.компонентыToolStripMenuItem1.Text = "Компоненты";
this.компонентыToolStripMenuItem1.Click += new System.EventHandler(this.КомпонентыToolStripMenuItem_Click);
//
// консервыToolStripMenuItem
//
this.консервыToolStripMenuItem.Name = онсервыToolStripMenuItem";
this.консервыToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.консервыToolStripMenuItem.Size = new System.Drawing.Size(145, 22);
this.консервыToolStripMenuItem.Text = "Консервы";
this.консервыToolStripMenuItem.Click += new System.EventHandler(this.КонсервыToolStripMenuItem_Click);
//
// магазиныStripMenuItem
//
this.магазиныStripMenuItem.Name = агазиныStripMenuItem";
this.магазиныStripMenuItem.Size = new System.Drawing.Size(145, 22);
this.магазиныStripMenuItem.Text = "Магазины";
this.магазиныStripMenuItem.Click += new System.EventHandler(this.магазиныStripMenuItem_Click);
//
// menuStrip1
//
this.menuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
@ -142,7 +150,7 @@
//
// ButtonAddInShop
//
this.ButtonAddInShop.Location = new System.Drawing.Point(786, 289);
this.ButtonAddInShop.Location = new System.Drawing.Point(786, 178);
this.ButtonAddInShop.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.ButtonAddInShop.Name = "ButtonAddInShop";
this.ButtonAddInShop.Size = new System.Drawing.Size(186, 25);
@ -151,18 +159,22 @@
this.ButtonAddInShop.UseVisualStyleBackColor = true;
this.ButtonAddInShop.Click += new System.EventHandler(this.ButtonAddInShop_Click);
//
// магазиныStripMenuItem
// ButtonSell
//
this.магазиныStripMenuItem.Name = агазиныStripMenuItem";
this.магазиныStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.магазиныStripMenuItem.Text = "Магазины";
this.магазиныStripMenuItem.Click += new System.EventHandler(this.магазиныStripMenuItem_Click);
this.ButtonSell.Location = new System.Drawing.Point(786, 210);
this.ButtonSell.Name = "ButtonSell";
this.ButtonSell.Size = new System.Drawing.Size(186, 23);
this.ButtonSell.TabIndex = 8;
this.ButtonSell.Text = "Продать";
this.ButtonSell.UseVisualStyleBackColor = true;
this.ButtonSell.Click += new System.EventHandler(this.ButtonSell_Click);
//
// FormMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(978, 446);
this.Controls.Add(this.ButtonSell);
this.Controls.Add(this.ButtonRef);
this.Controls.Add(this.ButtonAddInShop);
this.Controls.Add(this.ButtonIssuedOrder);
@ -196,5 +208,6 @@
private ToolStripMenuItem магазиныToolStripMenuItem;
private Button ButtonAddInShop;
private ToolStripMenuItem магазиныStripMenuItem;
private Button ButtonSell;
}
}

View File

@ -194,5 +194,15 @@ namespace FishFactoryView
form.ShowDialog();
}
}
private void ButtonSell_Click(object sender, EventArgs e)
{
var service = Program.ServiceProvider?.GetService(typeof(FormSellCanneds));
if (service is FormSellCanneds form)
{
form.ShowDialog();
LoadData();
}
}
}
}

View File

@ -0,0 +1,126 @@
namespace FishFactoryView
{
partial class FormSellCanneds
{
/// <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()
{
this.labelCanneds = new System.Windows.Forms.Label();
this.labelCount = new System.Windows.Forms.Label();
this.comboBoxCanneds = new System.Windows.Forms.ComboBox();
this.textBoxCount = new System.Windows.Forms.TextBox();
this.buttonSave = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// labelCanneds
//
this.labelCanneds.AutoSize = true;
this.labelCanneds.Location = new System.Drawing.Point(11, 19);
this.labelCanneds.Name = "labelCanneds";
this.labelCanneds.Size = new System.Drawing.Size(62, 15);
this.labelCanneds.TabIndex = 0;
this.labelCanneds.Text = "Консервы";
//
// labelCount
//
this.labelCount.AutoSize = true;
this.labelCount.Location = new System.Drawing.Point(12, 56);
this.labelCount.Name = "labelCount";
this.labelCount.Size = new System.Drawing.Size(72, 15);
this.labelCount.TabIndex = 1;
this.labelCount.Text = "Количество";
//
// comboBoxCanneds
//
this.comboBoxCanneds.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxCanneds.FormattingEnabled = true;
this.comboBoxCanneds.Location = new System.Drawing.Point(100, 11);
this.comboBoxCanneds.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.comboBoxCanneds.Name = "comboBoxCanneds";
this.comboBoxCanneds.Size = new System.Drawing.Size(230, 23);
this.comboBoxCanneds.TabIndex = 3;
//
// textBoxCount
//
this.textBoxCount.Location = new System.Drawing.Point(100, 48);
this.textBoxCount.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.textBoxCount.Name = "textBoxCount";
this.textBoxCount.Size = new System.Drawing.Size(230, 23);
this.textBoxCount.TabIndex = 4;
//
// buttonSave
//
this.buttonSave.Location = new System.Drawing.Point(160, 78);
this.buttonSave.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.buttonSave.Name = "buttonSave";
this.buttonSave.Size = new System.Drawing.Size(82, 22);
this.buttonSave.TabIndex = 6;
this.buttonSave.Text = "Сохранить";
this.buttonSave.UseVisualStyleBackColor = true;
this.buttonSave.Click += new System.EventHandler(this.buttonSave_Click);
//
// buttonCancel
//
this.buttonCancel.Location = new System.Drawing.Point(248, 78);
this.buttonCancel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(82, 22);
this.buttonCancel.TabIndex = 7;
this.buttonCancel.Text = "Отмена";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
//
// FormSellCanneds
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(335, 106);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonSave);
this.Controls.Add(this.textBoxCount);
this.Controls.Add(this.comboBoxCanneds);
this.Controls.Add(this.labelCount);
this.Controls.Add(this.labelCanneds);
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.Name = "FormSellCanneds";
this.Text = "Продажа консерв";
this.Load += new System.EventHandler(this.FormSellCanneds_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private Label labelCanneds;
private Label labelCount;
private ComboBox comboBoxCanneds;
private TextBox textBoxCount;
private Button buttonSave;
private Button buttonCancel;
}
}

View File

@ -0,0 +1,90 @@
using FishFactoryContracts.BusinessLogicsContracts;
using FishFactoryContracts.SearchModels;
using Microsoft.Extensions.Logging;
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 FishFactoryView
{
public partial class FormSellCanneds : Form
{
private readonly ILogger _logger;
private readonly ICannedLogic _logicCanned;
private readonly IShopLogic _logicShop;
public FormSellCanneds(ILogger<FormSellCanneds> logger, ICannedLogic logicCanned, IShopLogic logicShop)
{
InitializeComponent();
_logger = logger;
_logicCanned = logicCanned;
_logicShop = logicShop;
}
private void buttonSave_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(textBoxCount.Text))
{
MessageBox.Show("Заполните поле 'Количество'", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
if (comboBoxCanneds.SelectedValue == null)
{
MessageBox.Show("Выберите консерву", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
_logger.LogInformation("Продажа консерв");
try
{
var operationResult = _logicShop.SellCanneds(_logicCanned.ReadElement(new CannedSearchModel()
{
Id = Convert.ToInt32(comboBoxCanneds.SelectedValue)
})!, Convert.ToInt32(textBoxCount.Text));
if (!operationResult)
{
throw new Exception("Ошибка при продаже консерв. Дополнительная информация в логах.");
}
MessageBox.Show("Сохранение прошло успешно", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
DialogResult = DialogResult.OK;
Close();
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка продажи консерв");
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void buttonCancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
}
private void FormSellCanneds_Load(object sender, EventArgs e)
{
_logger.LogInformation("Загрузка списка консерв для продажи");
try
{
var list = _logicCanned.ReadList(null);
if (list != null)
{
comboBoxCanneds.DisplayMember = "CannedName";
comboBoxCanneds.ValueMember = "Id";
comboBoxCanneds.DataSource = list;
comboBoxCanneds.SelectedItem = null;
}
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка загрузки списка консерв");
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}

View File

@ -0,0 +1,60 @@
<root>
<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>

View File

@ -28,13 +28,16 @@
this.labelTime = new System.Windows.Forms.Label();
this.labelAddress = new System.Windows.Forms.Label();
this.dataGridView = new System.Windows.Forms.DataGridView();
this.labelShop = new System.Windows.Forms.Label();
this.textBoxShop = new System.Windows.Forms.TextBox();
this.dateTimePicker = new System.Windows.Forms.DateTimePicker();
this.ColumnID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ColumnCannedName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ColumnCount = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.labelShop = new System.Windows.Forms.Label();
this.textBoxShop = new System.Windows.Forms.TextBox();
this.dateTimePicker = new System.Windows.Forms.DateTimePicker();
this.numericUpDownCount = new System.Windows.Forms.NumericUpDown();
this.label1 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownCount)).BeginInit();
this.SuspendLayout();
//
// buttonSave
@ -63,13 +66,13 @@
//
this.textBoxAddress.Location = new System.Drawing.Point(159, 27);
this.textBoxAddress.Name = "textBoxAddress";
this.textBoxAddress.Size = new System.Drawing.Size(221, 23);
this.textBoxAddress.Size = new System.Drawing.Size(157, 23);
this.textBoxAddress.TabIndex = 14;
//
// labelTime
//
this.labelTime.AutoSize = true;
this.labelTime.Location = new System.Drawing.Point(386, 9);
this.labelTime.Location = new System.Drawing.Point(322, 9);
this.labelTime.Name = "labelTime";
this.labelTime.Size = new System.Drawing.Size(87, 15);
this.labelTime.TabIndex = 13;
@ -86,8 +89,8 @@
//
// dataGridView
//
this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
@ -100,6 +103,23 @@
this.dataGridView.Size = new System.Drawing.Size(581, 240);
this.dataGridView.TabIndex = 11;
//
// ColumnID
//
this.ColumnID.HeaderText = "ID";
this.ColumnID.Name = "ColumnID";
this.ColumnID.Visible = false;
//
// ColumnCannedName
//
this.ColumnCannedName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.ColumnCannedName.HeaderText = "Консервы";
this.ColumnCannedName.Name = "ColumnCannedName";
//
// ColumnCount
//
this.ColumnCount.HeaderText = "Количество";
this.ColumnCount.Name = "ColumnCount";
//
// labelShop
//
this.labelShop.AutoSize = true;
@ -118,33 +138,34 @@
//
// dateTimePicker
//
this.dateTimePicker.Location = new System.Drawing.Point(386, 27);
this.dateTimePicker.Location = new System.Drawing.Point(322, 27);
this.dateTimePicker.Name = "dateTimePicker";
this.dateTimePicker.Size = new System.Drawing.Size(207, 23);
this.dateTimePicker.Size = new System.Drawing.Size(162, 23);
this.dateTimePicker.TabIndex = 19;
//
// ColumnID
// numericUpDownCount
//
this.ColumnID.HeaderText = "ID";
this.ColumnID.Name = "ColumnID";
this.ColumnID.Visible = false;
this.numericUpDownCount.Location = new System.Drawing.Point(490, 27);
this.numericUpDownCount.Name = "numericUpDownCount";
this.numericUpDownCount.Size = new System.Drawing.Size(103, 23);
this.numericUpDownCount.TabIndex = 20;
//
// ColumnSushiName
// label1
//
this.ColumnCannedName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.ColumnCannedName.HeaderText = "Консервы";
this.ColumnCannedName.Name = "ColumnCannedName";
//
// ColumnCount
//
this.ColumnCount.HeaderText = "Количество";
this.ColumnCount.Name = "ColumnCount";
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(490, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(75, 15);
this.label1.TabIndex = 21;
this.label1.Text = "Вместимось";
//
// FormShop
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(605, 337);
this.Controls.Add(this.label1);
this.Controls.Add(this.numericUpDownCount);
this.Controls.Add(this.dateTimePicker);
this.Controls.Add(this.textBoxShop);
this.Controls.Add(this.buttonSave);
@ -159,6 +180,7 @@
this.Load += new System.EventHandler(this.FormShop_Load);
this.Click += new System.EventHandler(this.FormShop_Load);
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownCount)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@ -177,5 +199,7 @@
private DataGridViewTextBoxColumn ColumnID;
private DataGridViewTextBoxColumn ColumnCannedName;
private DataGridViewTextBoxColumn ColumnCount;
private NumericUpDown numericUpDownCount;
private Label label1;
}
}

View File

@ -47,6 +47,7 @@ namespace FishFactoryView
textBoxShop.Text = view.ShopName;
textBoxAddress.Text = view.Address;
dateTimePicker.Text = view.DateOpening.ToString();
numericUpDownCount.Value = view.MaxCountCanneds;
_shopListCanneds = view.ListCanneds ?? new Dictionary<int, (ICannedModel, int)>();
LoadData();
}
@ -102,6 +103,7 @@ namespace FishFactoryView
Address = textBoxAddress.Text,
DateOpening = dateTimePicker.Value.Date,
ListCanneds = _shopListCanneds,
MaxCountCanneds = (int)numericUpDownCount.Value
};
var operationResult = _id.HasValue ? _logic.Update(model) : _logic.Create(model);
if (!operationResult)

View File

@ -1,64 +1,4 @@
<?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.
-->
<root>
<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">

View File

@ -54,6 +54,7 @@ namespace ProjectFishFactory
services.AddTransient<FormShop>();
services.AddTransient<FormShops>();
services.AddTransient<FormShopCanned>();
services.AddTransient<FormSellCanneds>();
}
}
}

View File

@ -162,6 +162,11 @@ namespace FishFactoryBusinessLogic
}
public bool SellCanneds(ICannedModel model, int count)
{
return _shopStorage.SellCanneds(model, count);
}
public bool AddCanneds(ICannedModel model, int count)
{
if (model == null)
{
@ -207,10 +212,5 @@ namespace FishFactoryBusinessLogic
}
return false;
}
public bool AddCanneds(ICannedModel model, int count)
{
return _shopStorage.SellCanneds(model, count);
}
}
}