Example #1
0
        public JsonResult RemoveReportFromDashboard(int dashboardId, int row, int column)
        {
            try
            {
                if (!_tokenManager.GenerateToken())
                {
                    return(null);
                }
                _IDashboard_Config_DetailApiConsumer.SetAuthHeader(_tokenManager.Token);

                var resultConfig = _IDashboard_Config_DetailApiConsumer.ListaSelAll(0, 100, "Dashboard_Config_Detail.Dashboard=" + dashboardId + " AND Dashboard_Config_Detail.ConfigRow=" + row + " AND Dashboard_Config_Detail.ConfigColumn=" + column, "");

                if (resultConfig.Success && resultConfig.Resource.RowCount > 0 && resultConfig.Resource.Dashboard_Config_Details.Any())
                {
                    var dashboardConfig = resultConfig.Resource.Dashboard_Config_Details.First();

                    //dashboardConfig.Report_Id = null;
                    //dashboardConfig.Report_Name = null;

                    _IDashboard_Config_DetailApiConsumer.Delete(dashboardConfig.Detail_Id, null, null);
                }
                else
                {
                    return(Json(new { Success = false }, JsonRequestBehavior.AllowGet));
                }


                return(Json(new { Success = true }, JsonRequestBehavior.AllowGet));
            }
            catch (System.Exception)
            {
                return(Json(new { Success = false }, JsonRequestBehavior.AllowGet));
            }
        }
Example #2
0
        public ActionResult Delete(int id)
        {
            try
            {
                if (!_tokenManager.GenerateToken())
                {
                    return(Json(null, JsonRequestBehavior.AllowGet));
                }
                _IDashboard_Config_DetailApiConsumer.SetAuthHeader(_tokenManager.Token);

                Dashboard_Config_Detail varDashboard_Config_Detail = null;
                if (id.ToString() != "0")
                {
                    string where = "";
                }
                var result = _IDashboard_Config_DetailApiConsumer.Delete(id, null, null).Resource;
                return(Json(result, JsonRequestBehavior.AllowGet));
            }
            catch (ServiceException ex)
            {
                return(Json(false, JsonRequestBehavior.AllowGet));
            }
        }