final changes
This commit is contained in:
parent
4e1acff83c
commit
413256e850
@ -41,8 +41,8 @@
|
|||||||
labelContractDeadline = new Label();
|
labelContractDeadline = new Label();
|
||||||
labelContractPaymentAmount = new Label();
|
labelContractPaymentAmount = new Label();
|
||||||
dataGridViewServices = new DataGridView();
|
dataGridViewServices = new DataGridView();
|
||||||
groupBox = new GroupBox();
|
|
||||||
ColumnServiceDescription = new DataGridViewComboBoxColumn();
|
ColumnServiceDescription = new DataGridViewComboBoxColumn();
|
||||||
|
groupBox = new GroupBox();
|
||||||
((System.ComponentModel.ISupportInitialize)numericUpDownContractPaymentAmount).BeginInit();
|
((System.ComponentModel.ISupportInitialize)numericUpDownContractPaymentAmount).BeginInit();
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridViewServices).BeginInit();
|
((System.ComponentModel.ISupportInitialize)dataGridViewServices).BeginInit();
|
||||||
groupBox.SuspendLayout();
|
groupBox.SuspendLayout();
|
||||||
@ -172,6 +172,14 @@
|
|||||||
dataGridViewServices.Size = new Size(352, 244);
|
dataGridViewServices.Size = new Size(352, 244);
|
||||||
dataGridViewServices.TabIndex = 17;
|
dataGridViewServices.TabIndex = 17;
|
||||||
//
|
//
|
||||||
|
// ColumnServiceDescription
|
||||||
|
//
|
||||||
|
ColumnServiceDescription.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
|
||||||
|
ColumnServiceDescription.HeaderText = "Услуга";
|
||||||
|
ColumnServiceDescription.Name = "ColumnServiceDescription";
|
||||||
|
ColumnServiceDescription.Resizable = DataGridViewTriState.True;
|
||||||
|
ColumnServiceDescription.SortMode = DataGridViewColumnSortMode.Automatic;
|
||||||
|
//
|
||||||
// groupBox
|
// groupBox
|
||||||
//
|
//
|
||||||
groupBox.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
groupBox.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
@ -183,14 +191,6 @@
|
|||||||
groupBox.TabStop = false;
|
groupBox.TabStop = false;
|
||||||
groupBox.Text = "Услуги:";
|
groupBox.Text = "Услуги:";
|
||||||
//
|
//
|
||||||
// ColumnServiceDescription
|
|
||||||
//
|
|
||||||
ColumnServiceDescription.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
|
|
||||||
ColumnServiceDescription.HeaderText = "Услуга";
|
|
||||||
ColumnServiceDescription.Name = "ColumnServiceDescription";
|
|
||||||
ColumnServiceDescription.Resizable = DataGridViewTriState.True;
|
|
||||||
ColumnServiceDescription.SortMode = DataGridViewColumnSortMode.Automatic;
|
|
||||||
//
|
|
||||||
// FormContract
|
// FormContract
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
|
@ -11,15 +11,16 @@ namespace PIbd_23_Gutorov_I.A._IT_Company.Forms
|
|||||||
ICustomerRepository customerRepository, IExecutorRepository executorRepository)
|
ICustomerRepository customerRepository, IExecutorRepository executorRepository)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
_customerExecutorReviewRepository = customerExecutorReviewRepository ?? throw new ArgumentNullException(nameof(customerExecutorReviewRepository));
|
_customerExecutorReviewRepository = customerExecutorReviewRepository ??
|
||||||
|
throw new ArgumentNullException(nameof(customerExecutorReviewRepository));
|
||||||
|
|
||||||
comboBoxCustomerExecutorReviewCustomerId.DataSource = customerRepository.ReadCustomers();
|
comboBoxCustomerExecutorReviewCustomerId.DataSource = customerRepository.ReadCustomers();
|
||||||
comboBoxCustomerExecutorReviewCustomerId.DisplayMember = "Name";
|
comboBoxCustomerExecutorReviewCustomerId.DisplayMember = "Name";
|
||||||
comboBoxCustomerExecutorReviewCustomerId.DisplayMember = "Id";
|
comboBoxCustomerExecutorReviewCustomerId.ValueMember = "Id";
|
||||||
|
|
||||||
comboBoxCustomerExecutorReviewExecutorId.DataSource = executorRepository.ReadExecutors();
|
comboBoxCustomerExecutorReviewExecutorId.DataSource = executorRepository.ReadExecutors();
|
||||||
comboBoxCustomerExecutorReviewExecutorId.DisplayMember = "Name";
|
comboBoxCustomerExecutorReviewExecutorId.DisplayMember = "Name";
|
||||||
comboBoxCustomerExecutorReviewCustomerId.DisplayMember = "Id";
|
comboBoxCustomerExecutorReviewCustomerId.ValueMember = "Id";
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonSave_Click(object sender, EventArgs e)
|
private void ButtonSave_Click(object sender, EventArgs e)
|
||||||
@ -33,9 +34,7 @@ namespace PIbd_23_Gutorov_I.A._IT_Company.Forms
|
|||||||
throw new Exception("Имеются незаполненные поля");
|
throw new Exception("Имеются незаполненные поля");
|
||||||
}
|
}
|
||||||
|
|
||||||
_customerExecutorReviewRepository.CreateCustomerExecutorReview(CustomerExecutorReview.CreateElement(
|
_customerExecutorReviewRepository.CreateCustomerExecutorReview(CreateCustomerExecutorReview(0));
|
||||||
0, (int)comboBoxCustomerExecutorReviewCustomerId.SelectedValue!, (int)comboBoxCustomerExecutorReviewExecutorId.SelectedValue!,
|
|
||||||
richTextBoxCustomerExecutorReviewReview.Text, Convert.ToInt32(numericUpDownCustomerExecutorReviewGrade.Value)));
|
|
||||||
|
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
@ -46,5 +45,14 @@ namespace PIbd_23_Gutorov_I.A._IT_Company.Forms
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonCancel_Click(object sender, EventArgs e) => Close();
|
private void ButtonCancel_Click(object sender, EventArgs e) => Close();
|
||||||
|
|
||||||
|
private CustomerExecutorReview CreateCustomerExecutorReview(int id)
|
||||||
|
{
|
||||||
|
return CustomerExecutorReview.CreateElement(
|
||||||
|
id, (int)comboBoxCustomerExecutorReviewCustomerId.SelectedValue!,
|
||||||
|
(int)comboBoxCustomerExecutorReviewExecutorId.SelectedValue!,
|
||||||
|
richTextBoxCustomerExecutorReviewReview.Text,
|
||||||
|
Convert.ToInt32(numericUpDownCustomerExecutorReviewGrade.Value));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,8 +42,8 @@ namespace PIbd_23_Gutorov_I.A._IT_Company.Forms
|
|||||||
if (string.IsNullOrEmpty(richTextBoxServiceDescription.Text))
|
if (string.IsNullOrEmpty(richTextBoxServiceDescription.Text))
|
||||||
throw new Exception("Имеются незаполненные поля");
|
throw new Exception("Имеются незаполненные поля");
|
||||||
|
|
||||||
_serviceRepository.CreateService(Service.CreateEntity(0,
|
if (_serviceId.HasValue) _serviceRepository.UpdateService(Service.CreateEntity(_serviceId.Value, richTextBoxServiceDescription.Text));
|
||||||
richTextBoxServiceDescription.Text));
|
else _serviceRepository.CreateService(Service.CreateEntity(0, richTextBoxServiceDescription.Text));
|
||||||
|
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user