Ejemplo n.º 1
0
        /*************************************
        *  Created by:   Tuan Tran
        *  Created on:   April 18, 2017
        *  Function:     GetNotifyEventConfDetails
        *  Purpose:      GetNotifyEventConfDetails
        *  Inputs:       userId
        *  Returns:      EventConfigResponse
        *************************************/
        public async Task <EventConfigResponse> GetNotifyEventConfDetails(string userId)
        {
            Logger.Info("Invoking GetNotifyEventConfDetails fuction use EF to call SP");
            var response = new EventConfigResponse()
            {
                Status = ResponseStatus.Failure,
            };

            try
            {
                using (var scope = Container.BeginLifetimeScope())
                {
                    var eventConfigDAO = scope.Resolve <IEventConfigDAO>();
                    var results        = await eventConfigDAO.GetNtfyEvtConfListSelect(userId);

                    if (results.Count() > 0)
                    {
                        response.lookupParameters = Mapper.Map <List <WebNtfyEvtConfDetailDTO>, List <LookupParameters> >(results);
                    }
                }
                response.Status = ResponseStatus.Success;
            }
            catch (Exception ex)
            {
                string msg = string.Format("Error in GetNotifyEventConfDetails: detail:{0}", ex.Message);
                Logger.Error(msg, ex);
                response.Status  = ResponseStatus.Exception;
                response.Message = msg;
            }
            return(response);
        }
Ejemplo n.º 2
0
        /*************************************
        *  Created by:   Tuan Tran
        *  Created on:   April 20, 2017
        *  Function:     GetRefCmpyName
        *  Purpose:      GetRefCmpyName
        *  Inputs:       refTo,refKey
        *  Returns:      string
        *************************************/
        public async Task <string> GetRefCmpyName(string selectedRefTo, string refKey)
        {
            Logger.Info("Invoking GetRefCmpyName fuction use EF to call SP");
            var response = new EventConfigResponse()
            {
                Status = ResponseStatus.Failure
            };

            try
            {
                using (var scope = Container.BeginLifetimeScope())
                {
                    var eventConfigDAO = scope.Resolve <IEventConfigDAO>();
                    var cpnName        = await eventConfigDAO.WebGetRefCmpyName(selectedRefTo, refKey);

                    response.CmpyName = cpnName;
                }
                response.Status = ResponseStatus.Success;
            }
            catch (Exception ex)
            {
                string msg = string.Format("Error in GetRefCmpyName: detail:{0}", ex.Message);
                Logger.Error(msg, ex);
                response.Status  = ResponseStatus.Exception;
                response.Message = msg;
            }
            return(response.CmpyName);
        }
Ejemplo n.º 3
0
        /*************************************
        *  Created by:   Tuan Tran
        *  Created on:   june 26, 2017
        *  Function:     GetEventAcctConfSelect
        *  Purpose:      GetEventAcctConfSelect
        *  Inputs:       eventTypeId,eventScheduleId,acctNo
        *  Returns:      EventConfigResponse
        *************************************/
        public async Task <EventConfigResponse> GetEventAcctConfSelect(string eventTypeId, string eventScheduleId, string acctNo)
        {
            Logger.Info("Invoking GetEventAcctConfSelect fuction use EF to call SP");
            var response = new EventConfigResponse()
            {
                Status = ResponseStatus.Failure
            };

            try
            {
                using (var scope = Container.BeginLifetimeScope())
                {
                    var eventConfigDAO = scope.Resolve <IEventConfigDAO>();
                    var results        = await eventConfigDAO.WebEventAcctConfSelect(eventTypeId, eventScheduleId, acctNo);

                    if (results.Count() > 0)
                    {
                        response.lookupParameters = Mapper.Map <List <NtfyEventConfDTO>, List <LookupParameters> >(results);
                    }
                }
                response.Status = ResponseStatus.Success;
            }
            catch (Exception ex)
            {
                string msg = string.Format("Error in GetEventAcctConfSelect: detail:{0}", ex.Message);
                Logger.Error(msg, ex);
                response.Status  = ResponseStatus.Exception;
                response.Message = msg;
            }
            return(response);
        }
Ejemplo n.º 4
0
        /*************************************
        *  Created by:   Tuan Tran
        *  Created on:   june 26, 2017
        *  Function:     GetEventAcctRcpts
        *  Purpose:      GetEventAcctRcpts
        *  Inputs:       eventScheduleId
        *  Returns:      EventConfigResponse
        *************************************/
        public async Task <EventConfigResponse> GetEventAcctRcpts(string eventScheduleId)
        {
            Logger.Info("Invoking GetEventAcctRcpts fuction use EF to call SP");
            var response = new EventConfigResponse()
            {
                Status = ResponseStatus.Failure
            };

            try
            {
                using (var scope = Container.BeginLifetimeScope())
                {
                    var eventConfigDAO = scope.Resolve <IEventConfigDAO>();
                    var results        = await eventConfigDAO.WebEventAcctRcptListSelect(eventScheduleId);

                    if (results.Count() > 0)
                    {
                        response.eventRcpts = results;
                    }
                }
                response.Status = ResponseStatus.Success;
            }
            catch (Exception ex)
            {
                string msg = string.Format("Error in GetEventAcctRcpts: detail:{0}", ex.Message);
                Logger.Error(msg, ex);
                response.Status  = ResponseStatus.Exception;
                response.Message = msg;
            }
            return(response);
        }
Ejemplo n.º 5
0
        /*************************************
        *  Created by:   Tuan Tran
        *  Created on:   April 18, 2017
        *  Function:     GetNtfyEventConf
        *  Purpose:      GetNtfyEventConf
        *  Inputs:       planId
        *  Returns:      EventConfigResponse
        *************************************/
        public async Task <EventConfigResponse> GetNtfyEventConf(string planId)
        {
            Logger.Info("Invoking GetNtfyEventConf fuction use EF to call SP");
            var response = new EventConfigResponse()
            {
                Status = ResponseStatus.Failure,
            };

            try
            {
                using (var scope = Container.BeginLifetimeScope())
                {
                    var eventConfigDAO = scope.Resolve <IEventConfigDAO>();
                    var results        = await eventConfigDAO.WebNtfyEventConfSelect(planId);

                    foreach (var item in results)
                    {
                        item.EventScheduleId = Convert.ToInt64(planId);
                    }
                    if (results.Count() > 0)
                    {
                        response.lookupParameters = Mapper.Map <List <NtfyEventConfDTO>, List <LookupParameters> >(results);
                    }
                }
                response.Status = ResponseStatus.Success;
            }
            catch (Exception ex)
            {
                string msg = string.Format("Error in GetNtfyEventConf: detail:{0}", ex.Message);
                Logger.Error(msg, ex);
                response.Status  = ResponseStatus.Exception;
                response.Message = msg;
            }
            return(response);
        }