Lab2
This commit is contained in:
parent
38b550bb97
commit
9847c6fd9a
@ -12,7 +12,7 @@ public class Contract
|
|||||||
public int Id { get; private set; }
|
public int Id { get; private set; }
|
||||||
public DateTime Date { get; private set; }
|
public DateTime Date { get; private set; }
|
||||||
public decimal ProjectId { get; private set; }
|
public decimal ProjectId { get; private set; }
|
||||||
public IEnumerable<CustomerOnProject> CustomerId
|
public IEnumerable<CustomerOnProject> CustomerOnContract
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
private set;
|
private set;
|
||||||
@ -25,7 +25,7 @@ public class Contract
|
|||||||
Id = id,
|
Id = id,
|
||||||
Date = date,
|
Date = date,
|
||||||
ProjectId = projectid,
|
ProjectId = projectid,
|
||||||
CustomerId = customerOnContract
|
CustomerOnContract = customerOnContract
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,17 +10,17 @@ namespace ProjectItCompany.Entities;
|
|||||||
public class CustomerOnProject
|
public class CustomerOnProject
|
||||||
{
|
{
|
||||||
public int Id { get; private set; }
|
public int Id { get; private set; }
|
||||||
public decimal ContractId { get; private set; }
|
public int ContractId { get; private set; }
|
||||||
public decimal CustomerId { get; private set; }
|
public int CustomerId { get; private set; }
|
||||||
public string Description { get; private set; } = string.Empty;
|
public string Description { get; private set; } = string.Empty;
|
||||||
public static CustomerOnProject CreateElement(int id, decimal contractId, decimal customerid, string description)
|
public static CustomerOnProject CreateElement(int id, int contractId, int customerid, string descriptio)
|
||||||
{
|
{
|
||||||
return new CustomerOnProject
|
return new CustomerOnProject
|
||||||
{
|
{
|
||||||
Id = id,
|
Id = id,
|
||||||
ContractId = contractId,
|
ContractId = contractId,
|
||||||
CustomerId = customerid,
|
CustomerId = customerid,
|
||||||
Description = description
|
Description = descriptio
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,15 +32,17 @@
|
|||||||
ButtonCancel = new Button();
|
ButtonCancel = new Button();
|
||||||
groupBoxContract = new GroupBox();
|
groupBoxContract = new GroupBox();
|
||||||
dataGridViewContract = new DataGridView();
|
dataGridViewContract = new DataGridView();
|
||||||
ColumnProject = new DataGridViewComboBoxColumn();
|
labelProject = new Label();
|
||||||
|
comboBoxProject = new ComboBox();
|
||||||
ColumnCustomer = new DataGridViewComboBoxColumn();
|
ColumnCustomer = new DataGridViewComboBoxColumn();
|
||||||
|
ColumnDescription = new DataGridViewTextBoxColumn();
|
||||||
groupBoxContract.SuspendLayout();
|
groupBoxContract.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridViewContract).BeginInit();
|
((System.ComponentModel.ISupportInitialize)dataGridViewContract).BeginInit();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
// ButtonSave
|
// ButtonSave
|
||||||
//
|
//
|
||||||
ButtonSave.Location = new Point(68, 254);
|
ButtonSave.Location = new Point(68, 294);
|
||||||
ButtonSave.Name = "ButtonSave";
|
ButtonSave.Name = "ButtonSave";
|
||||||
ButtonSave.Size = new Size(75, 23);
|
ButtonSave.Size = new Size(75, 23);
|
||||||
ButtonSave.TabIndex = 11;
|
ButtonSave.TabIndex = 11;
|
||||||
@ -50,7 +52,7 @@
|
|||||||
//
|
//
|
||||||
// ButtonCancel
|
// ButtonCancel
|
||||||
//
|
//
|
||||||
ButtonCancel.Location = new Point(245, 255);
|
ButtonCancel.Location = new Point(245, 293);
|
||||||
ButtonCancel.Name = "ButtonCancel";
|
ButtonCancel.Name = "ButtonCancel";
|
||||||
ButtonCancel.Size = new Size(75, 23);
|
ButtonCancel.Size = new Size(75, 23);
|
||||||
ButtonCancel.TabIndex = 12;
|
ButtonCancel.TabIndex = 12;
|
||||||
@ -61,7 +63,7 @@
|
|||||||
// groupBoxContract
|
// groupBoxContract
|
||||||
//
|
//
|
||||||
groupBoxContract.Controls.Add(dataGridViewContract);
|
groupBoxContract.Controls.Add(dataGridViewContract);
|
||||||
groupBoxContract.Location = new Point(12, 12);
|
groupBoxContract.Location = new Point(12, 43);
|
||||||
groupBoxContract.Name = "groupBoxContract";
|
groupBoxContract.Name = "groupBoxContract";
|
||||||
groupBoxContract.Size = new Size(375, 237);
|
groupBoxContract.Size = new Size(375, 237);
|
||||||
groupBoxContract.TabIndex = 13;
|
groupBoxContract.TabIndex = 13;
|
||||||
@ -74,7 +76,7 @@
|
|||||||
dataGridViewContract.AllowUserToResizeRows = false;
|
dataGridViewContract.AllowUserToResizeRows = false;
|
||||||
dataGridViewContract.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
dataGridViewContract.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
||||||
dataGridViewContract.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
dataGridViewContract.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
dataGridViewContract.Columns.AddRange(new DataGridViewColumn[] { ColumnProject, ColumnCustomer });
|
dataGridViewContract.Columns.AddRange(new DataGridViewColumn[] { ColumnCustomer, ColumnDescription });
|
||||||
dataGridViewContract.Dock = DockStyle.Right;
|
dataGridViewContract.Dock = DockStyle.Right;
|
||||||
dataGridViewContract.Location = new Point(3, 19);
|
dataGridViewContract.Location = new Point(3, 19);
|
||||||
dataGridViewContract.MultiSelect = false;
|
dataGridViewContract.MultiSelect = false;
|
||||||
@ -85,21 +87,42 @@
|
|||||||
dataGridViewContract.Size = new Size(369, 215);
|
dataGridViewContract.Size = new Size(369, 215);
|
||||||
dataGridViewContract.TabIndex = 0;
|
dataGridViewContract.TabIndex = 0;
|
||||||
//
|
//
|
||||||
// ColumnProject
|
// labelProject
|
||||||
//
|
//
|
||||||
ColumnProject.HeaderText = "Проект";
|
labelProject.AutoSize = true;
|
||||||
ColumnProject.Name = "ColumnProject";
|
labelProject.Location = new Point(15, 17);
|
||||||
|
labelProject.Name = "labelProject";
|
||||||
|
labelProject.Size = new Size(47, 15);
|
||||||
|
labelProject.TabIndex = 14;
|
||||||
|
labelProject.Text = "Проект";
|
||||||
|
//
|
||||||
|
// comboBoxProject
|
||||||
|
//
|
||||||
|
comboBoxProject.FormattingEnabled = true;
|
||||||
|
comboBoxProject.Location = new Point(96, 14);
|
||||||
|
comboBoxProject.Name = "comboBoxProject";
|
||||||
|
comboBoxProject.Size = new Size(224, 23);
|
||||||
|
comboBoxProject.TabIndex = 15;
|
||||||
//
|
//
|
||||||
// ColumnCustomer
|
// ColumnCustomer
|
||||||
//
|
//
|
||||||
ColumnCustomer.HeaderText = "Заказчик";
|
ColumnCustomer.HeaderText = "Заказчик";
|
||||||
ColumnCustomer.Name = "ColumnCustomer";
|
ColumnCustomer.Name = "ColumnCustomer";
|
||||||
//
|
//
|
||||||
|
// ColumnDescription
|
||||||
|
//
|
||||||
|
ColumnDescription.HeaderText = "Описание";
|
||||||
|
ColumnDescription.Name = "ColumnDescription";
|
||||||
|
ColumnDescription.Resizable = DataGridViewTriState.True;
|
||||||
|
ColumnDescription.SortMode = DataGridViewColumnSortMode.NotSortable;
|
||||||
|
//
|
||||||
// FormContract
|
// FormContract
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
ClientSize = new Size(399, 286);
|
ClientSize = new Size(399, 331);
|
||||||
|
Controls.Add(comboBoxProject);
|
||||||
|
Controls.Add(labelProject);
|
||||||
Controls.Add(groupBoxContract);
|
Controls.Add(groupBoxContract);
|
||||||
Controls.Add(ButtonCancel);
|
Controls.Add(ButtonCancel);
|
||||||
Controls.Add(ButtonSave);
|
Controls.Add(ButtonSave);
|
||||||
@ -109,6 +132,7 @@
|
|||||||
groupBoxContract.ResumeLayout(false);
|
groupBoxContract.ResumeLayout(false);
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridViewContract).EndInit();
|
((System.ComponentModel.ISupportInitialize)dataGridViewContract).EndInit();
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
|
PerformLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -120,7 +144,9 @@
|
|||||||
private Button ButtonCancel;
|
private Button ButtonCancel;
|
||||||
private GroupBox groupBoxContract;
|
private GroupBox groupBoxContract;
|
||||||
private DataGridView dataGridViewContract;
|
private DataGridView dataGridViewContract;
|
||||||
private DataGridViewComboBoxColumn ColumnProject;
|
private Label labelProject;
|
||||||
|
private ComboBox comboBoxProject;
|
||||||
private DataGridViewComboBoxColumn ColumnCustomer;
|
private DataGridViewComboBoxColumn ColumnCustomer;
|
||||||
|
private DataGridViewTextBoxColumn ColumnDescription;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -24,9 +24,9 @@ namespace ProjectItCompany.Forms
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
_contractRepository = contractRepository ?? throw new ArgumentNullException(nameof(contractRepository));
|
_contractRepository = contractRepository ?? throw new ArgumentNullException(nameof(contractRepository));
|
||||||
|
|
||||||
ColumnProject.DataSource = projectRepository.ReadProjects();
|
comboBoxProject.DataSource = projectRepository.ReadProjects();
|
||||||
ColumnProject.DisplayMember = "NameProject";
|
comboBoxProject.DisplayMember = "NameProject";
|
||||||
ColumnProject.ValueMember = "Id";
|
comboBoxProject.ValueMember = "Id";
|
||||||
|
|
||||||
ColumnCustomer.DataSource = customerRepository.ReadCustomers();
|
ColumnCustomer.DataSource = customerRepository.ReadCustomers();
|
||||||
ColumnCustomer.DisplayMember = "NameCustomer";
|
ColumnCustomer.DisplayMember = "NameCustomer";
|
||||||
@ -41,7 +41,7 @@ namespace ProjectItCompany.Forms
|
|||||||
{
|
{
|
||||||
throw new Exception("Имеются незаполненные поля");
|
throw new Exception("Имеются незаполненные поля");
|
||||||
}
|
}
|
||||||
_contractRepository.CreateContract(Contract.CreateOpeartion(0, DateTime.Now, 0, CreateListExecutorOnProject()));
|
_contractRepository.CreateContract(Contract.CreateOpeartion(0, DateTime.Now, (int)comboBoxProject.SelectedValue, CreateListExecutorOnProject()));
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -58,13 +58,13 @@ namespace ProjectItCompany.Forms
|
|||||||
var list = new List<Entities.CustomerOnProject>();
|
var list = new List<Entities.CustomerOnProject>();
|
||||||
foreach (DataGridViewRow row in dataGridViewContract.Rows)
|
foreach (DataGridViewRow row in dataGridViewContract.Rows)
|
||||||
{
|
{
|
||||||
if (row.Cells["ColumnProject"].Value == null ||
|
if (row.Cells["ColumnCustomer"].Value == null ||
|
||||||
row.Cells["ColumnCustomer"].Value == null)
|
row.Cells["ColumnDescription"].Value == null)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
list.Add(Entities.CustomerOnProject.CreateElement(0,
|
list.Add(Entities.CustomerOnProject.CreateElement(0, 0,
|
||||||
Convert.ToInt32(row.Cells["ColumnProject"].Value), Convert.ToInt32(row.Cells["ColumnCustomer"].Value), string.Empty));
|
Convert.ToInt32(row.Cells["ColumnCustomer"].Value), row.Cells["ColumnDescription"].Value?.ToString()));
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<metadata name="ColumnProject.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="ColumnCustomer.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
</root>
|
</root>
|
@ -95,7 +95,6 @@
|
|||||||
dataGridView.MultiSelect = false;
|
dataGridView.MultiSelect = false;
|
||||||
dataGridView.Name = "dataGridView";
|
dataGridView.Name = "dataGridView";
|
||||||
dataGridView.ReadOnly = true;
|
dataGridView.ReadOnly = true;
|
||||||
dataGridView.RowHeadersVisible = false;
|
|
||||||
dataGridView.RowTemplate.Height = 25;
|
dataGridView.RowTemplate.Height = 25;
|
||||||
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||||
dataGridView.Size = new Size(580, 427);
|
dataGridView.Size = new Size(580, 427);
|
||||||
|
@ -1140,7 +1140,7 @@
|
|||||||
<data name="ButtonDelete.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="ButtonDelete.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>
|
<value>
|
||||||
iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||||
vwAADr8BOAVTJAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAD8lSURBVHhe7d0H
|
vgAADr4B6kKxwAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAD8lSURBVHhe7d0H
|
||||||
nFTlufjxiRqxd4PtRk2MGjWxEDUq7MxO3QEhatxoLFhQbFGwgWJbFRRjBSsKoogNFVOvsaWbm+v1aqJR
|
nFTlufjxiRqxd4PtRk2MGjWxEDUq7MxO3QEhatxoLFhQbFGwgWJbFRRjBSsKoogNFVOvsaWbm+v1aqJR
|
||||||
k39u7EmMjaLUnXOe/3OGdwLOvsiWKec95/f7fL4hssvuzJxz3uedYdlNEFG4kykDPi8/PGAreTS1R+ej
|
k39u7EmMjaLUnXOe/3OGdwLOvsiWKec95/f7fL4hssvuzJxz3uedYdlNEFG4kykDPi8/PGAreTS1R+ej
|
||||||
LfnSoy3f8R5NjvRmt4xVV6pbvdmD7vNnt/zQf3TQk6XZLb/zZief8x5p+au+7XX1UZWlSqoEv/fp93uk
|
LfnSoy3f8R5NjvRmt4xVV6pbvdmD7vNnt/zQf3TQk6XZLb/zZief8x5p+au+7XX1UZWlSqoEv/fp93uk
|
||||||
|
@ -85,9 +85,12 @@
|
|||||||
// numericUpDownHourlyRate
|
// numericUpDownHourlyRate
|
||||||
//
|
//
|
||||||
numericUpDownHourlyRate.Location = new Point(136, 84);
|
numericUpDownHourlyRate.Location = new Point(136, 84);
|
||||||
|
numericUpDownHourlyRate.Maximum = new decimal(new int[] { 1000000, 0, 0, 0 });
|
||||||
|
numericUpDownHourlyRate.Minimum = new decimal(new int[] { 100, 0, 0, 0 });
|
||||||
numericUpDownHourlyRate.Name = "numericUpDownHourlyRate";
|
numericUpDownHourlyRate.Name = "numericUpDownHourlyRate";
|
||||||
numericUpDownHourlyRate.Size = new Size(151, 23);
|
numericUpDownHourlyRate.Size = new Size(151, 23);
|
||||||
numericUpDownHourlyRate.TabIndex = 5;
|
numericUpDownHourlyRate.TabIndex = 5;
|
||||||
|
numericUpDownHourlyRate.Value = new decimal(new int[] { 100, 0, 0, 0 });
|
||||||
//
|
//
|
||||||
// ButtonSave
|
// ButtonSave
|
||||||
//
|
//
|
||||||
|
@ -51,7 +51,6 @@
|
|||||||
dataGridView.MultiSelect = false;
|
dataGridView.MultiSelect = false;
|
||||||
dataGridView.Name = "dataGridView";
|
dataGridView.Name = "dataGridView";
|
||||||
dataGridView.ReadOnly = true;
|
dataGridView.ReadOnly = true;
|
||||||
dataGridView.RowHeadersVisible = false;
|
|
||||||
dataGridView.RowTemplate.Height = 25;
|
dataGridView.RowTemplate.Height = 25;
|
||||||
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||||
dataGridView.Size = new Size(638, 450);
|
dataGridView.Size = new Size(638, 450);
|
||||||
@ -111,6 +110,7 @@
|
|||||||
Name = "FormExecutors";
|
Name = "FormExecutors";
|
||||||
StartPosition = FormStartPosition.CenterParent;
|
StartPosition = FormStartPosition.CenterParent;
|
||||||
Text = "Исполнители";
|
Text = "Исполнители";
|
||||||
|
Load += FormExecutors_Load;
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||||
panel1.ResumeLayout(false);
|
panel1.ResumeLayout(false);
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
|
@ -121,7 +121,7 @@
|
|||||||
<data name="ButtonUpd.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="ButtonUpd.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>
|
<value>
|
||||||
iVBORw0KGgoAAAANSUhEUgAABLAAAASwCAIAAABkQySYAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
iVBORw0KGgoAAAANSUhEUgAABLAAAASwCAIAAABkQySYAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||||
wQAADsEBuJFr7QAA/7JJREFUeF7s/UlsbUua74fxNtlXZr16neBnC7b8BEiC5YGggXsJFmDA8MywbAuQ
|
vQAADr0BR/uQrQAA/7JJREFUeF7s/UlsbUua74fxNtlXZr16neBnC7b8BEiC5YGggXsJFmDA8MywbAuQ
|
||||||
ZFgTTeyJAQHWxJAnHnhgAxbgRjZgCLAnBoSnga2np6rK9vb3Ztar0itVVWZlZXfzno49D09/zqV/Eb9v
|
ZFgTTeyJAQHWxJAnHnhgAxbgRjZgCLAnBoSnga2np6rK9vb3Ztar0itVVWZlZXfzno49D09/zqV/Eb9v
|
||||||
fwzuvcnDQ/Jwr334/UAEvogVK1asWGtF/P97bZIbR0VRFEVRFEVRFMWNpAxhURRFURRFURTFDaUMYVEU
|
fwzuvcnDQ/Jwr334/UAEvogVK1asWGtF/P97bZIbR0VRFEVRFEVRFMWNpAxhURRFURRFURTFDaUMYVEU
|
||||||
RVEURVEUxQ2lDGFRFEVRFEVRFMUNpQxhURRFURRFURTFDaUMYVEURVEURVEUxQ2lDGFRFEVRFEVRFMUN
|
RVEURVEUxQ2lDGFRFEVRFEVRFMUNpQxhURRFURRFURTFDaUMYVEURVEURVEUxQ2lDGFRFEVRFEVRFMUN
|
||||||
@ -6527,7 +6527,7 @@
|
|||||||
<data name="ButtonDelete.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="ButtonDelete.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>
|
<value>
|
||||||
iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||||
vQAADr0BR/uQrQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAD8lSURBVHhe7d0H
|
vAAADrwBlbxySQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAD8lSURBVHhe7d0H
|
||||||
nFTlufjxiRqxd4PtRk2MGjWxEDUq7MxO3QEhatxoLFhQbFGwgWJbFRRjBSsKoogNFVOvsaWbm+v1aqJR
|
nFTlufjxiRqxd4PtRk2MGjWxEDUq7MxO3QEhatxoLFhQbFGwgWJbFRRjBSsKoogNFVOvsaWbm+v1aqJR
|
||||||
k39u7EmMjaLUnXOe/3OGdwLOvsiWKec95/f7fL4hssvuzJxz3uedYdlNEFG4kykDPi8/PGAreTS1R+ej
|
k39u7EmMjaLUnXOe/3OGdwLOvsiWKec95/f7fL4hssvuzJxz3uedYdlNEFG4kykDPi8/PGAreTS1R+ej
|
||||||
LfnSoy3f8R5NjvRmt4xVV6pbvdmD7vNnt/zQf3TQk6XZLb/zZief8x5p+au+7XX1UZWlSqoEv/fp93uk
|
LfnSoy3f8R5NjvRmt4xVV6pbvdmD7vNnt/zQf3TQk6XZLb/zZief8x5p+au+7XX1UZWlSqoEv/fp93uk
|
||||||
|
@ -91,6 +91,7 @@
|
|||||||
// numericUpDownNumberOfHours
|
// numericUpDownNumberOfHours
|
||||||
//
|
//
|
||||||
numericUpDownNumberOfHours.Location = new Point(130, 60);
|
numericUpDownNumberOfHours.Location = new Point(130, 60);
|
||||||
|
numericUpDownNumberOfHours.Maximum = new decimal(new int[] { 100000000, 0, 0, 0 });
|
||||||
numericUpDownNumberOfHours.Name = "numericUpDownNumberOfHours";
|
numericUpDownNumberOfHours.Name = "numericUpDownNumberOfHours";
|
||||||
numericUpDownNumberOfHours.Size = new Size(120, 23);
|
numericUpDownNumberOfHours.Size = new Size(120, 23);
|
||||||
numericUpDownNumberOfHours.TabIndex = 6;
|
numericUpDownNumberOfHours.TabIndex = 6;
|
||||||
|
@ -35,11 +35,11 @@ public class ContractRepository : IContractRepository
|
|||||||
using var transaction = connection.BeginTransaction();
|
using var transaction = connection.BeginTransaction();
|
||||||
var queryInsert = @"INSERT INTO contract (Date, ProjectId)
|
var queryInsert = @"INSERT INTO contract (Date, ProjectId)
|
||||||
VALUES (@Date, @ProjectId);
|
VALUES (@Date, @ProjectId);
|
||||||
SELECT MAX(Id) FROM Contracts";
|
SELECT MAX(Id) FROM contract";
|
||||||
var feedReplenishmentId = connection.QueryFirst<int>(queryInsert, contract, transaction);
|
var feedReplenishmentId = connection.QueryFirst<int>(queryInsert, contract, transaction);
|
||||||
var querySubInsert = @"INSERT INTO customerOnProject (ContractId, CostomerId, Description)
|
var querySubInsert = @"INSERT INTO customeronproject (Description, ContractId, CustomerId)
|
||||||
VALUES (@ContractId,@CostomerId, @Description)";
|
VALUES ( @Description, @ContractId,@CustomerId)";
|
||||||
foreach (var elem in contract.CustomerId)
|
foreach (var elem in contract.CustomerOnContract)
|
||||||
{
|
{
|
||||||
connection.Execute(querySubInsert, new
|
connection.Execute(querySubInsert, new
|
||||||
{
|
{
|
||||||
@ -65,7 +65,7 @@ public class ContractRepository : IContractRepository
|
|||||||
{
|
{
|
||||||
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
|
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
|
||||||
var queryDelete = @"DELETE FROM contract
|
var queryDelete = @"DELETE FROM contract
|
||||||
WHERE ID=@id";
|
WHERE ID=@Id";
|
||||||
connection.Execute(queryDelete, new { id });
|
connection.Execute(queryDelete, new { id });
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
@ -50,7 +50,7 @@ public class CustomerRepository : ICustomerRepository
|
|||||||
var queryUpdate = @"UPDATE customer SET
|
var queryUpdate = @"UPDATE customer SET
|
||||||
NameCustomer=@NameCustomer,
|
NameCustomer=@NameCustomer,
|
||||||
Description=@Description
|
Description=@Description
|
||||||
WHERE ID=@id";
|
WHERE ID=@Id";
|
||||||
connection.Execute(queryUpdate, customer);
|
connection.Execute(queryUpdate, customer);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
@ -52,7 +52,7 @@ public class ExecutorRepository : IExecutorRepository
|
|||||||
DateOfBirth=@DateOfBirth,
|
DateOfBirth=@DateOfBirth,
|
||||||
HourlyRate=@HourlyRate,
|
HourlyRate=@HourlyRate,
|
||||||
JobTitles = @JobTitles
|
JobTitles = @JobTitles
|
||||||
WHERE ID=@id";
|
WHERE ID=@Id";
|
||||||
connection.Execute(queryUpdate, executor);
|
connection.Execute(queryUpdate, executor);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
@ -51,7 +51,7 @@ public class ProjectRepository : IProjectRepository
|
|||||||
NameProject=@NameProject,
|
NameProject=@NameProject,
|
||||||
CustomerId=@CustomerId,
|
CustomerId=@CustomerId,
|
||||||
CompletedStages=@CompletedStages
|
CompletedStages=@CompletedStages
|
||||||
WHERE ID=@id";
|
WHERE ID=@Id";
|
||||||
connection.Execute(queryUpdate, project);
|
connection.Execute(queryUpdate, project);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user