diff --git a/ProjectCompRepair/ProjectCompRepair/Entities/Accessories.cs b/ProjectCompRepair/ProjectCompRepair/Entities/Accessories.cs new file mode 100644 index 0000000..5e52205 --- /dev/null +++ b/ProjectCompRepair/ProjectCompRepair/Entities/Accessories.cs @@ -0,0 +1,29 @@ +using ProjectCompRepair.Entities.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectCompRepair.Entities; + +public class Accessories +{ + public int Id { get; private set; } + + public AccessoriesType AccessoriesType { get; private set; } + + public int Count { get; private set; } + + public double Price { get; private set; } + + public static Accessories CreateEntity(int id, AccessoriesType accessoriesType, double price) + { + return new Accessories + { + Id = id, + AccessoriesType = accessoriesType, + Price = price + }; + } +} diff --git a/ProjectCompRepair/ProjectCompRepair/Entities/DeliveryToTheWarehouse.cs b/ProjectCompRepair/ProjectCompRepair/Entities/DeliveryToTheWarehouse.cs new file mode 100644 index 0000000..5f282c7 --- /dev/null +++ b/ProjectCompRepair/ProjectCompRepair/Entities/DeliveryToTheWarehouse.cs @@ -0,0 +1,29 @@ +using ProjectCompRepair.Entities.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectCompRepair.Entities; + +public class DeliveryToTheWarehouse +{ + public int Id { get; private set; } + + public DateTime Date { get; private set; } + + public AccessoriesType AccessoriesType { get; private set; } + public int Count { get; private set; } + + public static DeliveryToTheWarehouse CreateOperation(int id, AccessoriesType accessoriesType, int count) + { + return new DeliveryToTheWarehouse() + { + Id = id, + AccessoriesType = accessoriesType, + Date = DateTime.Now, + Count = count, + }; + } +} diff --git a/ProjectCompRepair/ProjectCompRepair/Entities/Enums/AccessoriesType.cs b/ProjectCompRepair/ProjectCompRepair/Entities/Enums/AccessoriesType.cs new file mode 100644 index 0000000..8610aae --- /dev/null +++ b/ProjectCompRepair/ProjectCompRepair/Entities/Enums/AccessoriesType.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectCompRepair.Entities.Enums; + +[Flags] +public enum AccessoriesType +{ + None = 0, + + Processor = 1, + + AccessMemory = 2, + + VideoCard = 4, + + Cooler = 8 + +} diff --git a/ProjectCompRepair/ProjectCompRepair/Entities/Enums/ServiceType.cs b/ProjectCompRepair/ProjectCompRepair/Entities/Enums/ServiceType.cs new file mode 100644 index 0000000..6c73889 --- /dev/null +++ b/ProjectCompRepair/ProjectCompRepair/Entities/Enums/ServiceType.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectCompRepair.Entities.Enums; + +[Flags] +public enum ServiceType +{ + None = 0, + + Replacement = 1, + + Installation = 2, + + Repair = 4 +} diff --git a/ProjectCompRepair/ProjectCompRepair/Entities/Master.cs b/ProjectCompRepair/ProjectCompRepair/Entities/Master.cs new file mode 100644 index 0000000..10df4ab --- /dev/null +++ b/ProjectCompRepair/ProjectCompRepair/Entities/Master.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectCompRepair.Entities; + +public class Master +{ + public int Id { get; private set; } + public string Name { get; private set; } + + public static Master CreateEntity(int id, string name) + { + return new Master + { + Id = id, + Name = name + }; + } +} diff --git a/ProjectCompRepair/ProjectCompRepair/Entities/Order.cs b/ProjectCompRepair/ProjectCompRepair/Entities/Order.cs new file mode 100644 index 0000000..1e38083 --- /dev/null +++ b/ProjectCompRepair/ProjectCompRepair/Entities/Order.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectCompRepair.Entities; + +public class Order +{ + public int Id { get; private set; } + public string Name { get; private set; } + + public string Coment { get; private set; } + + public DateTime Date { get; private set; } + + public int CountAccessories { get; private set; } + + public int CountService { get; private set; } + + public int MasterID { get; private set; } + + public static Order CreateOperation(int id, string name, string coment, int countAccessories, int countService, int masterId) + { + return new Order() + { + Id = id, + Name = name, + Coment = coment, + Date = DateTime.Now, + CountAccessories = countAccessories, + CountService = countService, + MasterID = masterId + }; + } +} diff --git a/ProjectCompRepair/ProjectCompRepair/Entities/Service.cs b/ProjectCompRepair/ProjectCompRepair/Entities/Service.cs new file mode 100644 index 0000000..1ea5d61 --- /dev/null +++ b/ProjectCompRepair/ProjectCompRepair/Entities/Service.cs @@ -0,0 +1,27 @@ +using ProjectCompRepair.Entities.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectCompRepair.Entities; + +public class Service +{ + public int Id { get; private set; } + + public ServiceType ServiceType { get; private set; } + + public double Price { get; private set; } + + public static Service CreateOperation(int id, ServiceType serviceType, int count, double price) + { + return new Service + { + Id = id, + ServiceType = serviceType, + Price = price + }; + } +} diff --git a/ProjectCompRepair/ProjectCompRepair/Entities/Warehouse.cs b/ProjectCompRepair/ProjectCompRepair/Entities/Warehouse.cs new file mode 100644 index 0000000..cba6c35 --- /dev/null +++ b/ProjectCompRepair/ProjectCompRepair/Entities/Warehouse.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectCompRepair.Entities; + +public class Warehouse +{ + public int Id { get; private set; } + + public string Name { get; private set; } + + public int Capacity { get; private set; } + + public static Warehouse CreateEntity(int id, string name, int capacity) + { + return new Warehouse() + { + Id = id, + Name = name, + Capacity = capacity + }; + } +} diff --git a/ProjectCompRepair/ProjectCompRepair/Form1.Designer.cs b/ProjectCompRepair/ProjectCompRepair/Form1.Designer.cs index 1dcc0ae..a17ca87 100644 --- a/ProjectCompRepair/ProjectCompRepair/Form1.Designer.cs +++ b/ProjectCompRepair/ProjectCompRepair/Form1.Designer.cs @@ -1,6 +1,6 @@ namespace ProjectCompRepair { - partial class Form1 + partial class FormCompRepair { /// /// Required designer variable. @@ -28,12 +28,113 @@ /// 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"; + menuStrip = 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(); + услугаToolStripMenuItem = new ToolStripMenuItem(); + menuStrip.SuspendLayout(); + SuspendLayout(); + // + // menuStrip + // + menuStrip.Items.AddRange(new ToolStripItem[] { справочникToolStripMenuItem, операцииToolStripMenuItem, отчетыToolStripMenuItem }); + menuStrip.Location = new Point(0, 0); + menuStrip.Name = "menuStrip"; + menuStrip.Size = new Size(784, 24); + menuStrip.TabIndex = 0; + menuStrip.Text = "menuStrip1"; + // + // справочникToolStripMenuItem + // + справочникToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { комплектующиеToolStripMenuItem, складToolStripMenuItem, мастерToolStripMenuItem, услугаToolStripMenuItem }); + справочникToolStripMenuItem.Name = "справочникToolStripMenuItem"; + справочникToolStripMenuItem.Size = new Size(94, 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.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(180, 22); + заказ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 = "Услуга"; + // + // FormCompRepair + // + AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleMode = AutoScaleMode.Font; + BackgroundImage = Properties.Resources.morskie_kamni_raznocvetnaya_galka; + BackgroundImageLayout = ImageLayout.Stretch; + ClientSize = new Size(784, 411); + Controls.Add(menuStrip); + MainMenuStrip = menuStrip; + Name = "FormCompRepair"; + StartPosition = FormStartPosition.CenterScreen; + Text = "Фирма по ремонту техники"; + menuStrip.ResumeLayout(false); + menuStrip.PerformLayout(); + ResumeLayout(false); + PerformLayout(); } #endregion + + private MenuStrip menuStrip; + 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 завозНаСкладToolStripMenuItem; } } diff --git a/ProjectCompRepair/ProjectCompRepair/Form1.cs b/ProjectCompRepair/ProjectCompRepair/Form1.cs index a24665f..0e80724 100644 --- a/ProjectCompRepair/ProjectCompRepair/Form1.cs +++ b/ProjectCompRepair/ProjectCompRepair/Form1.cs @@ -1,8 +1,8 @@ namespace ProjectCompRepair { - public partial class Form1 : Form + public partial class FormCompRepair : Form { - public Form1() + public FormCompRepair() { InitializeComponent(); } diff --git a/ProjectCompRepair/ProjectCompRepair/Form1.resx b/ProjectCompRepair/ProjectCompRepair/Form1.resx index 1af7de1..6c82d08 100644 --- a/ProjectCompRepair/ProjectCompRepair/Form1.resx +++ b/ProjectCompRepair/ProjectCompRepair/Form1.resx @@ -1,17 +1,17 @@  - @@ -117,4 +117,7 @@ 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/ProjectCompRepair/ProjectCompRepair/Forms/FormAccessorie.Designer.cs b/ProjectCompRepair/ProjectCompRepair/Forms/FormAccessorie.Designer.cs new file mode 100644 index 0000000..de53791 --- /dev/null +++ b/ProjectCompRepair/ProjectCompRepair/Forms/FormAccessorie.Designer.cs @@ -0,0 +1,145 @@ +namespace ProjectCompRepair.Forms +{ + partial class FormAccessorie + { + /// + /// 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() + { + labelType = new Label(); + labelCount = new Label(); + labelPrice = new Label(); + numericUpDownPrice = new NumericUpDown(); + numericUpDownCount = new NumericUpDown(); + numericUpDownType = new NumericUpDown(); + buttonCreate = new Button(); + buttonCancel = new Button(); + ((System.ComponentModel.ISupportInitialize)numericUpDownPrice).BeginInit(); + ((System.ComponentModel.ISupportInitialize)numericUpDownCount).BeginInit(); + ((System.ComponentModel.ISupportInitialize)numericUpDownType).BeginInit(); + SuspendLayout(); + // + // labelType + // + labelType.AutoSize = true; + labelType.Location = new Point(46, 50); + labelType.Name = "labelType"; + labelType.Size = new Size(128, 15); + labelType.TabIndex = 0; + labelType.Text = "Вид комплектующего"; + // + // labelCount + // + labelCount.AutoSize = true; + labelCount.Location = new Point(46, 108); + labelCount.Name = "labelCount"; + labelCount.Size = new Size(79, 15); + labelCount.TabIndex = 2; + labelCount.Text = "Колличество"; + // + // labelPrice + // + labelPrice.AutoSize = true; + labelPrice.Location = new Point(46, 167); + labelPrice.Name = "labelPrice"; + labelPrice.Size = new Size(35, 15); + labelPrice.TabIndex = 4; + labelPrice.Text = "Цена"; + // + // numericUpDownPrice + // + numericUpDownPrice.DecimalPlaces = 2; + numericUpDownPrice.Location = new Point(191, 165); + numericUpDownPrice.Name = "numericUpDownPrice"; + numericUpDownPrice.Size = new Size(120, 23); + numericUpDownPrice.TabIndex = 5; + // + // numericUpDownCount + // + numericUpDownCount.Location = new Point(191, 106); + numericUpDownCount.Name = "numericUpDownCount"; + numericUpDownCount.Size = new Size(120, 23); + numericUpDownCount.TabIndex = 6; + // + // numericUpDownType + // + numericUpDownType.Location = new Point(191, 50); + numericUpDownType.Name = "numericUpDownType"; + numericUpDownType.Size = new Size(120, 23); + numericUpDownType.TabIndex = 7; + // + // buttonCreate + // + buttonCreate.Location = new Point(46, 297); + buttonCreate.Name = "buttonCreate"; + buttonCreate.Size = new Size(75, 23); + buttonCreate.TabIndex = 8; + buttonCreate.Text = "Создать"; + buttonCreate.UseVisualStyleBackColor = true; + // + // buttonCancel + // + buttonCancel.Location = new Point(236, 297); + buttonCancel.Name = "buttonCancel"; + buttonCancel.Size = new Size(75, 23); + buttonCancel.TabIndex = 10; + buttonCancel.Text = "Отмена"; + buttonCancel.UseVisualStyleBackColor = true; + // + // FormAccessorie + // + AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(346, 340); + Controls.Add(buttonCancel); + Controls.Add(buttonCreate); + Controls.Add(numericUpDownType); + Controls.Add(numericUpDownCount); + Controls.Add(numericUpDownPrice); + Controls.Add(labelPrice); + Controls.Add(labelCount); + Controls.Add(labelType); + Name = "FormAccessorie"; + Text = "Комплектующое"; + ((System.ComponentModel.ISupportInitialize)numericUpDownPrice).EndInit(); + ((System.ComponentModel.ISupportInitialize)numericUpDownCount).EndInit(); + ((System.ComponentModel.ISupportInitialize)numericUpDownType).EndInit(); + ResumeLayout(false); + PerformLayout(); + } + + #endregion + + private Label labelType; + private Label labelCount; + private Label labelPrice; + private NumericUpDown numericUpDownPrice; + private NumericUpDown numericUpDownCount; + private NumericUpDown numericUpDownType; + private Button buttonCreate; + private Button buttonUpdate; + private Button buttonCancel; + } +} \ No newline at end of file diff --git a/ProjectCompRepair/ProjectCompRepair/Forms/FormAccessorie.cs b/ProjectCompRepair/ProjectCompRepair/Forms/FormAccessorie.cs new file mode 100644 index 0000000..846db8b --- /dev/null +++ b/ProjectCompRepair/ProjectCompRepair/Forms/FormAccessorie.cs @@ -0,0 +1,20 @@ +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 ProjectCompRepair.Forms +{ + public partial class FormAccessorie : Form + { + public FormAccessorie() + { + InitializeComponent(); + } + } +} diff --git a/ProjectCompRepair/ProjectCompRepair/Forms/FormAccessorie.resx b/ProjectCompRepair/ProjectCompRepair/Forms/FormAccessorie.resx new file mode 100644 index 0000000..af32865 --- /dev/null +++ b/ProjectCompRepair/ProjectCompRepair/Forms/FormAccessorie.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/ProjectCompRepair/ProjectCompRepair/Forms/FormMaster.Designer.cs b/ProjectCompRepair/ProjectCompRepair/Forms/FormMaster.Designer.cs new file mode 100644 index 0000000..52ed8f3 --- /dev/null +++ b/ProjectCompRepair/ProjectCompRepair/Forms/FormMaster.Designer.cs @@ -0,0 +1,96 @@ +namespace ProjectCompRepair.Forms +{ + partial class FormMaster + { + /// + /// 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(); + textBoxName = new TextBox(); + buttonSave = new Button(); + buttonCancel = new Button(); + SuspendLayout(); + // + // labelName + // + labelName.AutoSize = true; + labelName.Location = new Point(27, 55); + labelName.Name = "labelName"; + labelName.Size = new Size(31, 15); + labelName.TabIndex = 0; + labelName.Text = "Имя"; + // + // textBoxName + // + textBoxName.Location = new Point(91, 55); + textBoxName.Name = "textBoxName"; + textBoxName.Size = new Size(100, 23); + textBoxName.TabIndex = 1; + // + // buttonSave + // + buttonSave.Location = new Point(27, 205); + 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(133, 206); + buttonCancel.Name = "buttonCancel"; + buttonCancel.Size = new Size(75, 23); + buttonCancel.TabIndex = 3; + buttonCancel.Text = "Отмена"; + buttonCancel.UseVisualStyleBackColor = true; + buttonCancel.Click += ButtonCancel_Click; + // + // FormMaster + // + AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(241, 253); + Controls.Add(buttonCancel); + Controls.Add(buttonSave); + Controls.Add(textBoxName); + Controls.Add(labelName); + Name = "FormMaster"; + StartPosition = FormStartPosition.CenterScreen; + Text = "Мастер"; + ResumeLayout(false); + PerformLayout(); + } + + #endregion + + private Label labelName; + private TextBox textBoxName; + private Button buttonSave; + private Button buttonCancel; + } +} \ No newline at end of file diff --git a/ProjectCompRepair/ProjectCompRepair/Forms/FormMaster.cs b/ProjectCompRepair/ProjectCompRepair/Forms/FormMaster.cs new file mode 100644 index 0000000..e74cc85 --- /dev/null +++ b/ProjectCompRepair/ProjectCompRepair/Forms/FormMaster.cs @@ -0,0 +1,79 @@ +using ProjectCompRepair.Entities; +using ProjectCompRepair.Repositories; +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 ProjectCompRepair.Forms; + +public partial class FormMaster : Form +{ + private readonly IMasterRepository _masterRepository; + + private int? _masterId; + + public int Id + { + set + { + try + { + var master = _masterRepository.ReadMasterById(value); + if (master == null) + { + throw new InvalidOperationException(nameof(master)); + } + + textBoxName.Text = master.Name; + _masterId = value; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + } + } + + public FormMaster(IMasterRepository masterRepository) + { + InitializeComponent(); + _masterRepository = masterRepository ?? + throw new ArgumentNullException(nameof(masterRepository)); + } + + private void ButtonSave_Click(object sender, EventArgs e) + { + try + { + if (string.IsNullOrEmpty(textBoxName.Text)) + { + throw new Exception("Имеются незаполненные поля"); + } + if (_masterId.HasValue) + { + _masterRepository.UpdateMaster(CreateMaster(_masterId.Value)); + } + else + { + _masterRepository.CreateMaster(CreateMaster(0)); + } + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + + } + + private void ButtonCancel_Click(object sender, EventArgs e) => Close(); + + private Master CreateMaster(int id) => Master.CreateEntity(id, textBoxName.Text); + +} diff --git a/ProjectCompRepair/ProjectCompRepair/Forms/FormMaster.resx b/ProjectCompRepair/ProjectCompRepair/Forms/FormMaster.resx new file mode 100644 index 0000000..af32865 --- /dev/null +++ b/ProjectCompRepair/ProjectCompRepair/Forms/FormMaster.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/ProjectCompRepair/ProjectCompRepair/Forms/FormMasters.Designer.cs b/ProjectCompRepair/ProjectCompRepair/Forms/FormMasters.Designer.cs new file mode 100644 index 0000000..2d2dba3 --- /dev/null +++ b/ProjectCompRepair/ProjectCompRepair/Forms/FormMasters.Designer.cs @@ -0,0 +1,121 @@ +namespace ProjectCompRepair.Forms +{ + partial class FormMasters + { + /// + /// 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() + { + panelButtons = new Panel(); + buttonDel = new Button(); + buttonChange = new Button(); + buttonCreate = new Button(); + dataGridView = new DataGridView(); + panelButtons.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit(); + SuspendLayout(); + // + // panelButtons + // + panelButtons.Controls.Add(buttonDel); + panelButtons.Controls.Add(buttonChange); + panelButtons.Controls.Add(buttonCreate); + panelButtons.Dock = DockStyle.Right; + panelButtons.Location = new Point(598, 0); + panelButtons.Name = "panelButtons"; + panelButtons.Size = new Size(202, 450); + panelButtons.TabIndex = 0; + // + // buttonDel + // + buttonDel.BackgroundImage = Properties.Resources.pngwing_com__7_; + buttonDel.BackgroundImageLayout = ImageLayout.Stretch; + buttonDel.Location = new Point(77, 193); + buttonDel.Name = "buttonDel"; + buttonDel.Size = new Size(61, 57); + buttonDel.TabIndex = 2; + buttonDel.UseVisualStyleBackColor = true; + buttonDel.Click += ButtonDel_Click; + // + // buttonChange + // + buttonChange.BackgroundImage = Properties.Resources.pngwing_com__8_; + buttonChange.BackgroundImageLayout = ImageLayout.Stretch; + buttonChange.Location = new Point(77, 104); + buttonChange.Name = "buttonChange"; + buttonChange.Size = new Size(61, 59); + buttonChange.TabIndex = 1; + buttonChange.UseVisualStyleBackColor = true; + buttonChange.Click += ButtonChange_Click; + // + // buttonCreate + // + buttonCreate.BackgroundImage = Properties.Resources.pngwing_com__6_; + buttonCreate.BackgroundImageLayout = ImageLayout.Stretch; + buttonCreate.Location = new Point(77, 12); + buttonCreate.Name = "buttonCreate"; + buttonCreate.Size = new Size(61, 63); + buttonCreate.TabIndex = 0; + buttonCreate.UseVisualStyleBackColor = true; + buttonCreate.Click += ButtonCreate_Click; + // + // dataGridView + // + dataGridView.AllowUserToResizeColumns = false; + dataGridView.AllowUserToResizeRows = false; + dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; + dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; + dataGridView.Dock = DockStyle.Fill; + dataGridView.Location = new Point(0, 0); + dataGridView.MultiSelect = false; + dataGridView.Name = "dataGridView"; + dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect; + dataGridView.Size = new Size(598, 450); + dataGridView.TabIndex = 1; + // + // FormMasters + // + AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(800, 450); + Controls.Add(dataGridView); + Controls.Add(panelButtons); + Name = "FormMasters"; + Text = "FormMasters"; + Load += FormMasters_Load; + panelButtons.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); + ResumeLayout(false); + } + + #endregion + + private Panel panelButtons; + private Button buttonDel; + private Button buttonChange; + private Button buttonCreate; + private DataGridView dataGridView; + } +} \ No newline at end of file diff --git a/ProjectCompRepair/ProjectCompRepair/Forms/FormMasters.cs b/ProjectCompRepair/ProjectCompRepair/Forms/FormMasters.cs new file mode 100644 index 0000000..393a525 --- /dev/null +++ b/ProjectCompRepair/ProjectCompRepair/Forms/FormMasters.cs @@ -0,0 +1,111 @@ +using ProjectCompRepair.Repositories; +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; +using Unity; + +namespace ProjectCompRepair.Forms +{ + public partial class FormMasters : Form + { + private readonly IUnityContainer _container; + + private readonly IMasterRepository _masterRepository; + + public FormMasters(IUnityContainer container, IMasterRepository masterRepository) + { + InitializeComponent(); + _container = container ?? + throw new ArgumentException(nameof(masterRepository)); + _masterRepository = masterRepository + ?? throw new ArgumentException(nameof(_masterRepository)); + } + private void FormMasters_Load(object sender, EventArgs e) + { + try + { + LoadList(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + + } + private void ButtonCreate_Click(object sender, EventArgs e) + { + try + { + _container.Resolve().ShowDialog(); + LoadList(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void ButtonChange_Click(object sender, EventArgs e) + { + if(!TryGetIdentifierFromSelectRow(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 ButtonDel_Click(object sender, EventArgs e) + { + if(!TryGetIdentifierFromSelectRow(out var findId)) + { + return; + } + if(MessageBox.Show("Удалить запись", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes) + { + return; + } + + try + { + _masterRepository.DeleteMaster(findId); + LoadList(); + } + catch(Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void LoadList() => dataGridView.DataSource = _masterRepository.ReadMaster(); + + private bool TryGetIdentifierFromSelectRow(out int id) + { + id = 0; + if(dataGridView.SelectedRows.Count < 1) + { + MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error ); + return false; + } + + + id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value); + return true; + } + } +} diff --git a/ProjectCompRepair/ProjectCompRepair/Forms/FormMasters.resx b/ProjectCompRepair/ProjectCompRepair/Forms/FormMasters.resx new file mode 100644 index 0000000..af32865 --- /dev/null +++ b/ProjectCompRepair/ProjectCompRepair/Forms/FormMasters.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/ProjectCompRepair/ProjectCompRepair/Program.cs b/ProjectCompRepair/ProjectCompRepair/Program.cs index 8a157f7..82ab2b4 100644 --- a/ProjectCompRepair/ProjectCompRepair/Program.cs +++ b/ProjectCompRepair/ProjectCompRepair/Program.cs @@ -1,3 +1,8 @@ +using ProjectCompRepair.Repositories; +using ProjectCompRepair.Repositories.Implemantations; +using System; +using Unity; + namespace ProjectCompRepair { internal static class Program @@ -11,7 +16,20 @@ namespace ProjectCompRepair // To customize application configuration such as set high DPI settings or default font, // see https://aka.ms/applicationconfiguration. ApplicationConfiguration.Initialize(); - Application.Run(new Form1()); + Application.Run(new FormCompRepair()); + } + + private static IUnityContainer CreateContainer() + { + var container = new UnityContainer(); + + container.RegisterType(); + container.RegisterType(); + container.RegisterType(); + container.RegisterType(); + container.RegisterType(); + + return container; } } } \ No newline at end of file diff --git a/ProjectCompRepair/ProjectCompRepair/ProjectCompRepair.csproj b/ProjectCompRepair/ProjectCompRepair/ProjectCompRepair.csproj index 663fdb8..2f10b71 100644 --- a/ProjectCompRepair/ProjectCompRepair/ProjectCompRepair.csproj +++ b/ProjectCompRepair/ProjectCompRepair/ProjectCompRepair.csproj @@ -8,4 +8,24 @@ enable + + + + + + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + \ No newline at end of file diff --git a/ProjectCompRepair/ProjectCompRepair/Properties/Resources.Designer.cs b/ProjectCompRepair/ProjectCompRepair/Properties/Resources.Designer.cs new file mode 100644 index 0000000..530a19f --- /dev/null +++ b/ProjectCompRepair/ProjectCompRepair/Properties/Resources.Designer.cs @@ -0,0 +1,103 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +namespace ProjectCompRepair.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("ProjectCompRepair.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 morskie_kamni_raznocvetnaya_galka { + get { + object obj = ResourceManager.GetObject("morskie-kamni-raznocvetnaya-galka", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap pngwing_com__6_ { + get { + object obj = ResourceManager.GetObject("pngwing.com (6)", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap pngwing_com__7_ { + get { + object obj = ResourceManager.GetObject("pngwing.com (7)", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap pngwing_com__8_ { + get { + object obj = ResourceManager.GetObject("pngwing.com (8)", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/ProjectCompRepair/ProjectCompRepair/Properties/Resources.resx b/ProjectCompRepair/ProjectCompRepair/Properties/Resources.resx new file mode 100644 index 0000000..a33a7fc --- /dev/null +++ b/ProjectCompRepair/ProjectCompRepair/Properties/Resources.resx @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + ..\Resources\morskie-kamni-raznocvetnaya-galka.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\pngwing.com (8).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\pngwing.com (7).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\pngwing.com (6).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/ProjectCompRepair/ProjectCompRepair/Repositories/IAccessoriesRepository.cs b/ProjectCompRepair/ProjectCompRepair/Repositories/IAccessoriesRepository.cs new file mode 100644 index 0000000..b775dbd --- /dev/null +++ b/ProjectCompRepair/ProjectCompRepair/Repositories/IAccessoriesRepository.cs @@ -0,0 +1,21 @@ +using System; +using ProjectCompRepair.Entities; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectCompRepair.Repositories; + +public interface IAccessoriesRepository +{ + IEnumerable ReadAccessories(); + + Accessories ReadAccessoriesById(int id); + + void CreateAccessories(Accessories accessories); + + void UpdateAccessories(Accessories accessories); + + void DeleteAccessories(int id); + +} diff --git a/ProjectCompRepair/ProjectCompRepair/Repositories/IMasterRepository.cs b/ProjectCompRepair/ProjectCompRepair/Repositories/IMasterRepository.cs new file mode 100644 index 0000000..b886f78 --- /dev/null +++ b/ProjectCompRepair/ProjectCompRepair/Repositories/IMasterRepository.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using ProjectCompRepair.Entities; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectCompRepair.Repositories; + +public interface IMasterRepository +{ + IEnumerable ReadMaster(); + + Master ReadMasterById(int id); + + void CreateMaster(Master Master); + + void UpdateMaster(Master master); + + void DeleteMaster(int id); +} + diff --git a/ProjectCompRepair/ProjectCompRepair/Repositories/IOrderRepository.cs b/ProjectCompRepair/ProjectCompRepair/Repositories/IOrderRepository.cs new file mode 100644 index 0000000..863a410 --- /dev/null +++ b/ProjectCompRepair/ProjectCompRepair/Repositories/IOrderRepository.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System; +using System.Collections.Generic; +using System.Linq; +using ProjectCompRepair.Entities; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectCompRepair.Repositories; + +public interface IOrderRepository +{ + IEnumerable ReadOrder(); + + Order ReadOrderById(int id); + + void CreateOrder(Order order); + + void UpdateOrder(Order order); + + void DeleteOrder(int id); +} + diff --git a/ProjectCompRepair/ProjectCompRepair/Repositories/IServiceRepository.cs b/ProjectCompRepair/ProjectCompRepair/Repositories/IServiceRepository.cs new file mode 100644 index 0000000..9f2cbb5 --- /dev/null +++ b/ProjectCompRepair/ProjectCompRepair/Repositories/IServiceRepository.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using ProjectCompRepair.Entities; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectCompRepair.Repositories; + +public interface IServiceRepository +{ + IEnumerable ReadService(); + + Service ReadServiceById(int id); + + void CreateService(Service service); + + void UpdateService(Service service); + + void DeleteService(int id); +} diff --git a/ProjectCompRepair/ProjectCompRepair/Repositories/IWarehouseRepository.cs b/ProjectCompRepair/ProjectCompRepair/Repositories/IWarehouseRepository.cs new file mode 100644 index 0000000..3f2325d --- /dev/null +++ b/ProjectCompRepair/ProjectCompRepair/Repositories/IWarehouseRepository.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using ProjectCompRepair.Entities; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectCompRepair.Repositories; + +public interface IWarehouseRepository +{ + IEnumerable ReadWarehouse(); + + Warehouse ReadWarehouseById(int id); + + void CreateWarehouse(Warehouse warehouse); + + void UpdateWarehouse(Warehouse warehouse); + + void DeleteWarehouse(int id); +} + diff --git a/ProjectCompRepair/ProjectCompRepair/Repositories/Implemantations/AccessoriesRepository.cs b/ProjectCompRepair/ProjectCompRepair/Repositories/Implemantations/AccessoriesRepository.cs new file mode 100644 index 0000000..59fb33c --- /dev/null +++ b/ProjectCompRepair/ProjectCompRepair/Repositories/Implemantations/AccessoriesRepository.cs @@ -0,0 +1,36 @@ +using System; +using ProjectCompRepair.Entities; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectCompRepair.Repositories.Implemantations; + +public class AccessoriesRepository : IAccessoriesRepository +{ + public void CreateAccessories(Accessories accessories) + { + + } + + public void DeleteAccessories(int id) + { + + } + + public IEnumerable ReadAccessories() + { + return []; + } + + public Accessories ReadAccessoriesById(int id) + { + return Accessories.CreateEntity(0, 0, 0); + } + + public void UpdateAccessories(Accessories accessories) + { + + } +} diff --git a/ProjectCompRepair/ProjectCompRepair/Repositories/Implemantations/MasterRepository.cs b/ProjectCompRepair/ProjectCompRepair/Repositories/Implemantations/MasterRepository.cs new file mode 100644 index 0000000..3bf559a --- /dev/null +++ b/ProjectCompRepair/ProjectCompRepair/Repositories/Implemantations/MasterRepository.cs @@ -0,0 +1,36 @@ +using ProjectCompRepair.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectCompRepair.Repositories.Implemantations; + +public class MasterRepository : IMasterRepository +{ + public void CreateMaster(Master master) + { + + } + + public void DeleteMaster(int id) + { + + } + + public IEnumerable ReadMaster() + { + return []; + } + + public Master ReadMasterById(int id) + { + return Master.CreateEntity(0, string.Empty); + } + + public void UpdateMaster(Master master) + { + + } +} diff --git a/ProjectCompRepair/ProjectCompRepair/Repositories/Implemantations/OrderRepository.cs b/ProjectCompRepair/ProjectCompRepair/Repositories/Implemantations/OrderRepository.cs new file mode 100644 index 0000000..811da19 --- /dev/null +++ b/ProjectCompRepair/ProjectCompRepair/Repositories/Implemantations/OrderRepository.cs @@ -0,0 +1,37 @@ +using ProjectCompRepair.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectCompRepair.Repositories.Implemantations; + +public class OrderRepository : IOrderRepository +{ + public void CreateOrder(Order order) + { + + } + + public void DeleteOrder(int id) + { + + } + + public IEnumerable ReadOrder() + { + return []; + } + + public Order ReadOrderById(int id) + { + return Order.CreateOperation(0, string.Empty, string.Empty, 0, 0, 0); + } + + public void UpdateOrder(Order order) + { + throw new NotImplementedException(); + } + +} diff --git a/ProjectCompRepair/ProjectCompRepair/Repositories/Implemantations/ServiceRepository.cs b/ProjectCompRepair/ProjectCompRepair/Repositories/Implemantations/ServiceRepository.cs new file mode 100644 index 0000000..6ec9e72 --- /dev/null +++ b/ProjectCompRepair/ProjectCompRepair/Repositories/Implemantations/ServiceRepository.cs @@ -0,0 +1,36 @@ +using ProjectCompRepair.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectCompRepair.Repositories.Implemantations; + +public class ServiceRepository : IServiceRepository +{ + public void CreateService(Service service) + { + + } + + public void DeleteService(int id) + { + + } + + public IEnumerable ReadService() + { + return []; + } + + public Service ReadServiceById(int id) + { + return Service.CreateOperation(0, 0, 0, 0); + } + + public void UpdateService(Service service) + { + + } +} diff --git a/ProjectCompRepair/ProjectCompRepair/Repositories/Implemantations/WarehouseRepository.cs b/ProjectCompRepair/ProjectCompRepair/Repositories/Implemantations/WarehouseRepository.cs new file mode 100644 index 0000000..e2568ac --- /dev/null +++ b/ProjectCompRepair/ProjectCompRepair/Repositories/Implemantations/WarehouseRepository.cs @@ -0,0 +1,36 @@ +using ProjectCompRepair.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectCompRepair.Repositories.Implemantations; + +public class WarehouseRepository : IWarehouseRepository +{ + public void CreateWarehouse(Warehouse warehouse) + { + + } + + public void DeleteWarehouse(int id) + { + + } + + public IEnumerable ReadWarehouse() + { + return []; + } + + public Warehouse ReadWarehouseById(int id) + { + return Warehouse.CreateEntity(0, string.Empty, 0); + } + + public void UpdateWarehouse(Warehouse warehouse) + { + + } +} diff --git a/ProjectCompRepair/ProjectCompRepair/Resources/morskie-kamni-raznocvetnaya-galka.jpg b/ProjectCompRepair/ProjectCompRepair/Resources/morskie-kamni-raznocvetnaya-galka.jpg new file mode 100644 index 0000000..25ecbfc Binary files /dev/null and b/ProjectCompRepair/ProjectCompRepair/Resources/morskie-kamni-raznocvetnaya-galka.jpg differ diff --git a/ProjectCompRepair/ProjectCompRepair/Resources/pngwing.com (6).png b/ProjectCompRepair/ProjectCompRepair/Resources/pngwing.com (6).png new file mode 100644 index 0000000..61ae5cc Binary files /dev/null and b/ProjectCompRepair/ProjectCompRepair/Resources/pngwing.com (6).png differ diff --git a/ProjectCompRepair/ProjectCompRepair/Resources/pngwing.com (7).png b/ProjectCompRepair/ProjectCompRepair/Resources/pngwing.com (7).png new file mode 100644 index 0000000..41dd6c3 Binary files /dev/null and b/ProjectCompRepair/ProjectCompRepair/Resources/pngwing.com (7).png differ diff --git a/ProjectCompRepair/ProjectCompRepair/Resources/pngwing.com (8).png b/ProjectCompRepair/ProjectCompRepair/Resources/pngwing.com (8).png new file mode 100644 index 0000000..90f4412 Binary files /dev/null and b/ProjectCompRepair/ProjectCompRepair/Resources/pngwing.com (8).png differ diff --git a/ProjectCompRepair/pngwing.com (6).png b/ProjectCompRepair/pngwing.com (6).png new file mode 100644 index 0000000..61ae5cc Binary files /dev/null and b/ProjectCompRepair/pngwing.com (6).png differ diff --git a/ProjectCompRepair/pngwing.com (7).png b/ProjectCompRepair/pngwing.com (7).png new file mode 100644 index 0000000..41dd6c3 Binary files /dev/null and b/ProjectCompRepair/pngwing.com (7).png differ diff --git a/ProjectCompRepair/pngwing.com (8).png b/ProjectCompRepair/pngwing.com (8).png new file mode 100644 index 0000000..90f4412 Binary files /dev/null and b/ProjectCompRepair/pngwing.com (8).png differ