예제 #1
0
        /*************************************
        *  Created by:   dandy boy
        *  Created on:   April 21, 2017
        *  Function:     GetNtfyEventSearch
        *  Purpose:      GetNtfyEventSearch
        *  Inputs:       evtInd,eventType,refTo,refKey,startDate,endDate
        *  Returns:      NotificationSearchResponse
        *************************************/
        public async Task <NotificationSearchResponse> GetNtfyEventSearch(string evtInd, string eventType, string refTo, string refKey, string startDate, string endDate)
        {
            Logger.Info("Invoking GetNtfyEventSearch function");
            var response = new NotificationSearchResponse()
            {
                Status = ResponseStatus.Failure
            };

            try
            {
                using (var scope = Container.BeginLifetimeScope())
                {
                    var    notificationSearchDAO = scope.Resolve <INotifSearchDAO>();
                    string frDate  = DateTime.ParseExact(startDate, "dd/MM/yyyy", null).ToShortDateString();
                    string toDate  = DateTime.ParseExact(endDate, "dd/MM/yyyy", null).ToShortDateString();
                    var    results = await notificationSearchDAO.WebNtfyEventSearch(evtInd, eventType, refTo, refKey, frDate, toDate);

                    if (results.Count() > 0)
                    {
                        response.lookupParameters = Mapper.Map <IList <NtfyEventSearchDTO>, IList <LookupParameters> >(results);
                    }
                }
                response.Status = ResponseStatus.Success;
            }
            catch (Exception ex)
            {
                string msg = string.Format("Error in GetNtfyEventSearch: detail:{0}", ex.Message);
                Logger.Error(msg, ex);
                response.Status  = ResponseStatus.Exception;
                response.Message = msg;
            }
            return(response);
        }
예제 #2
0
        /*************************************
        *  Created by:   Tuan Tran
        *  Created on:   April 21, 2017
        *  Function:     GetNtfyEventRcptListSelect
        *  Purpose:      GetNtfyEventRcptListSelect
        *  Inputs:       scheduleId
        *  Returns:      NotificationSearchResponse
        *************************************/
        public async Task <NotificationSearchResponse> GetNtfyEventRcptListSelect(string scheduleId)
        {
            Logger.Info("Invoking GetNtfyEventRcptListSelect function");
            var response = new NotificationSearchResponse()
            {
                Status = ResponseStatus.Failure,
            };

            try
            {
                using (var scope = Container.BeginLifetimeScope())
                {
                    var notifSearchDAO = scope.Resolve <INotifSearchDAO>();
                    var results        = await notifSearchDAO.WebNtfyEventRcptListSelect(scheduleId);

                    if (results.Count() > 0)
                    {
                        response.eventRcpts = Mapper.Map <List <EventRcptDTO>, List <EventRcptList> >(results);
                    }
                }
                response.Status = ResponseStatus.Success;
            }
            catch (Exception ex)
            {
                string msg = string.Format("Error in GetNtfyEventRcptListSelect: detail:{0}", ex.Message);
                Logger.Error(msg, ex);
                response.Status  = ResponseStatus.Exception;
                response.Message = msg;
            }
            return(response);
        }