コード例 #1
0
        public HttpResponseMessage GetEventDetails(int nEventsID, int nLanguageID)
        {
            TakamulEvents  oTakamulEvents   = null;
            EventViewModel oEventsViewModel = this.oIEventsServices.oGetEventDetails(nEventsID);

            if (oEventsViewModel != null)
            {
                string sRemoteFilePath = string.Empty;
                if (!string.IsNullOrEmpty(oEventsViewModel.EVENT_IMG_FILE_PATH))
                {
                    sRemoteFilePath = Path.Combine(CommonHelper.sGetConfigKeyValue(ConstantNames.RemoteFileServerPath), oEventsViewModel.EVENT_IMG_FILE_PATH);
                }

                oTakamulEvents = new TakamulEvents()
                {
                    EventID          = oEventsViewModel.ID,
                    APPLICATIONID    = oEventsViewModel.APPLICATION_ID,
                    EVENTDESCRIPTION = oEventsViewModel.EVENT_DESCRIPTION,
                    EVENTNAME        = oEventsViewModel.EVENT_NAME,
                    EVENTDATE        = string.Format("{0} {1}", oEventsViewModel.EVENT_DATE.ToShortDateString(), oEventsViewModel.EVENT_DATE.ToShortTimeString()),
                    Latitude         = oEventsViewModel.EVENT_LATITUDE,
                    Longitude        = oEventsViewModel.EVENT_LONGITUDE,
                    RemoteFilePath   = sRemoteFilePath,
                    EventLocation    = oEventsViewModel.EVENT_LOCATION_NAME
                };
            }
            return(Request.CreateResponse(HttpStatusCode.OK, oTakamulEvents));
        }
コード例 #2
0
        public HttpResponseMessage GetAllEvents(int nApplicationID, int nLanguageID)
        {
            List <TakamulEvents> lstTakamulEvents = null;
            var lstEvents = this.oIEventsServices.IlGetAllActiveEvents(nApplicationID, nLanguageID);

            if (lstEvents.Count() > 0)
            {
                lstTakamulEvents = new List <TakamulEvents>();
                foreach (var oEvent in lstEvents)
                {
                    string sRemoteFilePath = string.Empty;
                    if (!string.IsNullOrEmpty(oEvent.EVENT_IMG_FILE_PATH))
                    {
                        sRemoteFilePath = Path.Combine(CommonHelper.sGetConfigKeyValue(ConstantNames.RemoteFileServerPath), oEvent.EVENT_IMG_FILE_PATH);
                    }

                    TakamulEvents oTakamulEvents = new TakamulEvents()
                    {
                        EventID          = oEvent.ID,
                        APPLICATIONID    = oEvent.APPLICATION_ID,
                        EVENTDESCRIPTION = oEvent.EVENT_DESCRIPTION,
                        EVENTNAME        = oEvent.EVENT_NAME,
                        EVENTDATE        = string.Format("{0} {1}", oEvent.EVENT_DATE.ToShortDateString(), oEvent.EVENT_DATE.ToShortTimeString()),
                        Latitude         = oEvent.EVENT_LATITUDE,
                        Longitude        = oEvent.EVENT_LONGITUDE,
                        RemoteFilePath   = sRemoteFilePath,
                        EventLocation    = oEvent.EVENT_LOCATION_NAME
                    };
                    lstTakamulEvents.Add(oTakamulEvents);
                }
            }
            return(Request.CreateResponse(HttpStatusCode.OK, lstTakamulEvents));
        }
コード例 #3
0
        public HttpResponseMessage GetHomePageData(int nApplicationID, int nUserID, int nLanguageID)
        {
            HomePageRepo         oHomePageRepo    = new HomePageRepo();
            List <TakamulTicket> lstTakamulTicket = null;

            if (nUserID != -99)
            {
                var lstTickets = this.oITicketServices.IlGetAllActiveTickets(nApplicationID, nUserID);
                if (lstTickets.Count > 0)
                {
                    lstTakamulTicket = new List <TakamulTicket>();
                    foreach (var ticket in lstTickets.OrderByDescending(x => x.ID).Take(5))
                    {
                        string sRemoteFilePath = string.Empty;
                        if (!string.IsNullOrEmpty(ticket.DEFAULT_IMAGE))
                        {
                            sRemoteFilePath = Path.Combine(CommonHelper.sGetConfigKeyValue(ConstantNames.RemoteFileServerPath), ticket.DEFAULT_IMAGE);
                        }

                        TakamulTicket oTakamulTicket = new TakamulTicket()
                        {
                            TicketID           = ticket.ID,
                            TicketCode         = ticket.TICKET_CODE,
                            ApplicationID      = ticket.APPLICATION_ID,
                            TicketName         = ticket.TICKET_NAME,
                            TicketDescription  = ticket.TICKET_DESCRIPTION,
                            TicketStatusID     = ticket.TICKET_STATUS_ID,
                            TicketStatusRemark = ticket.TICKET_STATUS_REMARK,
                            TicketStatusName   = ticket.TICKET_STATUS_NAME,
                            RemoteFilePath     = sRemoteFilePath,
                            CreatedDate        = string.Format("{0} {1}", ticket.CREATED_DATE.ToShortDateString(), ticket.CREATED_DATE.ToShortTimeString())
                        };

                        lstTakamulTicket.Add(oTakamulTicket);
                    }

                    oHomePageRepo.TakamulTicketList = lstTakamulTicket;
                }
            }

            List <TakamulNews> lstTakamulNews = null;
            var lstNews = this.oINewsServices.IlGetAllActiveNews(nApplicationID, nLanguageID);

            if (lstNews.Count() > 0)
            {
                lstTakamulNews = new List <TakamulNews>();
                foreach (var news in lstNews.OrderByDescending(x => x.ID).Take(5))
                {
                    string sRemoteFilePath = string.Empty;
                    if (!string.IsNullOrEmpty(news.NEWS_IMG_FILE_PATH))
                    {
                        sRemoteFilePath = Path.Combine(CommonHelper.sGetConfigKeyValue(ConstantNames.RemoteFileServerPath), news.NEWS_IMG_FILE_PATH);
                    }
                    TakamulNews oTakamulNews = new TakamulNews()
                    {
                        NewsID         = news.ID,
                        ApplicationID  = news.APPLICATION_ID,
                        NewsContent    = news.NEWS_CONTENT,
                        NewsTitle      = news.NEWS_TITLE,
                        PublishedDate  = string.Format("{0} {1}", news.PUBLISHED_DATE.ToShortDateString(), news.PUBLISHED_DATE.ToShortTimeString()),
                        RemoteFilePath = sRemoteFilePath
                    };
                    lstTakamulNews.Add(oTakamulNews);
                }
                oHomePageRepo.TakamulNewsList = lstTakamulNews;
            }

            List <TakamulEvents> lstTakamulEvents = null;
            var lstEvents = this.oIEventsServices.IlGetAllActiveEvents(nApplicationID, nLanguageID);

            if (lstEvents.Count() > 0)
            {
                lstTakamulEvents = new List <TakamulEvents>();
                foreach (var oEvent in lstEvents.OrderByDescending(x => x.ID).Take(5))
                {
                    string sRemoteFilePath = string.Empty;
                    if (!string.IsNullOrEmpty(oEvent.EVENT_IMG_FILE_PATH))
                    {
                        sRemoteFilePath = Path.Combine(CommonHelper.sGetConfigKeyValue(ConstantNames.RemoteFileServerPath), oEvent.EVENT_IMG_FILE_PATH);
                    }

                    TakamulEvents oTakamulEvents = new TakamulEvents()
                    {
                        EventID          = oEvent.ID,
                        APPLICATIONID    = oEvent.APPLICATION_ID,
                        EVENTDESCRIPTION = oEvent.EVENT_DESCRIPTION,
                        EVENTNAME        = oEvent.EVENT_NAME,
                        EVENTDATE        = string.Format("{0} {1}", oEvent.EVENT_DATE.ToShortDateString(), oEvent.EVENT_DATE.ToShortTimeString()),
                        Latitude         = oEvent.EVENT_LATITUDE,
                        Longitude        = oEvent.EVENT_LONGITUDE,
                        RemoteFilePath   = sRemoteFilePath
                    };
                    lstTakamulEvents.Add(oTakamulEvents);
                }
                oHomePageRepo.TakamulEventList = lstTakamulEvents;
            }

            return(Request.CreateResponse(HttpStatusCode.OK, oHomePageRepo));
        }