diff --git a/Accounting-Time-It-Company/Accounting-Time-It-Company/FormCompany.Designer.cs b/Accounting-Time-It-Company/Accounting-Time-It-Company/FormCompany.Designer.cs index cfbab91..1be544f 100644 --- a/Accounting-Time-It-Company/Accounting-Time-It-Company/FormCompany.Designer.cs +++ b/Accounting-Time-It-Company/Accounting-Time-It-Company/FormCompany.Designer.cs @@ -37,6 +37,7 @@ operationsToolStripMenuItem = new ToolStripMenuItem(); vacationsToolStripMenuItem = new ToolStripMenuItem(); typeJobsРаботуToolStripMenuItem = new ToolStripMenuItem(); + workTimeToolStripMenuItem = new ToolStripMenuItem(); reportsToolStripMenuItem = new ToolStripMenuItem(); menuStrip1.SuspendLayout(); SuspendLayout(); @@ -60,35 +61,35 @@ // // PostsToolStripMenuItem // - PostsToolStripMenuItem.Name = "postsToolStripMenuItem"; - PostsToolStripMenuItem.Size = new Size(224, 26); + PostsToolStripMenuItem.Name = "PostsToolStripMenuItem"; + PostsToolStripMenuItem.Size = new Size(170, 26); PostsToolStripMenuItem.Text = "Должности"; PostsToolStripMenuItem.Click += PostsToolStripMenuItem_Click; // // ClientsToolStripMenuItem // - ClientsToolStripMenuItem.Name = "clientsToolStripMenuItem"; - ClientsToolStripMenuItem.Size = new Size(224, 26); + ClientsToolStripMenuItem.Name = "ClientsToolStripMenuItem"; + ClientsToolStripMenuItem.Size = new Size(170, 26); ClientsToolStripMenuItem.Text = "Клиенты"; ClientsToolStripMenuItem.Click += ClientsToolStripMenuItem_Click; // // ProductsToolStripMenuItem // - ProductsToolStripMenuItem.Name = "productsToolStripMenuItem"; - ProductsToolStripMenuItem.Size = new Size(224, 26); + ProductsToolStripMenuItem.Name = "ProductsToolStripMenuItem"; + ProductsToolStripMenuItem.Size = new Size(170, 26); ProductsToolStripMenuItem.Text = "Проекты"; ProductsToolStripMenuItem.Click += ProductsToolStripMenuItem_Click; // // EmployeesToolStripMenuItem // - EmployeesToolStripMenuItem.Name = "employeesToolStripMenuItem"; - EmployeesToolStripMenuItem.Size = new Size(224, 26); + EmployeesToolStripMenuItem.Name = "EmployeesToolStripMenuItem"; + EmployeesToolStripMenuItem.Size = new Size(170, 26); EmployeesToolStripMenuItem.Text = "Работник"; EmployeesToolStripMenuItem.Click += EmployeesToolStripMenuItem_Click; // // operationsToolStripMenuItem // - operationsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { vacationsToolStripMenuItem, typeJobsРаботуToolStripMenuItem }); + operationsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { vacationsToolStripMenuItem, typeJobsРаботуToolStripMenuItem, workTimeToolStripMenuItem }); operationsToolStripMenuItem.Name = "operationsToolStripMenuItem"; operationsToolStripMenuItem.Size = new Size(95, 24); operationsToolStripMenuItem.Text = "Операции"; @@ -102,11 +103,18 @@ // // typeJobsРаботуToolStripMenuItem // - typeJobsРаботуToolStripMenuItem.Name = "typeJobsToolStripMenuItem"; + typeJobsРаботуToolStripMenuItem.Name = "typeJobsРаботуToolStripMenuItem"; typeJobsРаботуToolStripMenuItem.Size = new Size(227, 26); typeJobsРаботуToolStripMenuItem.Text = "Добавит работу"; typeJobsРаботуToolStripMenuItem.Click += TypeJobsToolStripMenuItem_Click; // + // workTimeToolStripMenuItem + // + workTimeToolStripMenuItem.Name = "workTimeToolStripMenuItem"; + workTimeToolStripMenuItem.Size = new Size(227, 26); + workTimeToolStripMenuItem.Text = "Учет времени"; + workTimeToolStripMenuItem.Click += WorkTimeToolStripMenuItem_Click; + // // reportsToolStripMenuItem // reportsToolStripMenuItem.Name = "reportsToolStripMenuItem"; @@ -143,5 +151,6 @@ private ToolStripMenuItem typeJobsРаботуToolStripMenuItem; private ToolStripMenuItem reportsToolStripMenuItem; private ToolStripMenuItem EmployeesToolStripMenuItem; + private ToolStripMenuItem workTimeToolStripMenuItem; } } diff --git a/Accounting-Time-It-Company/Accounting-Time-It-Company/FormCompany.cs b/Accounting-Time-It-Company/Accounting-Time-It-Company/FormCompany.cs index 65493b4..3788eeb 100644 --- a/Accounting-Time-It-Company/Accounting-Time-It-Company/FormCompany.cs +++ b/Accounting-Time-It-Company/Accounting-Time-It-Company/FormCompany.cs @@ -90,5 +90,18 @@ namespace Accounting_Time_It_Company MessageBoxButtons.OK, MessageBoxIcon.Error); } } + + private void WorkTimeToolStripMenuItem_Click(object sender, EventArgs e) + { + try + { + _container.Resolve().ShowDialog(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, " ", + MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } } } diff --git a/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormTypeJob.cs b/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormTypeJob.cs index abac7c9..679ef96 100644 --- a/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormTypeJob.cs +++ b/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormTypeJob.cs @@ -47,7 +47,9 @@ namespace Accounting_Time_It_Company.Forms throw new Exception("Имеются незаполненные поля"); } - _typeJobRepositories.CreateTypeJob(CreateTypeJob(0)); + _typeJobRepositories.CreateTypeJob(TypeJob.CreateOperation(0, (int)comboBoxProduct.SelectedIndex!, textBoxDescriptoin.Text, + (int)numericUpDownAllowanceForJob.Value, (int)comboBoxDevelop.SelectedIndex!, + (int)comboBoxManager.SelectedIndex!)); Close(); } @@ -58,9 +60,5 @@ namespace Accounting_Time_It_Company.Forms } private void ButtonCansle_Click(object sender, EventArgs e) => Close(); - - private TypeJob CreateTypeJob(int id) => TypeJob.CreateOperation(id, (int)comboBoxProduct.SelectedIndex!, textBoxDescriptoin.Text, - (int)numericUpDownAllowanceForJob.Value, (int)comboBoxDevelop.SelectedIndex!, - (int)comboBoxManager.SelectedIndex!); } } diff --git a/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormVacation.cs b/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormVacation.cs index ef880cb..86c7e79 100644 --- a/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormVacation.cs +++ b/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormVacation.cs @@ -35,7 +35,7 @@ namespace Accounting_Time_It_Company.Forms throw new Exception("Имеются незаполненные поля"); } - _vacationRepositories.CreateVacation(CreateVacation(0)); + _vacationRepositories.CreateVacation(Vacation.CreateOpeartion(0, (int)comboBoxEmployee.SelectedIndex!, dateTimePickerStartDate.Value, dateTimePickerEndDate.Value)); Close(); } @@ -46,7 +46,5 @@ namespace Accounting_Time_It_Company.Forms } private void ButtonCansle_Click(object sender, EventArgs e) => Close(); - - private Vacation CreateVacation(int id) => Vacation.CreateOpeartion(id, (int)comboBoxEmployee.SelectedIndex!, dateTimePickerStartDate.Value, dateTimePickerEndDate.Value); } } diff --git a/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormWorkTime.Designer.cs b/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormWorkTime.Designer.cs new file mode 100644 index 0000000..62378fc --- /dev/null +++ b/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormWorkTime.Designer.cs @@ -0,0 +1,170 @@ +namespace Accounting_Time_It_Company.Forms +{ + partial class FormWorkTime + { + /// + /// 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() + { + comboBoxTypeJob = new ComboBox(); + labelTypeJob = new Label(); + comboBoxEmployee = new ComboBox(); + labelEmployee = new Label(); + labelDate = new Label(); + dateTimePickerDate = new DateTimePicker(); + labelHour = new Label(); + numericUpDownHour = new NumericUpDown(); + buttonCansle = new Button(); + buttonSave = new Button(); + ((System.ComponentModel.ISupportInitialize)numericUpDownHour).BeginInit(); + SuspendLayout(); + // + // comboBoxTypeJob + // + comboBoxTypeJob.DropDownStyle = ComboBoxStyle.DropDownList; + comboBoxTypeJob.FormattingEnabled = true; + comboBoxTypeJob.Location = new Point(139, 6); + comboBoxTypeJob.Name = "comboBoxTypeJob"; + comboBoxTypeJob.Size = new Size(203, 28); + comboBoxTypeJob.TabIndex = 4; + // + // labelTypeJob + // + labelTypeJob.AutoSize = true; + labelTypeJob.Location = new Point(12, 9); + labelTypeJob.Name = "labelTypeJob"; + labelTypeJob.Size = new Size(60, 20); + labelTypeJob.TabIndex = 3; + labelTypeJob.Text = "Задача:"; + // + // comboBoxEmployee + // + comboBoxEmployee.DropDownStyle = ComboBoxStyle.DropDownList; + comboBoxEmployee.FormattingEnabled = true; + comboBoxEmployee.Location = new Point(139, 40); + comboBoxEmployee.Name = "comboBoxEmployee"; + comboBoxEmployee.Size = new Size(203, 28); + comboBoxEmployee.TabIndex = 6; + // + // labelEmployee + // + labelEmployee.AutoSize = true; + labelEmployee.Location = new Point(12, 43); + labelEmployee.Name = "labelEmployee"; + labelEmployee.Size = new Size(77, 20); + labelEmployee.TabIndex = 5; + labelEmployee.Text = "Работник:"; + // + // labelDate + // + labelDate.AutoSize = true; + labelDate.Location = new Point(12, 79); + labelDate.Name = "labelDate"; + labelDate.Size = new Size(64, 20); + labelDate.TabIndex = 8; + labelDate.Text = "Начало:"; + // + // dateTimePickerDate + // + dateTimePickerDate.Location = new Point(139, 74); + dateTimePickerDate.Name = "dateTimePickerDate"; + dateTimePickerDate.Size = new Size(203, 27); + dateTimePickerDate.TabIndex = 7; + // + // labelHour + // + labelHour.AutoSize = true; + labelHour.Location = new Point(12, 111); + labelHour.Name = "labelHour"; + labelHour.Size = new Size(110, 20); + labelHour.TabIndex = 9; + labelHour.Text = "Часов работы:"; + // + // numericUpDownHour + // + numericUpDownHour.Location = new Point(139, 107); + numericUpDownHour.Maximum = new decimal(new int[] { 1000, 0, 0, 0 }); + numericUpDownHour.Minimum = new decimal(new int[] { 1, 0, 0, 0 }); + numericUpDownHour.Name = "numericUpDownHour"; + numericUpDownHour.Size = new Size(203, 27); + numericUpDownHour.TabIndex = 10; + numericUpDownHour.Value = new decimal(new int[] { 1, 0, 0, 0 }); + // + // buttonCansle + // + buttonCansle.Location = new Point(248, 166); + buttonCansle.Name = "buttonCansle"; + buttonCansle.Size = new Size(94, 29); + buttonCansle.TabIndex = 26; + buttonCansle.Text = "Отмена"; + buttonCansle.UseVisualStyleBackColor = true; + buttonCansle.Click += ButtonCansle_Click; + // + // buttonSave + // + buttonSave.Location = new Point(139, 166); + buttonSave.Name = "buttonSave"; + buttonSave.Size = new Size(94, 29); + buttonSave.TabIndex = 25; + buttonSave.Text = "Сохранить"; + buttonSave.UseVisualStyleBackColor = true; + buttonSave.Click += ButtonSave_Click; + // + // FormWorkTime + // + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(358, 206); + Controls.Add(buttonCansle); + Controls.Add(buttonSave); + Controls.Add(numericUpDownHour); + Controls.Add(labelHour); + Controls.Add(labelDate); + Controls.Add(dateTimePickerDate); + Controls.Add(comboBoxEmployee); + Controls.Add(labelEmployee); + Controls.Add(comboBoxTypeJob); + Controls.Add(labelTypeJob); + Name = "FormWorkTime"; + Text = "Учет времени"; + ((System.ComponentModel.ISupportInitialize)numericUpDownHour).EndInit(); + ResumeLayout(false); + PerformLayout(); + } + + #endregion + + private ComboBox comboBoxTypeJob; + private Label labelTypeJob; + private ComboBox comboBoxEmployee; + private Label labelEmployee; + private Label labelDate; + private DateTimePicker dateTimePickerDate; + private Label labelHour; + private NumericUpDown numericUpDownHour; + private Button buttonCansle; + private Button buttonSave; + } +} \ No newline at end of file diff --git a/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormWorkTime.cs b/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormWorkTime.cs new file mode 100644 index 0000000..8fcc702 --- /dev/null +++ b/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormWorkTime.cs @@ -0,0 +1,56 @@ +using Accounting_Time_It_Company.Entities.Enums; +using Accounting_Time_It_Company.Entities; +using Accounting_Time_It_Company.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 Accounting_Time_It_Company.Forms +{ + public partial class FormWorkTime : Form + { + private readonly IWorkTimeRepositories _workTimeRepositories; + + public FormWorkTime(IWorkTimeRepositories workTimeRepositories, ITypeJobRepositories typeJobRepositories, IEmployeeRepositories employeeRepositories) + { + InitializeComponent(); + _workTimeRepositories = workTimeRepositories ?? throw new ArgumentNullException(nameof(workTimeRepositories)); + + comboBoxTypeJob.DataSource = typeJobRepositories.ReadTypeJobs(); + comboBoxTypeJob.DisplayMember = "Description"; + comboBoxTypeJob.ValueMember = "Id"; + + comboBoxEmployee.DataSource = employeeRepositories.ReadEmployees(); + comboBoxEmployee.DisplayMember = "Name"; + comboBoxEmployee.ValueMember = "Id"; + } + + private void ButtonSave_Click(object sender, EventArgs e) + { + try + { + if (comboBoxEmployee.SelectedIndex < 0 || + comboBoxTypeJob.SelectedIndex < 0) + { + throw new Exception("Имеются незаполненные поля"); + } + + _workTimeRepositories.CreateWorkTime(WorkTime.CreateOperation(0, (int)comboBoxEmployee.SelectedValue!, dateTimePickerDate.Value, (int)numericUpDownHour.Value)); + + Close(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void ButtonCansle_Click(object sender, EventArgs e) => Close(); + } +} diff --git a/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormWorkTime.resx b/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormWorkTime.resx new file mode 100644 index 0000000..8b2ff64 --- /dev/null +++ b/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormWorkTime.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/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormWorkTimes.Designer.cs b/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormWorkTimes.Designer.cs new file mode 100644 index 0000000..6b488dd --- /dev/null +++ b/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormWorkTimes.Designer.cs @@ -0,0 +1,112 @@ +namespace Accounting_Time_It_Company.Forms +{ + partial class FormWorkTimes + { + /// + /// 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() + { + buttonDelete = new Button(); + buttonAdd = new Button(); + panel1 = new Panel(); + dataGridViewData = new DataGridView(); + panel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)dataGridViewData).BeginInit(); + SuspendLayout(); + // + // buttonDelete + // + buttonDelete.BackgroundImage = Properties.Resources.Delete; + buttonDelete.BackgroundImageLayout = ImageLayout.Stretch; + buttonDelete.Location = new Point(8, 159); + buttonDelete.Name = "buttonDelete"; + buttonDelete.Size = new Size(94, 94); + buttonDelete.TabIndex = 2; + buttonDelete.UseVisualStyleBackColor = true; + buttonDelete.Click += ButtonDelete_Click; + // + // buttonAdd + // + buttonAdd.BackgroundImage = Properties.Resources.Add; + buttonAdd.BackgroundImageLayout = ImageLayout.Stretch; + buttonAdd.Location = new Point(8, 59); + buttonAdd.Name = "buttonAdd"; + buttonAdd.Size = new Size(94, 94); + buttonAdd.TabIndex = 0; + buttonAdd.UseVisualStyleBackColor = true; + buttonAdd.Click += ButtonAdd_Click; + // + // panel1 + // + panel1.Controls.Add(buttonDelete); + panel1.Controls.Add(buttonAdd); + panel1.Dock = DockStyle.Right; + panel1.Location = new Point(686, 0); + panel1.Name = "panel1"; + panel1.Size = new Size(114, 450); + panel1.TabIndex = 8; + // + // 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.RowHeadersWidth = 51; + dataGridViewData.SelectionMode = DataGridViewSelectionMode.FullRowSelect; + dataGridViewData.Size = new Size(800, 450); + dataGridViewData.TabIndex = 9; + // + // FormWorkTimes + // + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(800, 450); + Controls.Add(panel1); + Controls.Add(dataGridViewData); + Name = "FormWorkTimes"; + Text = "Учеты времени"; + Load += FormWorkTimes_Load; + panel1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)dataGridViewData).EndInit(); + ResumeLayout(false); + } + + #endregion + + private Button buttonDelete; + private Button buttonAdd; + private Panel panel1; + private DataGridView dataGridViewData; + } +} \ No newline at end of file diff --git a/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormWorkTimes.cs b/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormWorkTimes.cs new file mode 100644 index 0000000..b3eb105 --- /dev/null +++ b/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormWorkTimes.cs @@ -0,0 +1,88 @@ +using Accounting_Time_It_Company.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 Accounting_Time_It_Company.Forms +{ + public partial class FormWorkTimes : Form + { + private readonly IUnityContainer _container; + + private readonly IWorkTimeRepositories _workTimeRepositories; + + public FormWorkTimes(IUnityContainer container, IWorkTimeRepositories workTimeRepositories) + { + InitializeComponent(); + _container = container ?? throw new ArgumentNullException(nameof(container)); + _workTimeRepositories = workTimeRepositories ?? throw new ArgumentNullException(nameof(workTimeRepositories)); + } + + private void FormWorkTimes_Load(object sender, EventArgs e) + { + try + { + LoadList(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + 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 ButtonDelete_Click(object sender, EventArgs e) + { + if (!TryGetIdentifierFromSelectedRow(out var findId)) + { + return; + } + if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes) + { + return; + } + try + { + _workTimeRepositories.DeleteWorkTime(findId); + LoadList(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void LoadList() => dataGridViewData.DataSource = _workTimeRepositories.ReadWorkTimes(); + + private bool TryGetIdentifierFromSelectedRow(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/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormWorkTimes.resx b/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormWorkTimes.resx new file mode 100644 index 0000000..8b2ff64 --- /dev/null +++ b/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormWorkTimes.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/Accounting-Time-It-Company/Accounting-Time-It-Company/Program.cs b/Accounting-Time-It-Company/Accounting-Time-It-Company/Program.cs index e187315..0b7c290 100644 --- a/Accounting-Time-It-Company/Accounting-Time-It-Company/Program.cs +++ b/Accounting-Time-It-Company/Accounting-Time-It-Company/Program.cs @@ -27,6 +27,7 @@ namespace Accounting_Time_It_Company container.RegisterType(); container.RegisterType(); container.RegisterType(); + container.RegisterType(); return container; } } diff --git a/Accounting-Time-It-Company/Accounting-Time-It-Company/Repositories/IWorkTimeRepositories.cs b/Accounting-Time-It-Company/Accounting-Time-It-Company/Repositories/IWorkTimeRepositories.cs new file mode 100644 index 0000000..231de68 --- /dev/null +++ b/Accounting-Time-It-Company/Accounting-Time-It-Company/Repositories/IWorkTimeRepositories.cs @@ -0,0 +1,17 @@ +using Accounting_Time_It_Company.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Accounting_Time_It_Company.Repositories; + +public interface IWorkTimeRepositories +{ + IEnumerable ReadWorkTimes(DateTime? DateFrom = null, DateTime? DateTo = null, int? typeJobId = null, int? developId = null); + + void CreateWorkTime(WorkTime workTimeReplenishment); + + void DeleteWorkTime(int id); +} diff --git a/Accounting-Time-It-Company/Accounting-Time-It-Company/Repositories/Implementations/WorkTimeRepositories.cs b/Accounting-Time-It-Company/Accounting-Time-It-Company/Repositories/Implementations/WorkTimeRepositories.cs new file mode 100644 index 0000000..41ee320 --- /dev/null +++ b/Accounting-Time-It-Company/Accounting-Time-It-Company/Repositories/Implementations/WorkTimeRepositories.cs @@ -0,0 +1,24 @@ +using Accounting_Time_It_Company.Entities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Accounting_Time_It_Company.Repositories.Implementations; + +internal class WorkTimeRepositories : IWorkTimeRepositories +{ + public void CreateWorkTime(WorkTime workTimeReplenishment) + { + } + + public void DeleteWorkTime(int id) + { + } + + public IEnumerable ReadWorkTimes(DateTime? DateFrom = null, DateTime? DateTo = null, int? typeJobId = null, int? developId = null) + { + return []; + } +}