예제 #1
0
 public IActionResult Get(Guid id)
 {
     try
     {
         List <IndicatorConfig> indicatorConfigs =
             indicatorLogic.GetCustomIndicators(id).ToList();
         return(Ok(CustomIndicatorGetModel.ToModel(indicatorConfigs).ToList()));
     }
     catch (BusinessLogicInterfaceException e)
     {
         return(BadRequest(e.Message));
     }
 }
예제 #2
0
        public IActionResult Put(Guid id, [FromBody] CustomIndicatorUpdateModel model)
        {
            try
            {
                Guid   indicatorId = model.Id;
                bool   visible     = model.Visible;
                int    pos         = model.Position;
                string customName  = model.CustomName;
                userLogic.SetIndicatorCustomName(id, indicatorId, customName);
                userLogic.SetIndicatorPosition(id, indicatorId, pos);
                userLogic.SetIndicatorVisible(id, indicatorId, visible);

                IndicatorConfig iConfig = userLogic.GetIndicatorConfig(id, indicatorId);

                return(CreatedAtRoute("Get", new { id = indicatorId }, CustomIndicatorGetModel.ToModel(iConfig)));
            }
            catch (BusinessLogicInterfaceException e)
            {
                return(BadRequest(e.Message));
            }
        }