diff --git a/FuelAndLubricants/FuelAndLubricants/Entities/Trip.cs b/FuelAndLubricants/FuelAndLubricants/Entities/Trip.cs index 1a7dd80..83e9614 100644 --- a/FuelAndLubricants/FuelAndLubricants/Entities/Trip.cs +++ b/FuelAndLubricants/FuelAndLubricants/Entities/Trip.cs @@ -11,9 +11,9 @@ public class Trip public float Fuel_Consumption { get; private set; } public int Car_ID { get; private set; } public int Driver_ID { get; private set; } - public int Route_ID { get; private set; } + public IEnumerable Routes { get; private set; } = []; - public static Trip CreateOperation(int trip_id, DateTime start_date, DateTime end_date, Shift shift, float consumption, int car_id, int driver_id, int route_id) + public static Trip CreateOperation(int trip_id, DateTime start_date, DateTime end_date, Shift shift, float consumption, int car_id, int driver_id, IEnumerable routes) { return new Trip { @@ -24,7 +24,7 @@ public class Trip Fuel_Consumption = consumption, Car_ID = car_id, Driver_ID = driver_id, - Route_ID = route_id + Routes = routes }; } } diff --git a/FuelAndLubricants/FuelAndLubricants/Forms/FormCar.Designer.cs b/FuelAndLubricants/FuelAndLubricants/Forms/FormCar.Designer.cs index aea1ce5..a17b551 100644 --- a/FuelAndLubricants/FuelAndLubricants/Forms/FormCar.Designer.cs +++ b/FuelAndLubricants/FuelAndLubricants/Forms/FormCar.Designer.cs @@ -45,17 +45,21 @@ // // checkedListBoxDriverLicense // + checkedListBoxDriverLicense.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; checkedListBoxDriverLicense.FormattingEnabled = true; - checkedListBoxDriverLicense.Location = new Point(107, 97); + checkedListBoxDriverLicense.Location = new Point(122, 129); + checkedListBoxDriverLicense.Margin = new Padding(3, 4, 3, 4); checkedListBoxDriverLicense.Name = "checkedListBoxDriverLicense"; - checkedListBoxDriverLicense.Size = new Size(140, 94); + checkedListBoxDriverLicense.Size = new Size(159, 114); checkedListBoxDriverLicense.TabIndex = 17; // // buttonCancel // - buttonCancel.Location = new Point(172, 232); + buttonCancel.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; + buttonCancel.Location = new Point(197, 309); + buttonCancel.Margin = new Padding(3, 4, 3, 4); buttonCancel.Name = "buttonCancel"; - buttonCancel.Size = new Size(75, 23); + buttonCancel.Size = new Size(86, 31); buttonCancel.TabIndex = 16; buttonCancel.Text = "Отмена"; buttonCancel.UseVisualStyleBackColor = true; @@ -63,9 +67,11 @@ // // buttonCarSave // - buttonCarSave.Location = new Point(9, 232); + buttonCarSave.Anchor = AnchorStyles.Bottom | AnchorStyles.Left; + buttonCarSave.Location = new Point(10, 309); + buttonCarSave.Margin = new Padding(3, 4, 3, 4); buttonCarSave.Name = "buttonCarSave"; - buttonCarSave.Size = new Size(75, 23); + buttonCarSave.Size = new Size(86, 31); buttonCarSave.TabIndex = 15; buttonCarSave.Text = "Сохранить"; buttonCarSave.UseVisualStyleBackColor = true; @@ -74,86 +80,94 @@ // label3 // label3.AutoSize = true; - label3.Location = new Point(9, 97); + label3.Location = new Point(10, 129); label3.Name = "label3"; - label3.Size = new Size(92, 15); + label3.Size = new Size(119, 20); label3.TabIndex = 14; label3.Text = "Категория прав"; // // textBoxCarModel // - textBoxCarModel.Location = new Point(107, 39); + textBoxCarModel.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + textBoxCarModel.Location = new Point(122, 52); + textBoxCarModel.Margin = new Padding(3, 4, 3, 4); textBoxCarModel.Name = "textBoxCarModel"; - textBoxCarModel.Size = new Size(140, 23); + textBoxCarModel.Size = new Size(159, 27); textBoxCarModel.TabIndex = 13; // // label2 // label2.AutoSize = true; - label2.Location = new Point(9, 42); + label2.Location = new Point(10, 56); label2.Name = "label2"; - label2.Size = new Size(50, 15); + label2.Size = new Size(63, 20); label2.TabIndex = 12; label2.Text = "Модель"; // // textBoxCarMark // - textBoxCarMark.Location = new Point(107, 10); + textBoxCarMark.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + textBoxCarMark.Location = new Point(122, 13); + textBoxCarMark.Margin = new Padding(3, 4, 3, 4); textBoxCarMark.Name = "textBoxCarMark"; - textBoxCarMark.Size = new Size(140, 23); + textBoxCarMark.Size = new Size(159, 27); textBoxCarMark.TabIndex = 11; // // label1 // label1.AutoSize = true; - label1.Location = new Point(9, 13); + label1.Location = new Point(10, 17); label1.Name = "label1"; - label1.Size = new Size(43, 15); + label1.Size = new Size(54, 20); label1.TabIndex = 10; label1.Text = "Марка"; // // comboBoxCarType // + comboBoxCarType.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; comboBoxCarType.DropDownStyle = ComboBoxStyle.DropDownList; comboBoxCarType.FormattingEnabled = true; - comboBoxCarType.Location = new Point(107, 68); + comboBoxCarType.Location = new Point(122, 91); + comboBoxCarType.Margin = new Padding(3, 4, 3, 4); comboBoxCarType.Name = "comboBoxCarType"; - comboBoxCarType.Size = new Size(140, 23); + comboBoxCarType.Size = new Size(159, 28); comboBoxCarType.TabIndex = 18; // // label4 // label4.AutoSize = true; - label4.Location = new Point(9, 71); + label4.Location = new Point(10, 95); label4.Name = "label4"; - label4.Size = new Size(79, 15); + label4.Size = new Size(99, 20); label4.TabIndex = 19; label4.Text = "Тип машины"; // // numericUpDownConsumptionRate // + numericUpDownConsumptionRate.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; numericUpDownConsumptionRate.DecimalPlaces = 2; - numericUpDownConsumptionRate.Location = new Point(107, 197); + numericUpDownConsumptionRate.Location = new Point(122, 263); + numericUpDownConsumptionRate.Margin = new Padding(3, 4, 3, 4); numericUpDownConsumptionRate.Minimum = new decimal(new int[] { 1, 0, 0, 131072 }); numericUpDownConsumptionRate.Name = "numericUpDownConsumptionRate"; - numericUpDownConsumptionRate.Size = new Size(140, 23); + numericUpDownConsumptionRate.Size = new Size(160, 27); numericUpDownConsumptionRate.TabIndex = 20; numericUpDownConsumptionRate.Value = new decimal(new int[] { 1, 0, 0, 131072 }); // // label5 // label5.AutoSize = true; - label5.Location = new Point(9, 199); + label5.Location = new Point(10, 265); label5.Name = "label5"; - label5.Size = new Size(93, 15); + label5.Size = new Size(117, 20); label5.TabIndex = 21; label5.Text = "Расход топлива"; // // FormCar // - AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(262, 266); + ClientSize = new Size(299, 355); Controls.Add(label5); Controls.Add(numericUpDownConsumptionRate); Controls.Add(label4); @@ -166,7 +180,9 @@ Controls.Add(label2); Controls.Add(textBoxCarMark); Controls.Add(label1); + Margin = new Padding(3, 4, 3, 4); Name = "FormCar"; + StartPosition = FormStartPosition.CenterParent; Text = "FormCar"; ((System.ComponentModel.ISupportInitialize)numericUpDownConsumptionRate).EndInit(); ResumeLayout(false); diff --git a/FuelAndLubricants/FuelAndLubricants/Forms/FormCar.resx b/FuelAndLubricants/FuelAndLubricants/Forms/FormCar.resx index 8b2ff64..af32865 100644 --- a/FuelAndLubricants/FuelAndLubricants/Forms/FormCar.resx +++ b/FuelAndLubricants/FuelAndLubricants/Forms/FormCar.resx @@ -1,7 +1,7 @@