Добавил зависимость сотрудника к типу работы
This commit is contained in:
parent
90437340b3
commit
6c11146c7e
@ -4,5 +4,6 @@ public enum TypePost
|
|||||||
{
|
{
|
||||||
None = 0,
|
None = 0,
|
||||||
Developer = 1,
|
Developer = 1,
|
||||||
Manager = 2
|
Manager = 2,
|
||||||
|
Director = 3
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,8 @@ public class TypeJob
|
|||||||
|
|
||||||
public int ProductId { get; private set; }
|
public int ProductId { get; private set; }
|
||||||
|
|
||||||
|
public int Director { get; private set; }
|
||||||
|
|
||||||
public string Description { get; private set; } = string.Empty;
|
public string Description { get; private set; } = string.Empty;
|
||||||
|
|
||||||
public int AllowanceForJob { get; private set; }
|
public int AllowanceForJob { get; private set; }
|
||||||
@ -17,13 +19,14 @@ public class TypeJob
|
|||||||
|
|
||||||
public IEnumerable<WorkTime> WorkTimesManager { get; private set; } = [];
|
public IEnumerable<WorkTime> 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<WorkTime> workTimesDevelop, IEnumerable<WorkTime> workTimesManager)
|
IEnumerable<WorkTime> workTimesDevelop, IEnumerable<WorkTime> workTimesManager)
|
||||||
{
|
{
|
||||||
return new TypeJob
|
return new TypeJob
|
||||||
{
|
{
|
||||||
Id = id,
|
Id = id,
|
||||||
ProductId = productId,
|
ProductId = productId,
|
||||||
|
Director = director,
|
||||||
Description = discription,
|
Description = discription,
|
||||||
AllowanceForJob = allowanceForJob,
|
AllowanceForJob = allowanceForJob,
|
||||||
Date = DateTime.Now,
|
Date = DateTime.Now,
|
||||||
|
@ -46,6 +46,8 @@
|
|||||||
ColumnHoursMan = new DataGridViewTextBoxColumn();
|
ColumnHoursMan = new DataGridViewTextBoxColumn();
|
||||||
labelDate = new Label();
|
labelDate = new Label();
|
||||||
dateTimePickerDate = new DateTimePicker();
|
dateTimePickerDate = new DateTimePicker();
|
||||||
|
comboBoxDirector = new ComboBox();
|
||||||
|
labelDirector = new Label();
|
||||||
((System.ComponentModel.ISupportInitialize)numericUpDownAllowanceForJob).BeginInit();
|
((System.ComponentModel.ISupportInitialize)numericUpDownAllowanceForJob).BeginInit();
|
||||||
groupBoxDevelops.SuspendLayout();
|
groupBoxDevelops.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridViewDevelops).BeginInit();
|
((System.ComponentModel.ISupportInitialize)dataGridViewDevelops).BeginInit();
|
||||||
@ -64,7 +66,7 @@
|
|||||||
//
|
//
|
||||||
// textBoxDescriptoin
|
// textBoxDescriptoin
|
||||||
//
|
//
|
||||||
textBoxDescriptoin.Location = new Point(178, 54);
|
textBoxDescriptoin.Location = new Point(178, 89);
|
||||||
textBoxDescriptoin.Name = "textBoxDescriptoin";
|
textBoxDescriptoin.Name = "textBoxDescriptoin";
|
||||||
textBoxDescriptoin.Size = new Size(203, 27);
|
textBoxDescriptoin.Size = new Size(203, 27);
|
||||||
textBoxDescriptoin.TabIndex = 1;
|
textBoxDescriptoin.TabIndex = 1;
|
||||||
@ -80,7 +82,7 @@
|
|||||||
//
|
//
|
||||||
// numericUpDownAllowanceForJob
|
// numericUpDownAllowanceForJob
|
||||||
//
|
//
|
||||||
numericUpDownAllowanceForJob.Location = new Point(179, 87);
|
numericUpDownAllowanceForJob.Location = new Point(179, 122);
|
||||||
numericUpDownAllowanceForJob.Maximum = new decimal(new int[] { 1000, 0, 0, 0 });
|
numericUpDownAllowanceForJob.Maximum = new decimal(new int[] { 1000, 0, 0, 0 });
|
||||||
numericUpDownAllowanceForJob.Name = "numericUpDownAllowanceForJob";
|
numericUpDownAllowanceForJob.Name = "numericUpDownAllowanceForJob";
|
||||||
numericUpDownAllowanceForJob.Size = new Size(202, 27);
|
numericUpDownAllowanceForJob.Size = new Size(202, 27);
|
||||||
@ -89,7 +91,7 @@
|
|||||||
// labelDescriptoin
|
// labelDescriptoin
|
||||||
//
|
//
|
||||||
labelDescriptoin.AutoSize = true;
|
labelDescriptoin.AutoSize = true;
|
||||||
labelDescriptoin.Location = new Point(22, 57);
|
labelDescriptoin.Location = new Point(22, 92);
|
||||||
labelDescriptoin.Name = "labelDescriptoin";
|
labelDescriptoin.Name = "labelDescriptoin";
|
||||||
labelDescriptoin.Size = new Size(138, 20);
|
labelDescriptoin.Size = new Size(138, 20);
|
||||||
labelDescriptoin.TabIndex = 6;
|
labelDescriptoin.TabIndex = 6;
|
||||||
@ -98,7 +100,7 @@
|
|||||||
// labelAllowanceForJob
|
// labelAllowanceForJob
|
||||||
//
|
//
|
||||||
labelAllowanceForJob.AutoSize = true;
|
labelAllowanceForJob.AutoSize = true;
|
||||||
labelAllowanceForJob.Location = new Point(22, 89);
|
labelAllowanceForJob.Location = new Point(22, 124);
|
||||||
labelAllowanceForJob.Name = "labelAllowanceForJob";
|
labelAllowanceForJob.Name = "labelAllowanceForJob";
|
||||||
labelAllowanceForJob.Size = new Size(150, 20);
|
labelAllowanceForJob.Size = new Size(150, 20);
|
||||||
labelAllowanceForJob.TabIndex = 7;
|
labelAllowanceForJob.TabIndex = 7;
|
||||||
@ -106,7 +108,7 @@
|
|||||||
//
|
//
|
||||||
// buttonCansle
|
// buttonCansle
|
||||||
//
|
//
|
||||||
buttonCansle.Location = new Point(289, 557);
|
buttonCansle.Location = new Point(287, 577);
|
||||||
buttonCansle.Name = "buttonCansle";
|
buttonCansle.Name = "buttonCansle";
|
||||||
buttonCansle.Size = new Size(94, 29);
|
buttonCansle.Size = new Size(94, 29);
|
||||||
buttonCansle.TabIndex = 11;
|
buttonCansle.TabIndex = 11;
|
||||||
@ -116,7 +118,7 @@
|
|||||||
//
|
//
|
||||||
// buttonSave
|
// buttonSave
|
||||||
//
|
//
|
||||||
buttonSave.Location = new Point(179, 557);
|
buttonSave.Location = new Point(177, 577);
|
||||||
buttonSave.Name = "buttonSave";
|
buttonSave.Name = "buttonSave";
|
||||||
buttonSave.Size = new Size(94, 29);
|
buttonSave.Size = new Size(94, 29);
|
||||||
buttonSave.TabIndex = 10;
|
buttonSave.TabIndex = 10;
|
||||||
@ -128,9 +130,9 @@
|
|||||||
//
|
//
|
||||||
groupBoxDevelops.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
groupBoxDevelops.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
groupBoxDevelops.Controls.Add(dataGridViewDevelops);
|
groupBoxDevelops.Controls.Add(dataGridViewDevelops);
|
||||||
groupBoxDevelops.Location = new Point(26, 165);
|
groupBoxDevelops.Location = new Point(26, 188);
|
||||||
groupBoxDevelops.Name = "groupBoxDevelops";
|
groupBoxDevelops.Name = "groupBoxDevelops";
|
||||||
groupBoxDevelops.Size = new Size(358, 167);
|
groupBoxDevelops.Size = new Size(358, 183);
|
||||||
groupBoxDevelops.TabIndex = 12;
|
groupBoxDevelops.TabIndex = 12;
|
||||||
groupBoxDevelops.TabStop = false;
|
groupBoxDevelops.TabStop = false;
|
||||||
groupBoxDevelops.Text = "Разработчики";
|
groupBoxDevelops.Text = "Разработчики";
|
||||||
@ -167,9 +169,9 @@
|
|||||||
//
|
//
|
||||||
groupBoxManagers.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
groupBoxManagers.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
groupBoxManagers.Controls.Add(dataGridViewManagers);
|
groupBoxManagers.Controls.Add(dataGridViewManagers);
|
||||||
groupBoxManagers.Location = new Point(26, 352);
|
groupBoxManagers.Location = new Point(26, 377);
|
||||||
groupBoxManagers.Name = "groupBoxManagers";
|
groupBoxManagers.Name = "groupBoxManagers";
|
||||||
groupBoxManagers.Size = new Size(358, 168);
|
groupBoxManagers.Size = new Size(358, 182);
|
||||||
groupBoxManagers.TabIndex = 13;
|
groupBoxManagers.TabIndex = 13;
|
||||||
groupBoxManagers.TabStop = false;
|
groupBoxManagers.TabStop = false;
|
||||||
groupBoxManagers.Text = "Менеджеры";
|
groupBoxManagers.Text = "Менеджеры";
|
||||||
@ -188,7 +190,7 @@
|
|||||||
dataGridViewManagers.RowHeadersVisible = false;
|
dataGridViewManagers.RowHeadersVisible = false;
|
||||||
dataGridViewManagers.RowHeadersWidth = 51;
|
dataGridViewManagers.RowHeadersWidth = 51;
|
||||||
dataGridViewManagers.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
dataGridViewManagers.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||||
dataGridViewManagers.Size = new Size(352, 142);
|
dataGridViewManagers.Size = new Size(352, 156);
|
||||||
dataGridViewManagers.TabIndex = 9;
|
dataGridViewManagers.TabIndex = 9;
|
||||||
//
|
//
|
||||||
// ColumnManager
|
// ColumnManager
|
||||||
@ -206,7 +208,7 @@
|
|||||||
// labelDate
|
// labelDate
|
||||||
//
|
//
|
||||||
labelDate.AutoSize = true;
|
labelDate.AutoSize = true;
|
||||||
labelDate.Location = new Point(22, 125);
|
labelDate.Location = new Point(22, 160);
|
||||||
labelDate.Name = "labelDate";
|
labelDate.Name = "labelDate";
|
||||||
labelDate.Size = new Size(44, 20);
|
labelDate.Size = new Size(44, 20);
|
||||||
labelDate.TabIndex = 14;
|
labelDate.TabIndex = 14;
|
||||||
@ -215,16 +217,36 @@
|
|||||||
// dateTimePickerDate
|
// dateTimePickerDate
|
||||||
//
|
//
|
||||||
dateTimePickerDate.Enabled = false;
|
dateTimePickerDate.Enabled = false;
|
||||||
dateTimePickerDate.Location = new Point(178, 120);
|
dateTimePickerDate.Location = new Point(178, 155);
|
||||||
dateTimePickerDate.Name = "dateTimePickerDate";
|
dateTimePickerDate.Name = "dateTimePickerDate";
|
||||||
dateTimePickerDate.Size = new Size(206, 27);
|
dateTimePickerDate.Size = new Size(206, 27);
|
||||||
dateTimePickerDate.TabIndex = 15;
|
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
|
// FormTypeJob
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
ClientSize = new Size(391, 598);
|
ClientSize = new Size(391, 717);
|
||||||
|
Controls.Add(comboBoxDirector);
|
||||||
|
Controls.Add(labelDirector);
|
||||||
Controls.Add(dateTimePickerDate);
|
Controls.Add(dateTimePickerDate);
|
||||||
Controls.Add(labelDate);
|
Controls.Add(labelDate);
|
||||||
Controls.Add(groupBoxManagers);
|
Controls.Add(groupBoxManagers);
|
||||||
@ -269,5 +291,7 @@
|
|||||||
private DataGridViewTextBoxColumn ColumnHoursDev;
|
private DataGridViewTextBoxColumn ColumnHoursDev;
|
||||||
private DataGridViewComboBoxColumn ColumnManager;
|
private DataGridViewComboBoxColumn ColumnManager;
|
||||||
private DataGridViewTextBoxColumn ColumnHoursMan;
|
private DataGridViewTextBoxColumn ColumnHoursMan;
|
||||||
|
private ComboBox comboBoxDirector;
|
||||||
|
private Label labelDirector;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -19,6 +19,10 @@ namespace Accounting_Time_It_Company.Forms
|
|||||||
comboBoxProduct.DisplayMember = "Name";
|
comboBoxProduct.DisplayMember = "Name";
|
||||||
comboBoxProduct.ValueMember = "Id";
|
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.DataSource = employeeRepositories.ReadEmployees().Where(x => x.PostId == (int)TypePost.Developer).ToList();
|
||||||
ColumnDevelop.DisplayMember = "Name";
|
ColumnDevelop.DisplayMember = "Name";
|
||||||
ColumnDevelop.ValueMember = "Id";
|
ColumnDevelop.ValueMember = "Id";
|
||||||
@ -38,7 +42,7 @@ namespace Accounting_Time_It_Company.Forms
|
|||||||
throw new Exception("Имеются незаполненные поля");
|
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),
|
(int)numericUpDownAllowanceForJob.Value, CreateListWorkTimeFromDataGrid(dataGridViewDevelops),
|
||||||
CreateListWorkTimeFromDataGrid(dataGridViewManagers)));
|
CreateListWorkTimeFromDataGrid(dataGridViewManagers)));
|
||||||
|
|
||||||
|
@ -123,6 +123,18 @@
|
|||||||
<metadata name="ColumnHoursDev.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="ColumnHoursDev.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
<metadata name="ColumnDevelop.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="ColumnHoursDev.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="ColumnManager.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="ColumnHoursMan.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
<metadata name="ColumnManager.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="ColumnManager.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
@ -4,7 +4,7 @@ namespace Accounting_Time_It_Company.Repositories;
|
|||||||
|
|
||||||
public interface ITypeJobRepositories
|
public interface ITypeJobRepositories
|
||||||
{
|
{
|
||||||
IEnumerable<TypeJob> ReadTypeJobs(int? productId = null, int? developId = null, int? managerId = null);
|
IEnumerable<TypeJob> ReadTypeJobs(DateTime? dateFrom = null, DateTime? dateTo = null, int? productId = null, int? directorId = null);
|
||||||
|
|
||||||
void CreateTypeJob(TypeJob typeJob);
|
void CreateTypeJob(TypeJob typeJob);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user