Пибд-24. Ередавкин Р.А Лабораторная работа 2 #2
@ -18,14 +18,14 @@ public class To
|
||||
public double Cost { get; private set; }
|
||||
public DateTime DateTo { get; private set; }
|
||||
|
||||
public static To CreatOperation(int id, string discription, double cost, int busid, int staffid)
|
||||
public static To CreatOperation(int id, string discription, double cost, DateTime dateTo, int busid, int staffid)
|
||||
{
|
||||
return new To()
|
||||
{
|
||||
Id = id,
|
||||
Discription = discription ?? string.Empty,
|
||||
Cost = cost,
|
||||
DateTo = DateTime.Now,
|
||||
DateTo = dateTo,
|
||||
BusID = busid,
|
||||
StaffID = staffid
|
||||
};
|
||||
|
@ -31,7 +31,7 @@ public partial class FormTO : Form
|
||||
{
|
||||
throw new Exception("Имеются не заполненые поля");
|
||||
}
|
||||
_toRepository.CreateTo(To.CreatOperation(0, textBoxDescription.Text, Convert.ToDouble(numericUpDownCost.Value), (int)comboBoxBus.SelectedValue!,
|
||||
_toRepository.CreateTo(To.CreatOperation(0, textBoxDescription.Text, Convert.ToDouble(numericUpDownCost.Value), dateTimePicker1.Value, (int)comboBoxBus.SelectedValue!,
|
||||
(int)comboBoxStaff.SelectedValue!));
|
||||
Close();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user