public void CreateOrder(OrderBindingModel model) { _orderStorage.Insert(new OrderBindingModel { Date = model.Date, CarId = model.CarId, CustomerId = model.CustomerId, EmployeeId = model.EmployeeId }); }
public void CreateOrder(CreateOrderBindingModel model) { _orderStorage.Insert(new OrderBindingModel { ProductId = model.ProductId, Count = model.Count, Sum = model.Sum, DateCreate = DateTime.Now, Status = OrderStatus.Принят }); }
public void CreateOrUpdateOrder(OrderBindingModel model) { if (model.Id.HasValue) { _orderStorage.Update(model); } else { _orderStorage.Insert(new OrderBindingModel { Students = model.Students, ProviderId = model.ProviderId, DateCreate = DateTime.Now }); } }
public void CreateOrUpdate(OrderBindingModel model) { var element = _orderStorage.GetElement(new OrderBindingModel { OrderName = model.OrderName, Price = model.Price }); if (element != null && element.Id != model.Id) { throw new Exception("Телефон или Email уже был зарегестрирован!"); } if (model.Id.HasValue) { _orderStorage.Update(model); } else { _orderStorage.Insert(model); } }