public IHttpActionResult GetEventWithId(int eventId)
        {
            try
            {
                EventBasicInfo currentThread;

                using (var db = new EventDAL())
                {
                    currentThread = db.GetFullEventBasicInformation(eventId);
                }

                return(Ok(new HTTPMessageDTO
                {
                    Status = WsConstant.HttpMessageType.SUCCESS,
                    Message = "Get Event with ID Successfully",
                    Type = "",
                    Data = currentThread
                }));
            }
            catch (Exception)
            {
                return(Ok(new HTTPMessageDTO
                {
                    Status = WsConstant.HttpMessageType.ERROR,
                    Message = "Cannot Get Event with ID",
                    Type = ""
                }));
            }
        }
Beispiel #2
0
        public IHttpActionResult GetEventDetailById(int id)
        {
            EventBasicInfo EvtBasicInfo = new EventBasicInfo();

            try {
                using (var db = new EventDAL()){
                    EvtBasicInfo = db.GetFullEventBasicInformation(id);
                }
            }catch (Exception)
            {
                return(Redirect("/#/Error"));
            }
            return(Ok(new HTTPMessageDTO {
                Status = WsConstant.HttpMessageType.SUCCESS, Data = EvtBasicInfo
            }));
        }