From 6c11146c7e187538543a2b94827421b04955899c Mon Sep 17 00:00:00 2001 From: Pipiaka Date: Sat, 14 Dec 2024 19:47:23 +0400 Subject: [PATCH 1/4] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=20=D0=B7=D0=B0=D0=B2=D0=B8=D1=81=D0=B8=D0=BC=D0=BE=D1=81=D1=82?= =?UTF-8?q?=D1=8C=20=D1=81=D0=BE=D1=82=D1=80=D1=83=D0=B4=D0=BD=D0=B8=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BA=20=D1=82=D0=B8=D0=BF=D1=83=20=D1=80=D0=B0=D0=B1?= =?UTF-8?q?=D0=BE=D1=82=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/Enums/TypePost.cs | 3 +- .../Entities/TypeJob.cs | 5 +- .../Forms/FormTypeJob.Designer.cs | 52 ++++++++++++++----- .../Forms/FormTypeJob.cs | 6 ++- .../Forms/FormTypeJob.resx | 12 +++++ .../Repositories/ITypeJobRepositories.cs | 2 +- 6 files changed, 62 insertions(+), 18 deletions(-) diff --git a/Accounting-Time-It-Company/Accounting-Time-It-Company/Entities/Enums/TypePost.cs b/Accounting-Time-It-Company/Accounting-Time-It-Company/Entities/Enums/TypePost.cs index d6647d6..a2196d6 100644 --- a/Accounting-Time-It-Company/Accounting-Time-It-Company/Entities/Enums/TypePost.cs +++ b/Accounting-Time-It-Company/Accounting-Time-It-Company/Entities/Enums/TypePost.cs @@ -4,5 +4,6 @@ public enum TypePost { None = 0, Developer = 1, - Manager = 2 + Manager = 2, + Director = 3 } diff --git a/Accounting-Time-It-Company/Accounting-Time-It-Company/Entities/TypeJob.cs b/Accounting-Time-It-Company/Accounting-Time-It-Company/Entities/TypeJob.cs index ac57111..84379ab 100644 --- a/Accounting-Time-It-Company/Accounting-Time-It-Company/Entities/TypeJob.cs +++ b/Accounting-Time-It-Company/Accounting-Time-It-Company/Entities/TypeJob.cs @@ -7,6 +7,8 @@ public class TypeJob public int ProductId { get; private set; } + public int Director { get; private set; } + public string Description { get; private set; } = string.Empty; public int AllowanceForJob { get; private set; } @@ -17,13 +19,14 @@ public class TypeJob public IEnumerable WorkTimesManager { get; private set; } = []; - public static TypeJob CreateOperation(int id, int productId, string discription, int allowanceForJob, + public static TypeJob CreateOperation(int id, int productId, int director, string discription, int allowanceForJob, IEnumerable workTimesDevelop, IEnumerable workTimesManager) { return new TypeJob { Id = id, ProductId = productId, + Director = director, Description = discription, AllowanceForJob = allowanceForJob, Date = DateTime.Now, diff --git a/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormTypeJob.Designer.cs b/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormTypeJob.Designer.cs index e211215..2519a40 100644 --- a/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormTypeJob.Designer.cs +++ b/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormTypeJob.Designer.cs @@ -46,6 +46,8 @@ ColumnHoursMan = new DataGridViewTextBoxColumn(); labelDate = new Label(); dateTimePickerDate = new DateTimePicker(); + comboBoxDirector = new ComboBox(); + labelDirector = new Label(); ((System.ComponentModel.ISupportInitialize)numericUpDownAllowanceForJob).BeginInit(); groupBoxDevelops.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)dataGridViewDevelops).BeginInit(); @@ -64,7 +66,7 @@ // // textBoxDescriptoin // - textBoxDescriptoin.Location = new Point(178, 54); + textBoxDescriptoin.Location = new Point(178, 89); textBoxDescriptoin.Name = "textBoxDescriptoin"; textBoxDescriptoin.Size = new Size(203, 27); textBoxDescriptoin.TabIndex = 1; @@ -80,7 +82,7 @@ // // numericUpDownAllowanceForJob // - numericUpDownAllowanceForJob.Location = new Point(179, 87); + numericUpDownAllowanceForJob.Location = new Point(179, 122); numericUpDownAllowanceForJob.Maximum = new decimal(new int[] { 1000, 0, 0, 0 }); numericUpDownAllowanceForJob.Name = "numericUpDownAllowanceForJob"; numericUpDownAllowanceForJob.Size = new Size(202, 27); @@ -89,7 +91,7 @@ // labelDescriptoin // labelDescriptoin.AutoSize = true; - labelDescriptoin.Location = new Point(22, 57); + labelDescriptoin.Location = new Point(22, 92); labelDescriptoin.Name = "labelDescriptoin"; labelDescriptoin.Size = new Size(138, 20); labelDescriptoin.TabIndex = 6; @@ -98,7 +100,7 @@ // labelAllowanceForJob // labelAllowanceForJob.AutoSize = true; - labelAllowanceForJob.Location = new Point(22, 89); + labelAllowanceForJob.Location = new Point(22, 124); labelAllowanceForJob.Name = "labelAllowanceForJob"; labelAllowanceForJob.Size = new Size(150, 20); labelAllowanceForJob.TabIndex = 7; @@ -106,7 +108,7 @@ // // buttonCansle // - buttonCansle.Location = new Point(289, 557); + buttonCansle.Location = new Point(287, 577); buttonCansle.Name = "buttonCansle"; buttonCansle.Size = new Size(94, 29); buttonCansle.TabIndex = 11; @@ -116,7 +118,7 @@ // // buttonSave // - buttonSave.Location = new Point(179, 557); + buttonSave.Location = new Point(177, 577); buttonSave.Name = "buttonSave"; buttonSave.Size = new Size(94, 29); buttonSave.TabIndex = 10; @@ -128,9 +130,9 @@ // groupBoxDevelops.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; groupBoxDevelops.Controls.Add(dataGridViewDevelops); - groupBoxDevelops.Location = new Point(26, 165); + groupBoxDevelops.Location = new Point(26, 188); groupBoxDevelops.Name = "groupBoxDevelops"; - groupBoxDevelops.Size = new Size(358, 167); + groupBoxDevelops.Size = new Size(358, 183); groupBoxDevelops.TabIndex = 12; groupBoxDevelops.TabStop = false; groupBoxDevelops.Text = "Разработчики"; @@ -167,9 +169,9 @@ // groupBoxManagers.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; groupBoxManagers.Controls.Add(dataGridViewManagers); - groupBoxManagers.Location = new Point(26, 352); + groupBoxManagers.Location = new Point(26, 377); groupBoxManagers.Name = "groupBoxManagers"; - groupBoxManagers.Size = new Size(358, 168); + groupBoxManagers.Size = new Size(358, 182); groupBoxManagers.TabIndex = 13; groupBoxManagers.TabStop = false; groupBoxManagers.Text = "Менеджеры"; @@ -188,7 +190,7 @@ dataGridViewManagers.RowHeadersVisible = false; dataGridViewManagers.RowHeadersWidth = 51; dataGridViewManagers.SelectionMode = DataGridViewSelectionMode.FullRowSelect; - dataGridViewManagers.Size = new Size(352, 142); + dataGridViewManagers.Size = new Size(352, 156); dataGridViewManagers.TabIndex = 9; // // ColumnManager @@ -206,7 +208,7 @@ // labelDate // labelDate.AutoSize = true; - labelDate.Location = new Point(22, 125); + labelDate.Location = new Point(22, 160); labelDate.Name = "labelDate"; labelDate.Size = new Size(44, 20); labelDate.TabIndex = 14; @@ -215,16 +217,36 @@ // dateTimePickerDate // dateTimePickerDate.Enabled = false; - dateTimePickerDate.Location = new Point(178, 120); + dateTimePickerDate.Location = new Point(178, 155); dateTimePickerDate.Name = "dateTimePickerDate"; dateTimePickerDate.Size = new Size(206, 27); dateTimePickerDate.TabIndex = 15; // + // comboBoxDirector + // + comboBoxDirector.DropDownStyle = ComboBoxStyle.DropDownList; + comboBoxDirector.FormattingEnabled = true; + comboBoxDirector.Location = new Point(178, 55); + comboBoxDirector.Name = "comboBoxDirector"; + comboBoxDirector.Size = new Size(203, 28); + comboBoxDirector.TabIndex = 17; + // + // labelDirector + // + labelDirector.AutoSize = true; + labelDirector.Location = new Point(22, 58); + labelDirector.Name = "labelDirector"; + labelDirector.Size = new Size(76, 20); + labelDirector.TabIndex = 16; + labelDirector.Text = "Директор"; + // // FormTypeJob // AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(391, 598); + ClientSize = new Size(391, 717); + Controls.Add(comboBoxDirector); + Controls.Add(labelDirector); Controls.Add(dateTimePickerDate); Controls.Add(labelDate); Controls.Add(groupBoxManagers); @@ -269,5 +291,7 @@ private DataGridViewTextBoxColumn ColumnHoursDev; private DataGridViewComboBoxColumn ColumnManager; private DataGridViewTextBoxColumn ColumnHoursMan; + private ComboBox comboBoxDirector; + private Label labelDirector; } } \ No newline at end of file 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 8c1e723..f7e33db 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 @@ -19,6 +19,10 @@ namespace Accounting_Time_It_Company.Forms comboBoxProduct.DisplayMember = "Name"; comboBoxProduct.ValueMember = "Id"; + comboBoxDirector.DataSource = employeeRepositories.ReadEmployees(); + comboBoxDirector.DisplayMember = "Name"; + comboBoxDirector.ValueMember = "Id"; + ColumnDevelop.DataSource = employeeRepositories.ReadEmployees().Where(x => x.PostId == (int)TypePost.Developer).ToList(); ColumnDevelop.DisplayMember = "Name"; ColumnDevelop.ValueMember = "Id"; @@ -38,7 +42,7 @@ namespace Accounting_Time_It_Company.Forms throw new Exception("Имеются незаполненные поля"); } - _typeJobRepositories.CreateTypeJob(TypeJob.CreateOperation(0, (int)comboBoxProduct.SelectedIndex!, textBoxDescriptoin.Text, + _typeJobRepositories.CreateTypeJob(TypeJob.CreateOperation(0, (int)comboBoxProduct.SelectedIndex!, comboBoxDirector.SelectedIndex!, textBoxDescriptoin.Text, (int)numericUpDownAllowanceForJob.Value, CreateListWorkTimeFromDataGrid(dataGridViewDevelops), CreateListWorkTimeFromDataGrid(dataGridViewManagers))); diff --git a/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormTypeJob.resx b/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormTypeJob.resx index 1e111df..3b58439 100644 --- a/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormTypeJob.resx +++ b/Accounting-Time-It-Company/Accounting-Time-It-Company/Forms/FormTypeJob.resx @@ -123,6 +123,18 @@ True + + True + + + True + + + True + + + True + True diff --git a/Accounting-Time-It-Company/Accounting-Time-It-Company/Repositories/ITypeJobRepositories.cs b/Accounting-Time-It-Company/Accounting-Time-It-Company/Repositories/ITypeJobRepositories.cs index 0ed33b6..cdf0286 100644 --- a/Accounting-Time-It-Company/Accounting-Time-It-Company/Repositories/ITypeJobRepositories.cs +++ b/Accounting-Time-It-Company/Accounting-Time-It-Company/Repositories/ITypeJobRepositories.cs @@ -4,7 +4,7 @@ namespace Accounting_Time_It_Company.Repositories; public interface ITypeJobRepositories { - IEnumerable ReadTypeJobs(int? productId = null, int? developId = null, int? managerId = null); + IEnumerable ReadTypeJobs(DateTime? dateFrom = null, DateTime? dateTo = null, int? productId = null, int? directorId = null); void CreateTypeJob(TypeJob typeJob); From d8e396a649b01476753680b7315087eb8edc2d85 Mon Sep 17 00:00:00 2001 From: Pipiaka Date: Sat, 14 Dec 2024 19:57:12 +0400 Subject: [PATCH 2/4] =?UTF-8?q?=D0=94=D0=B8=D1=87=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Accounting-Time-It-Company/Forms/FormTypeJob.cs | 2 +- .../Repositories/Implementations/TypeJobRepositories.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 f7e33db..1796474 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 @@ -19,7 +19,7 @@ namespace Accounting_Time_It_Company.Forms comboBoxProduct.DisplayMember = "Name"; comboBoxProduct.ValueMember = "Id"; - comboBoxDirector.DataSource = employeeRepositories.ReadEmployees(); + comboBoxDirector.DataSource = employeeRepositories.ReadEmployees().Where(x => x.PostId == (int)TypePost.Director).ToList(); comboBoxDirector.DisplayMember = "Name"; comboBoxDirector.ValueMember = "Id"; diff --git a/Accounting-Time-It-Company/Accounting-Time-It-Company/Repositories/Implementations/TypeJobRepositories.cs b/Accounting-Time-It-Company/Accounting-Time-It-Company/Repositories/Implementations/TypeJobRepositories.cs index 9d64613..13d4598 100644 --- a/Accounting-Time-It-Company/Accounting-Time-It-Company/Repositories/Implementations/TypeJobRepositories.cs +++ b/Accounting-Time-It-Company/Accounting-Time-It-Company/Repositories/Implementations/TypeJobRepositories.cs @@ -12,7 +12,7 @@ public class TypeJobRepositories : ITypeJobRepositories { } - public IEnumerable ReadTypeJobs(int? productId = null, int? developId = null, int? managerId = null) + public IEnumerable ReadTypeJobs(DateTime? dateFrom = null, DateTime? dateTo = null, int? productId = null, int? directorId = null) { return []; } From ab55cec4ef28dfb89ecc7666c2464323d5519013 Mon Sep 17 00:00:00 2001 From: Pipiaka Date: Sat, 14 Dec 2024 19:59:25 +0400 Subject: [PATCH 3/4] =?UTF-8?q?=D0=90=D0=90=D0=90=D0=90=D0=90=D0=90=D0=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Accounting-Time-It-Company/Forms/FormTypeJob.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 1796474..2b77951 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 @@ -42,7 +42,7 @@ namespace Accounting_Time_It_Company.Forms throw new Exception("Имеются незаполненные поля"); } - _typeJobRepositories.CreateTypeJob(TypeJob.CreateOperation(0, (int)comboBoxProduct.SelectedIndex!, comboBoxDirector.SelectedIndex!, textBoxDescriptoin.Text, + _typeJobRepositories.CreateTypeJob(TypeJob.CreateOperation(0, (int)comboBoxProduct.SelectedValue!, comboBoxDirector.SelectedValue!, textBoxDescriptoin.Text, (int)numericUpDownAllowanceForJob.Value, CreateListWorkTimeFromDataGrid(dataGridViewDevelops), CreateListWorkTimeFromDataGrid(dataGridViewManagers))); From fe2dc84b658a9bb41c8f15b6f6d1e2f29eeaa6fe Mon Sep 17 00:00:00 2001 From: Pipiaka Date: Sat, 14 Dec 2024 19:59:45 +0400 Subject: [PATCH 4/4] =?UTF-8?q?=D0=90=D0=90=D0=90=D0=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Accounting-Time-It-Company/Forms/FormTypeJob.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 2b77951..d055226 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 @@ -42,7 +42,7 @@ namespace Accounting_Time_It_Company.Forms throw new Exception("Имеются незаполненные поля"); } - _typeJobRepositories.CreateTypeJob(TypeJob.CreateOperation(0, (int)comboBoxProduct.SelectedValue!, comboBoxDirector.SelectedValue!, textBoxDescriptoin.Text, + _typeJobRepositories.CreateTypeJob(TypeJob.CreateOperation(0, (int)comboBoxProduct.SelectedValue!, (int)comboBoxDirector.SelectedValue!, textBoxDescriptoin.Text, (int)numericUpDownAllowanceForJob.Value, CreateListWorkTimeFromDataGrid(dataGridViewDevelops), CreateListWorkTimeFromDataGrid(dataGridViewManagers)));