исправление
This commit is contained in:
parent
be215f0672
commit
3259ac446b
@ -14,13 +14,13 @@ public class Trip
|
|||||||
public int Route_Id { get; private set; }
|
public int Route_Id { get; private set; }
|
||||||
public int Bus_Id { get; private set; }
|
public int Bus_Id { get; private set; }
|
||||||
|
|
||||||
public static Trip CreateOperation(int id, int route_Id, int bus_Id)
|
public static Trip CreateOperation(int id, int route_Id, int bus_Id, DateTime departure, DateTime arrival)
|
||||||
{
|
{
|
||||||
return new Trip
|
return new Trip
|
||||||
{
|
{
|
||||||
Id = id,
|
Id = id,
|
||||||
Departure = DateTime.Now,
|
Departure = departure,
|
||||||
Arrival = DateTime.Now,
|
Arrival = arrival,
|
||||||
Route_Id = route_Id,
|
Route_Id = route_Id,
|
||||||
Bus_Id = bus_Id
|
Bus_Id = bus_Id
|
||||||
};
|
};
|
||||||
|
@ -34,6 +34,10 @@
|
|||||||
labelRoute = new Label();
|
labelRoute = new Label();
|
||||||
buttonSave = new Button();
|
buttonSave = new Button();
|
||||||
buttonCancel = new Button();
|
buttonCancel = new Button();
|
||||||
|
label2 = new Label();
|
||||||
|
label1 = new Label();
|
||||||
|
dateTimePickerEnd = new DateTimePicker();
|
||||||
|
dateTimePickerStart = new DateTimePicker();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
// comboBoxRoute
|
// comboBoxRoute
|
||||||
@ -72,7 +76,7 @@
|
|||||||
//
|
//
|
||||||
// buttonSave
|
// buttonSave
|
||||||
//
|
//
|
||||||
buttonSave.Location = new Point(43, 225);
|
buttonSave.Location = new Point(41, 260);
|
||||||
buttonSave.Name = "buttonSave";
|
buttonSave.Name = "buttonSave";
|
||||||
buttonSave.Size = new Size(94, 29);
|
buttonSave.Size = new Size(94, 29);
|
||||||
buttonSave.TabIndex = 6;
|
buttonSave.TabIndex = 6;
|
||||||
@ -82,7 +86,7 @@
|
|||||||
//
|
//
|
||||||
// buttonCancel
|
// buttonCancel
|
||||||
//
|
//
|
||||||
buttonCancel.Location = new Point(214, 225);
|
buttonCancel.Location = new Point(212, 260);
|
||||||
buttonCancel.Name = "buttonCancel";
|
buttonCancel.Name = "buttonCancel";
|
||||||
buttonCancel.Size = new Size(94, 29);
|
buttonCancel.Size = new Size(94, 29);
|
||||||
buttonCancel.TabIndex = 7;
|
buttonCancel.TabIndex = 7;
|
||||||
@ -90,11 +94,49 @@
|
|||||||
buttonCancel.UseVisualStyleBackColor = true;
|
buttonCancel.UseVisualStyleBackColor = true;
|
||||||
buttonCancel.Click += ButtonCancel_Click;
|
buttonCancel.Click += ButtonCancel_Click;
|
||||||
//
|
//
|
||||||
|
// label2
|
||||||
|
//
|
||||||
|
label2.AutoSize = true;
|
||||||
|
label2.Location = new Point(21, 212);
|
||||||
|
label2.Name = "label2";
|
||||||
|
label2.Size = new Size(115, 20);
|
||||||
|
label2.TabIndex = 15;
|
||||||
|
label2.Text = "Дата прибытия";
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
label1.AutoSize = true;
|
||||||
|
label1.Location = new Point(21, 159);
|
||||||
|
label1.Name = "label1";
|
||||||
|
label1.Size = new Size(110, 20);
|
||||||
|
label1.TabIndex = 14;
|
||||||
|
label1.Text = "Дата отправки";
|
||||||
|
//
|
||||||
|
// dateTimePickerEnd
|
||||||
|
//
|
||||||
|
dateTimePickerEnd.Location = new Point(168, 204);
|
||||||
|
dateTimePickerEnd.Margin = new Padding(3, 4, 3, 4);
|
||||||
|
dateTimePickerEnd.Name = "dateTimePickerEnd";
|
||||||
|
dateTimePickerEnd.Size = new Size(177, 27);
|
||||||
|
dateTimePickerEnd.TabIndex = 13;
|
||||||
|
//
|
||||||
|
// dateTimePickerStart
|
||||||
|
//
|
||||||
|
dateTimePickerStart.Location = new Point(168, 151);
|
||||||
|
dateTimePickerStart.Margin = new Padding(3, 4, 3, 4);
|
||||||
|
dateTimePickerStart.Name = "dateTimePickerStart";
|
||||||
|
dateTimePickerStart.Size = new Size(177, 27);
|
||||||
|
dateTimePickerStart.TabIndex = 12;
|
||||||
|
//
|
||||||
// FormTrip
|
// FormTrip
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
ClientSize = new Size(418, 315);
|
ClientSize = new Size(418, 315);
|
||||||
|
Controls.Add(label2);
|
||||||
|
Controls.Add(label1);
|
||||||
|
Controls.Add(dateTimePickerEnd);
|
||||||
|
Controls.Add(dateTimePickerStart);
|
||||||
Controls.Add(buttonCancel);
|
Controls.Add(buttonCancel);
|
||||||
Controls.Add(buttonSave);
|
Controls.Add(buttonSave);
|
||||||
Controls.Add(labelRoute);
|
Controls.Add(labelRoute);
|
||||||
@ -115,5 +157,9 @@
|
|||||||
private Label labelRoute;
|
private Label labelRoute;
|
||||||
private Button buttonSave;
|
private Button buttonSave;
|
||||||
private Button buttonCancel;
|
private Button buttonCancel;
|
||||||
|
private Label label2;
|
||||||
|
private Label label1;
|
||||||
|
private DateTimePicker dateTimePickerEnd;
|
||||||
|
private DateTimePicker dateTimePickerStart;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -35,7 +35,7 @@ namespace ProjectPassengerTransfers.Forms
|
|||||||
{
|
{
|
||||||
throw new Exception("Имеются незаполненные поля");
|
throw new Exception("Имеются незаполненные поля");
|
||||||
}
|
}
|
||||||
_tripRepository.CreateTrip(Trip.CreateOperation(0, (int)comboBoxRoute.SelectedValue!, (int)comboBoxBus.SelectedValue!));
|
_tripRepository.CreateTrip(Trip.CreateOperation(0, (int)comboBoxRoute.SelectedValue!, (int)comboBoxBus.SelectedValue!, dateTimePickerStart.Value.Date, dateTimePickerEnd.Value.Date));
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user