public ActionResult AddCarnet([FromBody] CarnetType carnetType) { Guid trenerId = _ctx.CurrentUserId; _carnetService.AddCarnet(carnetType, trenerId); return(Ok()); }
public CarnetTypeDto(CarnetType x) { CarnetTypeID = x.CarnetTypeID; Price = x.Price; Name = x.Name; Duration = x.Duration; }
public void AddCarnet(CarnetType carnetType, Guid trenerId) { Carnet t = new Carnet() { IsActive = false, Type = carnetType, ClientID = trenerId }; _carnetRepository.AddCarnet(t); }
public void SelectCarnet(Guid idCarnet, Guid id) { CarnetType type = GetTypeById(idCarnet); Carnet carnet = new Carnet { Type = type, ClientID = id }; if (_carnetRepository.CheckIfExist(id)) { throw new ArgumentException("Posiadasz juz karnet", "original"); } else { _carnetRepository.SelectCarnet(carnet); } }
public void Save(CarnetType p) { _context.Add(p); _context.SaveChanges(); }
public async Task <IActionResult> CreateCarnetType([FromBody] CarnetType type) { _carnetService.Save(type); return(Ok()); }
public void Save(CarnetType p) { _carnetRepository.Save(p); }