示例#1
0
        public IActionResult GetTasks([FromBody] REQ_TASK request)
        {
            RES_TASK oResult = new RES_TASK();

            IList <TASK>     oTasks    = new List <TASK>();
            IList <MESSAGER> oMessages = new List <MESSAGER>();

            try
            {
                oTasks = request.ToTaskMockup();
                oMessages.Add(new MESSAGER()
                {
                    CODE = MESSAGE_TYPE.SUCCESS
                });
            }
            catch (Exception ex)
            {
                oMessages.Add(new MESSAGER()
                {
                    CODE = MESSAGE_TYPE.ERROR, MESSAGE = ex.Message
                });
            }
            finally
            {
                oResult.TASKS    = oTasks;
                oResult.MESSAGES = oMessages;
            }
            return(Ok(oResult));
        }
示例#2
0
        public IActionResult GetTasks([FromBody] REQ_TASK pRequest)
        {
            IList <TASK>    oActions = new List <TASK>();
            List <Messages> oMessage = new List <Messages>();
            RES_TASK        oResult  = new RES_TASK();

            try
            {
                oActions = this.REQ_TASK();
                oMessage.Add(Messages.CreateInstance());
            }
            catch (Exception ex)
            {
                oMessage.Add(Messages.CreateFailInstance(ex));
            }
            finally
            {
                oResult.TASKS    = oActions;
                oResult.MESSAGES = oMessage;
            }
            return(Ok(oResult));
        }