diff --git a/GasStation/Entities/Enums/Gasmen.cs b/GasStation/Entities/Enums/Gasmen.cs new file mode 100644 index 0000000..8cb05d9 --- /dev/null +++ b/GasStation/Entities/Enums/Gasmen.cs @@ -0,0 +1,13 @@ +namespace GasStation.Entities.Enums; + +[Flags] +public enum Gasmen +{ + None = 0, + + Gasman1 = 1, + + Gasman2 = 2, + + Gasman3 = 4 +} diff --git a/GasStation/Entities/Gasman.cs b/GasStation/Entities/Gasman.cs new file mode 100644 index 0000000..5d4f49e --- /dev/null +++ b/GasStation/Entities/Gasman.cs @@ -0,0 +1,20 @@ +namespace GasStation.Entities; + +public class Gasman +{ + public int Id { get; private set; } + + public string GasmanName { get; private set; } = string.Empty; + + public string PhoneNumber { get; private set; } = string.Empty; + + public static Gasman CreateGasman(int id, string gasmanName, string phoneNumber) + { + return new Gasman + { + Id = id, + GasmanName = gasmanName, + PhoneNumber = phoneNumber + }; + } +} diff --git a/GasStation/Entities/Product.cs b/GasStation/Entities/Product.cs new file mode 100644 index 0000000..6c3790d --- /dev/null +++ b/GasStation/Entities/Product.cs @@ -0,0 +1,19 @@ +using GasStation.Entities.Enums; + +namespace GasStation.Entities; + +public class Product +{ + public int Id { get; private set; } + + public Gasmen Gasman { get; private set; } + + public static Product CreateProduct(int id, Gasmen gasman) + { + return new Product + { + Id = id, + Gasman = gasman + }; + } +} diff --git a/GasStation/Entities/Selling.cs b/GasStation/Entities/Selling.cs new file mode 100644 index 0000000..08c15ea --- /dev/null +++ b/GasStation/Entities/Selling.cs @@ -0,0 +1,26 @@ +namespace GasStation.Entities; + +public class Selling +{ + public int Id { get; private set; } + + public int GasmanId { get; private set; } + + public int ProductID { get; private set; } + + public int Count { get; private set; } + + public DateTime SellingDateTime { get; private set; } + + public static Selling CreateSelling(int id, int gasmanId, int productID, int count) + { + return new Selling + { + Id = id, + GasmanId = gasmanId, + ProductID = productID, + Count = count, + SellingDateTime = DateTime.Now + }; + } +} diff --git a/GasStation/Entities/Supplier.cs b/GasStation/Entities/Supplier.cs new file mode 100644 index 0000000..5e4916f --- /dev/null +++ b/GasStation/Entities/Supplier.cs @@ -0,0 +1,17 @@ +namespace GasStation.Entities; + +public class Supplier +{ + public int Id { get; private set; } + + public string ProductName { get; private set; } = string.Empty; + + public static Supplier CreateSupplier(int id, string productName) + { + return new Supplier + { + Id = id, + ProductName = productName + }; + } +} diff --git a/GasStation/Entities/Supply.cs b/GasStation/Entities/Supply.cs new file mode 100644 index 0000000..054171e --- /dev/null +++ b/GasStation/Entities/Supply.cs @@ -0,0 +1,26 @@ +namespace GasStation.Entities; + +public class Supply +{ + public int Id { get; private set; } + + public int SupplierID { get; private set; } + + public int ProductID { get; private set; } + + public DateTime SupplyDate { get; private set; } + + public IEnumerable SupplySupplies { get; private set; } = []; + + public static Supply CreateSupply(int id, int supplierID, int productID, IEnumerable supplySupplies) + { + return new Supply + { + Id = id, + SupplierID = supplierID, + ProductID = productID, + SupplyDate = DateTime.Now, + SupplySupplies = supplySupplies + }; + } +} diff --git a/GasStation/Entities/SupplySupply.cs b/GasStation/Entities/SupplySupply.cs new file mode 100644 index 0000000..d4744dd --- /dev/null +++ b/GasStation/Entities/SupplySupply.cs @@ -0,0 +1,17 @@ +namespace GasStation.Entities; + +public class SupplySupply +{ + public int Id { get; private set; } + + public int Count { get; private set; } + + public static SupplySupply CreateSupply(int id, int count) + { + return new SupplySupply + { + Id = id, + Count = count + }; + } +} diff --git a/GasStation/Form1.Designer.cs b/GasStation/Form1.Designer.cs deleted file mode 100644 index 9e56e38..0000000 --- a/GasStation/Form1.Designer.cs +++ /dev/null @@ -1,39 +0,0 @@ -namespace GasStation -{ - partial class Form1 - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); - this.Text = "Form1"; - } - - #endregion - } -} diff --git a/GasStation/Form1.cs b/GasStation/Form1.cs deleted file mode 100644 index d037ead..0000000 --- a/GasStation/Form1.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace GasStation -{ - public partial class Form1 : Form - { - public Form1() - { - InitializeComponent(); - } - } -} diff --git a/GasStation/FormGasstation.Designer.cs b/GasStation/FormGasstation.Designer.cs new file mode 100644 index 0000000..fd0deb6 --- /dev/null +++ b/GasStation/FormGasstation.Designer.cs @@ -0,0 +1,132 @@ +namespace GasStation +{ + partial class FormGasStation + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + 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(); + menuStrip1.SuspendLayout(); + SuspendLayout(); + // + // menuStrip1 + // + menuStrip1.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem, операцииToolStripMenuItem, отчётыToolStripMenuItem }); + menuStrip1.Location = new Point(0, 0); + menuStrip1.Name = "menuStrip1"; + menuStrip1.Size = new Size(800, 24); + menuStrip1.TabIndex = 0; + menuStrip1.Text = "menuStrip1"; + // + // справочникиToolStripMenuItem + // + справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { заправщикToolStripMenuItem, поставщикToolStripMenuItem, товарToolStripMenuItem }); + справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem"; + справочникиToolStripMenuItem.Size = new Size(94, 20); + справочникиToolStripMenuItem.Text = "Справочники"; + // + // операцииToolStripMenuItem + // + операцииToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { поставкаToolStripMenuItem, продажаToolStripMenuItem }); + операцииToolStripMenuItem.Name = "операцииToolStripMenuItem"; + операцииToolStripMenuItem.Size = new Size(75, 20); + операцииToolStripMenuItem.Text = "Операции"; + // + // отчётыToolStripMenuItem + // + отчётыToolStripMenuItem.Name = "отчётыToolStripMenuItem"; + отчётыToolStripMenuItem.Size = new Size(60, 20); + отчётыToolStripMenuItem.Text = "Отчёты"; + // + // заправщикToolStripMenuItem + // + заправщикToolStripMenuItem.Name = "заправщикToolStripMenuItem"; + заправщикToolStripMenuItem.Size = new Size(180, 22); + заправщикToolStripMenuItem.Text = "Заправщик"; + // + // поставщикToolStripMenuItem + // + поставщикToolStripMenuItem.Name = "поставщикToolStripMenuItem"; + поставщикToolStripMenuItem.Size = new Size(180, 22); + поставщикToolStripMenuItem.Text = "Поставщик"; + // + // товарToolStripMenuItem + // + товарToolStripMenuItem.Name = "товарToolStripMenuItem"; + товарToolStripMenuItem.Size = new Size(180, 22); + товарToolStripMenuItem.Text = "Товар"; + // + // поставкаToolStripMenuItem + // + поставкаToolStripMenuItem.Name = "поставкаToolStripMenuItem"; + поставкаToolStripMenuItem.Size = new Size(180, 22); + поставкаToolStripMenuItem.Text = "Поставка"; + // + // продажаToolStripMenuItem + // + продажаToolStripMenuItem.Name = "продажаToolStripMenuItem"; + продажаToolStripMenuItem.Size = new Size(180, 22); + продажаToolStripMenuItem.Text = "Продажа"; + // + // FormGasStation + // + AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleMode = AutoScaleMode.Font; + BackgroundImage = Properties.Resources.заправка; + BackgroundImageLayout = ImageLayout.Stretch; + ClientSize = new Size(800, 450); + Controls.Add(menuStrip1); + MainMenuStrip = menuStrip1; + Name = "FormGasStation"; + StartPosition = FormStartPosition.CenterScreen; + Text = "Заправка"; + menuStrip1.ResumeLayout(false); + menuStrip1.PerformLayout(); + ResumeLayout(false); + PerformLayout(); + } + + #endregion + + 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; + } +} diff --git a/GasStation/FormGasstation.cs b/GasStation/FormGasstation.cs new file mode 100644 index 0000000..cf0982b --- /dev/null +++ b/GasStation/FormGasstation.cs @@ -0,0 +1,10 @@ +namespace GasStation +{ + public partial class FormGasStation : System.Windows.Forms.Form + { + public FormGasStation() + { + InitializeComponent(); + } + } +} diff --git a/GasStation/FormGasstation.resx b/GasStation/FormGasstation.resx new file mode 100644 index 0000000..b48baf1 --- /dev/null +++ b/GasStation/FormGasstation.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/GasStation/Forms/FormGasman.Designer.cs b/GasStation/Forms/FormGasman.Designer.cs new file mode 100644 index 0000000..b307769 --- /dev/null +++ b/GasStation/Forms/FormGasman.Designer.cs @@ -0,0 +1,117 @@ +namespace GasStation.Forms +{ + partial class FormGasman + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + labelName = new Label(); + labelNumber = new Label(); + textBoxName = new TextBox(); + textBoxNumber = new TextBox(); + buttonSave = new Button(); + buttonCancel = new Button(); + SuspendLayout(); + // + // labelName + // + labelName.AutoSize = true; + labelName.Location = new Point(52, 44); + labelName.Name = "labelName"; + labelName.Size = new Size(31, 15); + labelName.TabIndex = 0; + labelName.Text = "Имя"; + // + // labelNumber + // + labelNumber.AutoSize = true; + labelNumber.Location = new Point(52, 94); + labelNumber.Name = "labelNumber"; + labelNumber.Size = new Size(45, 15); + labelNumber.TabIndex = 1; + labelNumber.Text = "Номер"; + // + // textBoxName + // + textBoxName.Location = new Point(141, 41); + textBoxName.Name = "textBoxName"; + textBoxName.Size = new Size(153, 23); + textBoxName.TabIndex = 2; + // + // textBoxNumber + // + textBoxNumber.Location = new Point(141, 86); + textBoxNumber.Name = "textBoxNumber"; + textBoxNumber.Size = new Size(153, 23); + textBoxNumber.TabIndex = 3; + // + // buttonSave + // + buttonSave.Location = new Point(52, 169); + buttonSave.Name = "buttonSave"; + buttonSave.Size = new Size(75, 23); + buttonSave.TabIndex = 4; + buttonSave.Text = "Сохранить"; + buttonSave.UseVisualStyleBackColor = true; + buttonSave.Click += ButtonSave_Click; + // + // buttonCancel + // + buttonCancel.Location = new Point(219, 169); + buttonCancel.Name = "buttonCancel"; + buttonCancel.Size = new Size(75, 23); + buttonCancel.TabIndex = 5; + buttonCancel.Text = "Отмена"; + buttonCancel.UseVisualStyleBackColor = true; + buttonCancel.Click += ButtonCancel_Click; + // + // FormGasman + // + AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(421, 248); + Controls.Add(buttonCancel); + Controls.Add(buttonSave); + Controls.Add(textBoxNumber); + Controls.Add(textBoxName); + Controls.Add(labelNumber); + Controls.Add(labelName); + Name = "FormGasman"; + Text = "Заправщик"; + ResumeLayout(false); + PerformLayout(); + } + + #endregion + + private Label labelName; + private Label labelNumber; + private TextBox textBoxName; + private TextBox textBoxNumber; + private Button buttonSave; + private Button buttonCancel; + } +} \ No newline at end of file diff --git a/GasStation/Forms/FormGasman.cs b/GasStation/Forms/FormGasman.cs new file mode 100644 index 0000000..9fc1bc3 --- /dev/null +++ b/GasStation/Forms/FormGasman.cs @@ -0,0 +1,74 @@ +using GasStation.Entities; +using GasStation.Repositories; + + +namespace GasStation.Forms +{ + public partial class FormGasman : Form + { + private readonly IGasmanRepository _gasmanRepository; + + private int? _gasmanId; + + public FormGasman(IGasmanRepository gasmanRepository) + { + InitializeComponent(); + _gasmanRepository = gasmanRepository ?? + throw new ArgumentNullException(nameof(gasmanRepository)); + } + + public int ID + { + set + { + try + { + var gasman = _gasmanRepository.ReadGasmanByID(value); + if (gasman != null) + { + throw new InvalidDataException(nameof(gasman)); + } + + textBoxName.Text = gasman.GasmanName; + textBoxNumber.Text = gasman.PhoneNumber; + _gasmanId = value; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + } + } + + private void ButtonSave_Click(object sender, EventArgs e) + { + try + { + if (string.IsNullOrWhiteSpace(textBoxName.Text) || + string.IsNullOrWhiteSpace(textBoxNumber.Text)) + { + throw new Exception("Имеются незаполненые поля"); + } + if (_gasmanId.HasValue) + { + _gasmanRepository.UpdateGasman(CreateGasman(_gasmanId.Value)); + } + else + { + _gasmanRepository.CreateGasman(CreateGasman(0)); + } + Close(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + } + + private void ButtonCancel_Click(object sender, EventArgs e) => Close(); + + private Gasman CreateGasman(int id) => Gasman.CreateGasman(id, textBoxName.Text, textBoxNumber.Text); + } +} diff --git a/GasStation/Forms/FormGasman.resx b/GasStation/Forms/FormGasman.resx new file mode 100644 index 0000000..8b2ff64 --- /dev/null +++ b/GasStation/Forms/FormGasman.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/GasStation/Forms/FormGasmen.Designer.cs b/GasStation/Forms/FormGasmen.Designer.cs new file mode 100644 index 0000000..d6b3826 --- /dev/null +++ b/GasStation/Forms/FormGasmen.Designer.cs @@ -0,0 +1,122 @@ +namespace GasStation.Forms +{ + partial class FormGasmen + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + panel1 = new Panel(); + buttonUpd = new Button(); + buttonDel = new Button(); + buttonAdd = new Button(); + dataGridViewData = new DataGridView(); + panel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)dataGridViewData).BeginInit(); + SuspendLayout(); + // + // panel1 + // + panel1.Controls.Add(buttonUpd); + panel1.Controls.Add(buttonDel); + panel1.Controls.Add(buttonAdd); + panel1.Dock = DockStyle.Right; + panel1.Location = new Point(657, 0); + panel1.Name = "panel1"; + panel1.Size = new Size(143, 449); + panel1.TabIndex = 0; + // + // buttonUpd + // + buttonUpd.Location = new Point(35, 343); + buttonUpd.Name = "buttonUpd"; + buttonUpd.Size = new Size(75, 69); + buttonUpd.TabIndex = 3; + buttonUpd.Text = "Редактировать"; + buttonUpd.UseVisualStyleBackColor = true; + buttonUpd.Click += ButtonUpd_Click; + // + // buttonDel + // + buttonDel.Location = new Point(33, 188); + buttonDel.Name = "buttonDel"; + buttonDel.Size = new Size(77, 73); + buttonDel.TabIndex = 2; + buttonDel.Text = "Удалить"; + buttonDel.UseVisualStyleBackColor = true; + buttonDel.Click += ButtonDel_Click; + // + // buttonAdd + // + buttonAdd.Location = new Point(32, 30); + buttonAdd.Name = "buttonAdd"; + buttonAdd.Size = new Size(75, 73); + buttonAdd.TabIndex = 1; + buttonAdd.Text = "Добавить"; + buttonAdd.UseVisualStyleBackColor = true; + buttonAdd.Click += ButtonAdd_Click; + // + // dataGridViewData + // + dataGridViewData.AllowUserToAddRows = false; + dataGridViewData.AllowUserToDeleteRows = false; + dataGridViewData.AllowUserToResizeColumns = false; + dataGridViewData.AllowUserToResizeRows = false; + dataGridViewData.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; + dataGridViewData.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; + dataGridViewData.Dock = DockStyle.Fill; + dataGridViewData.Location = new Point(0, 0); + dataGridViewData.MultiSelect = false; + dataGridViewData.Name = "dataGridViewData"; + dataGridViewData.ReadOnly = true; + dataGridViewData.RowHeadersVisible = false; + dataGridViewData.SelectionMode = DataGridViewSelectionMode.FullRowSelect; + dataGridViewData.Size = new Size(657, 449); + dataGridViewData.TabIndex = 1; + // + // FormGasmen + // + AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(800, 449); + Controls.Add(dataGridViewData); + Controls.Add(panel1); + Name = "FormGasmen"; + Text = "FormGasmen"; + Load += FormGasmen_Load; + panel1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)dataGridViewData).EndInit(); + ResumeLayout(false); + } + + #endregion + + private Panel panel1; + private Button buttonAdd; + private Button buttonDel; + private Button buttonUpd; + private DataGridView dataGridViewData; + } +} \ No newline at end of file diff --git a/GasStation/Forms/FormGasmen.cs b/GasStation/Forms/FormGasmen.cs new file mode 100644 index 0000000..cb825ad --- /dev/null +++ b/GasStation/Forms/FormGasmen.cs @@ -0,0 +1,104 @@ +using GasStation.Repositories; +using Unity; + +namespace GasStation.Forms +{ + public partial class FormGasmen : Form + { + private readonly IUnityContainer _container; + + private readonly IGasmanRepository _gasmanRepository; + + public FormGasmen(IUnityContainer container, IGasmanRepository gasmanRepository) + { + InitializeComponent(); + _container = container ?? + throw new ArgumentNullException(nameof(container)); + _gasmanRepository = gasmanRepository ?? + throw new ArgumentNullException(nameof(gasmanRepository)); + } + + private void ButtonAdd_Click(object sender, EventArgs e) + { + try + { + _container.Resolve().ShowDialog(); + LoadList(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void ButtonDel_Click(object sender, EventArgs e) + { + if (!TryGetIDFromSelectedRow(out var findID)) + { + return; + } + + if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes) + { + return; + } + + try + { + _gasmanRepository.DeleteGasman(findID); + LoadList(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка удаления", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void ButtonUpd_Click(object sender, EventArgs e) + { + if (!TryGetIDFromSelectedRow(out var findID)) + { + return; + } + + try + { + var form = _container.Resolve(); + form.ID = findID; + form.ShowDialog(); + LoadList(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при изменении", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void FormGasmen_Load(object sender, EventArgs e) + { + try + { + LoadList(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void LoadList() => dataGridViewData.DataSource = _gasmanRepository.ReadGasman(); + + private bool TryGetIDFromSelectedRow(out int id) + { + id = 0; + if (dataGridViewData.SelectedRows.Count < 1) + { + MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return false; + } + + id = Convert.ToInt32(dataGridViewData.SelectedRows[0].Cells["ID"].Value); + return true; + } + } +} diff --git a/GasStation/Forms/FormGasmen.resx b/GasStation/Forms/FormGasmen.resx new file mode 100644 index 0000000..8b2ff64 --- /dev/null +++ b/GasStation/Forms/FormGasmen.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/GasStation/Forms/FormSupplier.Designer.cs b/GasStation/Forms/FormSupplier.Designer.cs new file mode 100644 index 0000000..85466e7 --- /dev/null +++ b/GasStation/Forms/FormSupplier.Designer.cs @@ -0,0 +1,96 @@ +namespace GasStation.Forms +{ + partial class FormSupplier + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + textBoxSupplierName = new TextBox(); + labelSupplier = new Label(); + buttonSave = new Button(); + buttonCancel = new Button(); + SuspendLayout(); + // + // textBoxSupplierName + // + textBoxSupplierName.Location = new Point(100, 12); + textBoxSupplierName.Name = "textBoxSupplierName"; + textBoxSupplierName.Size = new Size(290, 23); + textBoxSupplierName.TabIndex = 0; + // + // labelSupplier + // + labelSupplier.AutoSize = true; + labelSupplier.Location = new Point(12, 15); + labelSupplier.Name = "labelSupplier"; + labelSupplier.Size = new Size(70, 15); + labelSupplier.TabIndex = 1; + labelSupplier.Text = "Поставщик"; + // + // buttonSave + // + buttonSave.Location = new Point(100, 52); + buttonSave.Name = "buttonSave"; + buttonSave.Size = new Size(75, 23); + buttonSave.TabIndex = 2; + buttonSave.Text = "Сохранить"; + buttonSave.UseVisualStyleBackColor = true; + buttonSave.Click += ButtonSave_Click; + // + // buttonCancel + // + buttonCancel.Location = new Point(315, 52); + buttonCancel.Name = "buttonCancel"; + buttonCancel.Size = new Size(75, 23); + buttonCancel.TabIndex = 3; + buttonCancel.Text = "Отмена"; + buttonCancel.UseVisualStyleBackColor = true; + buttonCancel.Click += ButtonCancel_Click; + // + // FormSupplier + // + AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(438, 122); + Controls.Add(buttonCancel); + Controls.Add(buttonSave); + Controls.Add(labelSupplier); + Controls.Add(textBoxSupplierName); + Name = "FormSupplier"; + StartPosition = FormStartPosition.CenterParent; + Text = "FormSupplier"; + ResumeLayout(false); + PerformLayout(); + } + + #endregion + + private TextBox textBoxSupplierName; + private Label labelSupplier; + private Button buttonSave; + private Button buttonCancel; + } +} \ No newline at end of file diff --git a/GasStation/Forms/FormSupplier.cs b/GasStation/Forms/FormSupplier.cs new file mode 100644 index 0000000..e3b523e --- /dev/null +++ b/GasStation/Forms/FormSupplier.cs @@ -0,0 +1,71 @@ +using GasStation.Entities; +using GasStation.Repositories; + +namespace GasStation.Forms +{ + public partial class FormSupplier : Form + { + private readonly ISupplierRepository _suppliarRepository; + + private int? _supplierId; + + public int ID + { + set + { + try + { + var supplier = _suppliarRepository.ReadSupplierByID(value); + if (supplier != null) + { + throw new InvalidDataException(nameof(supplier)); + } + + textBoxSupplierName.Text = supplier.ProductName; + _supplierId = value; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + } + } + + public FormSupplier(ISupplierRepository supplierRepository) + { + InitializeComponent(); + _suppliarRepository = supplierRepository ?? + throw new ArgumentNullException(nameof(supplierRepository)); + } + + private void ButtonSave_Click(object sender, EventArgs e) + { + try + { + if (string.IsNullOrWhiteSpace(textBoxSupplierName.Text)) + { + throw new Exception("Имеются незаполненые поля"); + } + if (_supplierId.HasValue) + { + _suppliarRepository.UpdateSupplier(CreateSupplier(_supplierId.Value)); + } + else + { + _suppliarRepository.CreateSupplier(CreateSupplier(0)); + } + Close(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + } + + private Supplier CreateSupplier(int id) => Supplier.CreateSupplier(id, textBoxSupplierName.Text); + + private void ButtonCancel_Click(object sender, EventArgs e) => Close(); + } +} diff --git a/GasStation/Forms/FormSupplier.resx b/GasStation/Forms/FormSupplier.resx new file mode 100644 index 0000000..8b2ff64 --- /dev/null +++ b/GasStation/Forms/FormSupplier.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/GasStation/Forms/FormSuppliers.Designer.cs b/GasStation/Forms/FormSuppliers.Designer.cs new file mode 100644 index 0000000..3d36322 --- /dev/null +++ b/GasStation/Forms/FormSuppliers.Designer.cs @@ -0,0 +1,123 @@ +namespace GasStation.Forms +{ + partial class FormSuppliers + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + panel1 = new Panel(); + buttonUpd = new Button(); + buttonDel = new Button(); + buttonAdd = new Button(); + dataGridViewData = new DataGridView(); + panel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)dataGridViewData).BeginInit(); + SuspendLayout(); + // + // panel1 + // + panel1.Controls.Add(buttonUpd); + panel1.Controls.Add(buttonDel); + panel1.Controls.Add(buttonAdd); + panel1.Dock = DockStyle.Right; + panel1.Location = new Point(631, 0); + panel1.Name = "panel1"; + panel1.Size = new Size(170, 477); + panel1.TabIndex = 0; + // + // buttonUpd + // + buttonUpd.Location = new Point(47, 324); + buttonUpd.Name = "buttonUpd"; + buttonUpd.Size = new Size(75, 69); + buttonUpd.TabIndex = 2; + buttonUpd.Text = "Редактировать"; + buttonUpd.UseVisualStyleBackColor = true; + buttonUpd.Click += ButtonUpd_Click; + // + // buttonDel + // + buttonDel.Location = new Point(45, 178); + buttonDel.Name = "buttonDel"; + buttonDel.Size = new Size(77, 73); + buttonDel.TabIndex = 1; + buttonDel.Text = "Удалить"; + buttonDel.UseVisualStyleBackColor = true; + buttonDel.Click += ButtonDel_Click; + // + // buttonAdd + // + buttonAdd.Location = new Point(47, 41); + buttonAdd.Name = "buttonAdd"; + buttonAdd.Size = new Size(75, 73); + buttonAdd.TabIndex = 0; + buttonAdd.Text = "Добавить"; + buttonAdd.UseVisualStyleBackColor = true; + buttonAdd.Click += ButtonAdd_Click; + // + // dataGridViewData + // + dataGridViewData.AllowUserToAddRows = false; + dataGridViewData.AllowUserToDeleteRows = false; + dataGridViewData.AllowUserToResizeColumns = false; + dataGridViewData.AllowUserToResizeRows = false; + dataGridViewData.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; + dataGridViewData.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; + dataGridViewData.Dock = DockStyle.Fill; + dataGridViewData.Location = new Point(0, 0); + dataGridViewData.MultiSelect = false; + dataGridViewData.Name = "dataGridViewData"; + dataGridViewData.ReadOnly = true; + dataGridViewData.RowHeadersVisible = false; + dataGridViewData.SelectionMode = DataGridViewSelectionMode.FullRowSelect; + dataGridViewData.Size = new Size(631, 477); + dataGridViewData.TabIndex = 1; + // + // FormSuppliers + // + AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(801, 477); + Controls.Add(dataGridViewData); + Controls.Add(panel1); + Name = "FormSuppliers"; + StartPosition = FormStartPosition.CenterParent; + Text = "Поставщики"; + Load += FormSuppliers_Load; + panel1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)dataGridViewData).EndInit(); + ResumeLayout(false); + } + + #endregion + + private Panel panel1; + private Button buttonUpd; + private Button buttonDel; + private Button buttonAdd; + private DataGridView dataGridViewData; + } +} \ No newline at end of file diff --git a/GasStation/Forms/FormSuppliers.cs b/GasStation/Forms/FormSuppliers.cs new file mode 100644 index 0000000..c90c1b6 --- /dev/null +++ b/GasStation/Forms/FormSuppliers.cs @@ -0,0 +1,104 @@ +using GasStation.Repositories; +using Unity; + +namespace GasStation.Forms +{ + public partial class FormSuppliers : Form + { + private readonly IUnityContainer _container; + + private readonly ISupplierRepository _supplierRepository; + + public FormSuppliers(IUnityContainer container, ISupplierRepository supplierRepository) + { + InitializeComponent(); + _container = container ?? + throw new ArgumentNullException(nameof(container)); + _supplierRepository = supplierRepository ?? + throw new ArgumentNullException(nameof(supplierRepository)); + } + + private void ButtonAdd_Click(object sender, EventArgs e) + { + try + { + _container.Resolve().ShowDialog(); + LoadList(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void ButtonDel_Click(object sender, EventArgs e) + { + if (!TryGetIDFromSelectedRow(out var findID)) + { + return; + } + + if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes) + { + return; + } + + try + { + _supplierRepository.DeleteSupplier(findID); + LoadList(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка удаления", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void ButtonUpd_Click(object sender, EventArgs e) + { + if (!TryGetIDFromSelectedRow(out var findID)) + { + return; + } + + try + { + var form = _container.Resolve(); + form.ID = findID; + form.ShowDialog(); + LoadList(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при изменении", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void FormSuppliers_Load(object sender, EventArgs e) + { + try + { + LoadList(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void LoadList() => dataGridViewData.DataSource = _supplierRepository.ReadSupplier(); + + private bool TryGetIDFromSelectedRow(out int id) + { + id = 0; + if (dataGridViewData.SelectedRows.Count < 1) + { + MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return false; + } + + id = Convert.ToInt32(dataGridViewData.SelectedRows[0].Cells["ID"].Value); + return true; + } + } +} diff --git a/GasStation/Forms/FormSuppliers.resx b/GasStation/Forms/FormSuppliers.resx new file mode 100644 index 0000000..8b2ff64 --- /dev/null +++ b/GasStation/Forms/FormSuppliers.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/GasStation/GasStation.csproj b/GasStation/GasStation.csproj index 663fdb8..accbdf0 100644 --- a/GasStation/GasStation.csproj +++ b/GasStation/GasStation.csproj @@ -8,4 +8,23 @@ enable + + + + + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + \ No newline at end of file diff --git a/GasStation/Program.cs b/GasStation/Program.cs index 3efb72f..cf073c0 100644 --- a/GasStation/Program.cs +++ b/GasStation/Program.cs @@ -1,17 +1,33 @@ -namespace GasStation +using GasStation.Repositories; +using GasStation.Repositories.Implementations; +using System.Drawing.Text; +using Unity; + +namespace GasStation; + +internal static class Program { - internal static class Program + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - // To customize application configuration such as set high DPI settings or default font, - // see https://aka.ms/applicationconfiguration. - ApplicationConfiguration.Initialize(); - Application.Run(new Form1()); - } + // To customize application configuration such as set high DPI settings or default font, + // see https://aka.ms/applicationconfiguration. + ApplicationConfiguration.Initialize(); + Application.Run(CreateContainer().Resolve()); + } + + private static IUnityContainer CreateContainer() + { + var container = new UnityContainer(); + + container.RegisterType(); + container.RegisterType(); + container.RegisterType(); + container.RegisterType(); + + return container; } } \ No newline at end of file diff --git a/GasStation/Properties/Resources.Designer.cs b/GasStation/Properties/Resources.Designer.cs new file mode 100644 index 0000000..2ad0d69 --- /dev/null +++ b/GasStation/Properties/Resources.Designer.cs @@ -0,0 +1,73 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +namespace GasStation.Properties { + using System; + + + /// + /// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д. + /// + // Этот класс создан автоматически классом StronglyTypedResourceBuilder + // с помощью такого средства, как ResGen или Visual Studio. + // Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen + // с параметром /str или перестройте свой проект VS. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GasStation.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Перезаписывает свойство CurrentUICulture текущего потока для всех + /// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap заправка { + get { + object obj = ResourceManager.GetObject("заправка", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/GasStation/Form1.resx b/GasStation/Properties/Resources.resx similarity index 93% rename from GasStation/Form1.resx rename to GasStation/Properties/Resources.resx index 1af7de1..d6de511 100644 --- a/GasStation/Form1.resx +++ b/GasStation/Properties/Resources.resx @@ -117,4 +117,8 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\заправка.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/GasStation/Repositories/IGasmanRepository.cs b/GasStation/Repositories/IGasmanRepository.cs new file mode 100644 index 0000000..0e52558 --- /dev/null +++ b/GasStation/Repositories/IGasmanRepository.cs @@ -0,0 +1,16 @@ +using GasStation.Entities; + +namespace GasStation.Repositories; + +public interface IGasmanRepository +{ + IEnumerable ReadGasman(); + + Gasman ReadGasmanByID(int id); + + void CreateGasman(Gasman gasman); + + void UpdateGasman(Gasman gasman); + + void DeleteGasman(int id); +} diff --git a/GasStation/Repositories/ISellingRepository.cs b/GasStation/Repositories/ISellingRepository.cs new file mode 100644 index 0000000..2371e57 --- /dev/null +++ b/GasStation/Repositories/ISellingRepository.cs @@ -0,0 +1,10 @@ +using GasStation.Entities; + +namespace GasStation.Repositories; + +public interface ISellingRepository +{ + IEnumerable ReadSelling(DateTime? dateTime = null, int? count = null, int? productID = null, int? gasmanID = null); + + void CreateSelling(Selling selling); +} diff --git a/GasStation/Repositories/ISupplierRepository.cs b/GasStation/Repositories/ISupplierRepository.cs new file mode 100644 index 0000000..08cb41f --- /dev/null +++ b/GasStation/Repositories/ISupplierRepository.cs @@ -0,0 +1,16 @@ +using GasStation.Entities; + +namespace GasStation.Repositories; + +public interface ISupplierRepository +{ + IEnumerable ReadSupplier(); + + Supplier ReadSupplierByID(int id); + + void CreateSupplier(Supplier supplier); + + void UpdateSupplier(Supplier supplier); + + void DeleteSupplier(int id); +} diff --git a/GasStation/Repositories/ISupplyRepository.cs b/GasStation/Repositories/ISupplyRepository.cs new file mode 100644 index 0000000..8e8758f --- /dev/null +++ b/GasStation/Repositories/ISupplyRepository.cs @@ -0,0 +1,12 @@ +using GasStation.Entities; + +namespace GasStation.Repositories; + +public interface ISupplyRepository +{ + IEnumerable ReadSupply(DateTime? supplyDate = null, int? supplierID = null, int? productID = null); + + void CreateSelling(Supply supply); + + void DeleteSelling(int id); +} diff --git a/GasStation/Repositories/Implementations/GasmanRepository.cs b/GasStation/Repositories/Implementations/GasmanRepository.cs new file mode 100644 index 0000000..d075ea5 --- /dev/null +++ b/GasStation/Repositories/Implementations/GasmanRepository.cs @@ -0,0 +1,28 @@ +using GasStation.Entities; + +namespace GasStation.Repositories.Implementations; + +public class GasmanRepository : IGasmanRepository +{ + public void CreateGasman(Gasman gasman) + { + } + + public void DeleteGasman(int id) + { + } + + public Gasman ReadGasmanByID(int id) + { + return Gasman.CreateGasman(0, string.Empty, string.Empty); + } + + public IEnumerable ReadGasman() + { + return []; + } + + public void UpdateGasman(Gasman gasman) + { + } +} diff --git a/GasStation/Repositories/Implementations/SellingRepository.cs b/GasStation/Repositories/Implementations/SellingRepository.cs new file mode 100644 index 0000000..3c3e387 --- /dev/null +++ b/GasStation/Repositories/Implementations/SellingRepository.cs @@ -0,0 +1,15 @@ +using GasStation.Entities; + +namespace GasStation.Repositories.Implementations; + +public class SellingRepository : ISellingRepository +{ + public void CreateSelling(Selling selling) + { + } + + public IEnumerable ReadSelling(DateTime? dateTime = null, int? count = null, int? productID = null, int? gasmanID = null) + { + return []; + } +} diff --git a/GasStation/Repositories/Implementations/SupplierRepository.cs b/GasStation/Repositories/Implementations/SupplierRepository.cs new file mode 100644 index 0000000..19bf2c0 --- /dev/null +++ b/GasStation/Repositories/Implementations/SupplierRepository.cs @@ -0,0 +1,28 @@ +using GasStation.Entities; + +namespace GasStation.Repositories.Implementations; + +public class SupplierRepository : ISupplierRepository +{ + public void CreateSupplier(Supplier supplier) + { + } + + public void DeleteSupplier(int id) + { + } + + public Supplier ReadSupplierByID(int id) + { + return Supplier.CreateSupplier(0, string.Empty); + } + + public IEnumerable ReadSupplier() + { + return []; + } + + public void UpdateSupplier(Supplier supplier) + { + } +} diff --git a/GasStation/Repositories/Implementations/SupplyRepository.cs b/GasStation/Repositories/Implementations/SupplyRepository.cs new file mode 100644 index 0000000..dce1020 --- /dev/null +++ b/GasStation/Repositories/Implementations/SupplyRepository.cs @@ -0,0 +1,19 @@ +using GasStation.Entities; + +namespace GasStation.Repositories.Implementations; + +public class SupplyRepository : ISupplyRepository +{ + public void CreateSelling(Supply supply) + { + } + + public void DeleteSelling(int id) + { + } + + public IEnumerable ReadSupply(DateTime? supplyDate = null, int? supplierID = null, int? productID = null) + { + return []; + } +} diff --git a/GasStation/Resources/заправка.jpg b/GasStation/Resources/заправка.jpg new file mode 100644 index 0000000..55391f3 Binary files /dev/null and b/GasStation/Resources/заправка.jpg differ