public async Task <IActionResult> CreateTicketType([FromForm] TicketTypeCM ticketType)
        {
            try
            {
                var TicketType = new TicketType
                {
                    Name          = ticketType.Name,
                    AdultPrice    = ticketType.AdultPrice,
                    ChildrenPrice = ticketType.ChildrenPrice,
                    AtrractionId  = ticketType.AtrractionId,
                    CreateAt      = DateTime.Now
                };
                _ITicketTypeService.AddTicketType(TicketType);
                await _ITicketTypeService.SaveTicketType();

                IList <IFormFile> imageUpload = ticketType.ImageUpload.ToList();

                List <String> listImage = new List <string>();
                if (imageUpload.Count > 0)
                {
                    for (int i = 0; i < imageUpload.Count; i++)
                    {
                        var file = imageUpload[i];
                        var link = await _iUploadFile.uploadFile(file, TicketType.Id.ToString());

                        listImage.Add(link);
                    }
                }
                TicketType.UrlImage = String.Join(";", listImage);
                _ITicketTypeService.UpdateTicketType(TicketType);
                bool result = await _ITicketTypeService.SaveTicketType();

                if (!result)
                {
                    return(BadRequest("Can not create TicketType"));
                }
                return(StatusCode(201, new { Id = TicketType.Id }));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
        public ActionResult Create(TicketTypeModel ticketTypeModel)
        {
            if (ticketTypeModel.TicketTypeId == 0)
            {
                ticketTypeModel.RecCreatedBy = User.Identity.GetUserId();
                ticketTypeModel.RecCreatedOn = DateTime.UtcNow;
                TempData["Message"]          = new MessageViewModel {
                    IsSaved = true, Message = "Ticket Type has been saved successfully."
                };
            }
            else
            {
                TempData["Message"] = new MessageViewModel {
                    IsUpdated = true, Message = "Ticket Type has been updated."
                };
            }

            ticketTypeModel.RecLastUpdatedBy = User.Identity.GetUserId();
            ticketTypeModel.RecLastUpdateOn  = DateTime.UtcNow;

            if (ticketTypeModel.IsLeave)
            {
                if (ticketTypeModel.LeaveTypes != null)
                {
                    var leaveType = (LeaveType)ticketTypeModel.LeaveTypes;
                    switch (leaveType)
                    {
                    case LeaveType.Casual:
                        ticketTypeModel.LeaveType = 0;
                        break;

                    case LeaveType.Medical:
                        ticketTypeModel.LeaveType = 1;
                        break;

                    case LeaveType.HalfDay:
                        ticketTypeModel.LeaveType = 2;
                        break;

                    case LeaveType.Annual:
                        ticketTypeModel.LeaveType = 3;
                        break;
                    }
                }
            }

            ticketTypeService.SaveTicketType(ticketTypeModel.MapFromClientToServer());


            return(RedirectToAction("Index"));
        }