удаление неиспользуемых методов в моделях
This commit is contained in:
parent
f66f89c461
commit
2b6e86ce12
@ -37,17 +37,6 @@ namespace CarServiceDatabase.Models
|
||||
Surname = model.Surname
|
||||
};
|
||||
}
|
||||
public static Customer Create(CustomerViewModel model)
|
||||
{
|
||||
return new()
|
||||
{
|
||||
Id = model.Id,
|
||||
Login = model.Login,
|
||||
Password = model.Password,
|
||||
Name = model.Name,
|
||||
Surname = model.Surname
|
||||
};
|
||||
}
|
||||
public void Update(CustomerBindingModel? model)
|
||||
{
|
||||
if (model == null)
|
||||
|
@ -38,17 +38,6 @@ namespace CarServiceDatabase.Models
|
||||
Worker = context.Workers.First(x => x.Id == model.WorkerId)
|
||||
};
|
||||
}
|
||||
public static Item Create(CarServiceDbContext context, ItemViewModel model)
|
||||
{
|
||||
return new()
|
||||
{
|
||||
Id = model.Id,
|
||||
Name = model.Name,
|
||||
Price = model.Price,
|
||||
Count = model.Count,
|
||||
Worker = context.Workers.First(x => x.Id == model.WorkerId)
|
||||
};
|
||||
}
|
||||
public void Update(CarServiceDbContext context, ItemBindingModel? model)
|
||||
{
|
||||
if (model == null)
|
||||
|
@ -30,16 +30,6 @@ namespace CarServiceDatabase.Models
|
||||
RepairRequest = context.RepairRequests.First(x => x.Id == model.RepairRequestId)
|
||||
};
|
||||
}
|
||||
public static ItemForRepair Create(CarServiceDbContext context, ItemForRepairViewModel model)
|
||||
{
|
||||
return new()
|
||||
{
|
||||
Id = model.Id,
|
||||
Count = model.Count,
|
||||
Item = context.Items.First(x => x.Id == model.ItemId),
|
||||
RepairRequest = context.RepairRequests.First(x => x.Id == model.RepairRequestId)
|
||||
};
|
||||
}
|
||||
public void Update(CarServiceDbContext context, ItemForRepairBindingModel? model)
|
||||
{
|
||||
if (model == null)
|
||||
|
@ -37,15 +37,6 @@ namespace CarServiceDatabase.Models
|
||||
VehicleId = model.VehicleId
|
||||
};
|
||||
}
|
||||
public static RepairRequest Create(RepairRequestViewModel model)
|
||||
{
|
||||
return new()
|
||||
{
|
||||
Id = model.Id,
|
||||
DateCreated = model.DateCreated,
|
||||
VehicleId = model.VehicleId
|
||||
};
|
||||
}
|
||||
public void Update(RepairRequestBindingModel? model)
|
||||
{
|
||||
if (model == null)
|
||||
|
@ -36,17 +36,6 @@ namespace CarServiceDatabase.Models
|
||||
CustomerId = model.CustomerId
|
||||
};
|
||||
}
|
||||
public static Vehicle Create(VehicleViewModel model)
|
||||
{
|
||||
return new()
|
||||
{
|
||||
Id = model.Id,
|
||||
Name = model.Name,
|
||||
Plate = model.Plate,
|
||||
VIN = model.VIN,
|
||||
CustomerId = model.CustomerId
|
||||
};
|
||||
}
|
||||
public void Update(VehicleBindingModel? model)
|
||||
{
|
||||
if (model == null)
|
||||
|
@ -38,17 +38,6 @@ namespace CarServiceDatabase.Models
|
||||
Worker = context.Workers.First(x => x.Id == model.WorkerId)
|
||||
};
|
||||
}
|
||||
public static Work Create(CarServiceDbContext context, WorkViewModel model)
|
||||
{
|
||||
return new()
|
||||
{
|
||||
Id = model.Id,
|
||||
Name = model.Name,
|
||||
Price = model.Price,
|
||||
Duration = model.Duration,
|
||||
Worker = context.Workers.First(x => x.Id == model.WorkerId)
|
||||
};
|
||||
}
|
||||
public void Update(CarServiceDbContext context, WorkBindingModel? model)
|
||||
{
|
||||
if (model == null)
|
||||
|
@ -39,17 +39,6 @@ namespace CarServiceDatabase.Models
|
||||
WorkId = model.WorkId
|
||||
};
|
||||
}
|
||||
public static WorkInRequest Create(WorkInRequestViewModel model)
|
||||
{
|
||||
return new()
|
||||
{
|
||||
Id = model.Id,
|
||||
Count = model.Count,
|
||||
Cost = model.Cost,
|
||||
RepairRequestId = model.RepairRequestId,
|
||||
WorkId = model.WorkId
|
||||
};
|
||||
}
|
||||
public void Update(WorkInRequestBindingModel? model)
|
||||
{
|
||||
if (model == null)
|
||||
|
@ -31,16 +31,6 @@ namespace CarServiceDatabase.Models
|
||||
WorkInRequestId = model.WorkInRequestId
|
||||
};
|
||||
}
|
||||
public static WorkPayment Create(WorkPaymentViewModel model)
|
||||
{
|
||||
return new()
|
||||
{
|
||||
Id = model.Id,
|
||||
DatePayment = model.DatePayment,
|
||||
Sum = model.Sum,
|
||||
WorkInRequestId = model.WorkInRequestId
|
||||
};
|
||||
}
|
||||
public void Update(WorkPaymentBindingModel? model)
|
||||
{
|
||||
if (model == null)
|
||||
|
Loading…
Reference in New Issue
Block a user