Example #1
0
        public IHttpActionResult Post([FromBody] ConcertProgrammModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var userId = User.Identity.GetUserId <int>();

            return(Ok(_concertService.SaveConcertProgramm(model).Response()));
        }
Example #2
0
        /// <see cref="IConcertService.SaveConcertProgramm(ConcertProgrammModel)"/>
        public ServiceResponce SaveConcertProgramm(ConcertProgrammModel model)
        {
            var succes = ServiceResponce.FromSuccess().Result("Concert programm save complete");
            var error  = ServiceResponce.FromFailed().Result($"Error save concert programm");
            var res    = _concertRepository.AddConcertProgramm(
                ConcertModelHelper.GetProgramm(model));

            if (res != null)
            {
                succes.Add("ProgrammId", res.Id);
            }
            return(res != null ? succes : error);
        }
Example #3
0
 public static ConcertProgramm GetProgramm(ConcertProgrammModel model)
 {
     return(model != null ? new ConcertProgramm
     {
         Id = model.Id,
         Name = model.Name,
         DateStart = model.DateStart,
         DateEnd = model.DateEnd,
         Duration = model.Duration,
         TimeStart = model.TimeStart,
         TimeEnd = model.TimeEnd,
         Description = model.Description,
         IdEvent = model.IdEvent,
         MediaLink = model.MediaLink,
         //Actors = model.Actors != null ? GetActors(model.Actors).ToList(): null
     } : null);
 }
Example #4
0
 /// <see cref="IConcertService.UpdateConcertProgramm"/>
 public bool UpdateConcertProgramm(ConcertProgrammModel model)
 {
     return(_concertRepository.UpdateConcertProgramm(ConcertModelHelper.GetProgramm(model)) != null);
 }