public ServiceResult <int> CreateEvent(Event eventObj) { try { var eventResult = eventAccess.CreateBaseEvent(eventObj); foreach (var ticket in eventObj.EventTicketList) { ticket.EventID = eventResult.Result; eventAccess.CreateEventTicket(ticket); } return(eventResult); } catch (Exception e) { iAppLogManager.WriteLog(e); return(new ServiceResult <int>()); } }
public void EventTicketCreateTest() { var eventObj = new Event(); eventObj.Address = "yes"; eventObj.City = "City"; eventObj.EventStart = DateTime.Today; eventObj.EventEnd = DateTime.Now; eventObj.Country = "Sri Lanka"; eventObj.EventDescription = "dummy content"; var rtn = eventAccess.CreateBaseEvent(eventObj); Ticket ticket = new Ticket(); ticket.EventID = rtn.Result; var TicketResult = eventAccess.CreateEventTicket(ticket); Assert.IsTrue(TicketResult.ResultStatus.IsSuccess == true); }