Esempio n. 1
0
        public JsonResult GetDashBorad()
        {
            DashBoardService dashBoardService = new DashBoardService();
            var data = dashBoardService.Get();

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
Esempio n. 2
0
 public void Refresh()
 {
     DisplayedBlocks = new List <DashboardBlock>(0);
     if (DisplayedBlocks.Count == 0)
     {
         Dictionary <string, object>   dico           = new Dictionary <string, object>(0);
         List <DashBoardConfiguration> configurations = DashBoardService.getAllDashboardConfiguration(userOid);
         if (configurations == null || configurations.Count == 0)
         {
             if (ApplicationManager.Instance.ApplcationConfiguration.IsReconciliationDomain())
             {
                 configurations.Add(new DashBoardConfiguration(FunctionalitiesLabel.INITIATION_MODEL_LABEL, 1, userOid));
                 configurations.Add(new DashBoardConfiguration(FunctionalitiesLabel.AUTOMATIC_SOURCING_DASHBOARD_LABEL, 2, userOid));
                 configurations.Add(new DashBoardConfiguration(FunctionalitiesLabel.RECONCILIATION_FILTER_DASHBOARD_LABEL, 3, userOid));
                 configurations.Add(new DashBoardConfiguration(FunctionalitiesLabel.REPORT_LABEL, 4, userOid));
             }
             else
             {
                 configurations.Add(new DashBoardConfiguration(FunctionalitiesLabel.INITIATION_MODEL_LABEL, 1, userOid));
                 configurations.Add(new DashBoardConfiguration(FunctionalitiesLabel.TRANSFORMATION_LABEL, 2, userOid));
                 configurations.Add(new DashBoardConfiguration(FunctionalitiesLabel.INPUT_TABLE_LABEL, 3, userOid));
                 configurations.Add(new DashBoardConfiguration(FunctionalitiesLabel.REPORT_LABEL, 4, userOid));
             }
             configurations = DashBoardService.saveListDashboardConfiguration(configurations, userOid);
             if (configurations == null)
             {
                 configurations = new List <DashBoardConfiguration>(0);
             }
         }
         foreach (DashBoardConfiguration configuration in configurations)
         {
             DashboardBlock block = GetBlockByConfiguration(configuration);
             if (block == null)
             {
                 continue;
             }
             block.Configuration = configuration;
             if (DisplayedBlocks.Count >= MAX_BLOCK)
             {
                 break;
             }
             if (configuration.position == DashBoardConfiguration.DEFAULT_POSITION)
             {
                 continue;
             }
             if (dico.ContainsKey(block.TitleLabel.Content.ToString()))
             {
                 continue;
             }
             DisplayedBlocks.Add(block);
             dico.Add(block.TitleLabel.Content.ToString(), block);
         }
         this.MultiSelectorCombobox.SelectedItems = dico;
     }
     foreach (DashboardBlock block in DisplayedBlocks)
     {
         RefreshData(block);
     }
     Display(this.DisplayedBlocks);
 }
 public AdminController(AdminService _AdminService, DashBoardService _DashBoardService,
                        ResultViewModel <AdminViewModel> _ResultViewModel)
 {
     AdminService     = _AdminService;
     DashBoardService = _DashBoardService;
     ResultViewModel  = _ResultViewModel;
 }
Esempio n. 4
0
        public void RefreshData()
        {
            if (DashBoardService == null)
            {
                return;
            }
            List <BrowserData> datas = DashBoardService.getDashboardDatas(GetParam());

            this.SetData(datas);
        }
Esempio n. 5
0
 /// <summary>
 /// Gets InputTableService
 /// </summary>
 public DashBoardService GetDashBoardService()
 {
     if (dashBoardService == null)
     {
         dashBoardService = new DashBoardService();
         dashBoardService.ResourcePath = ResourcePath.DASHBOARD_RESOURCE_PATH;
         configureService(dashBoardService);
     }
     return(dashBoardService);
 }
Esempio n. 6
0
 public void RemoveBlock(DashboardBlock block)
 {
     if (block == null)
     {
         return;
     }
     if (block.Configuration != null)
     {
         block.Configuration.position = DashBoardConfiguration.DEFAULT_POSITION;
         block.Configuration          = DashBoardService.saveDashboardConfiguration(block.Configuration, userOid);
     }
     block.Reset();
     this.DisplayedBlocks.Remove(block);
     Display(this.DisplayedBlocks);
 }
Esempio n. 7
0
        public JsonResult UploadPictures()
        {
            JsonResult result = new JsonResult();

            List <Picture> pics = new List <Picture>();

            DashBoardService dashBoardService = new DashBoardService();

            if (Request.Files != null)
            {
                var files = Request.Files;
                for (int i = 0; i < files.Count; i++)
                {
                    var picture = files[i];

                    var fileName = Guid.NewGuid() + Path.GetExtension(picture.FileName);

                    var loadFileName = Server.MapPath("~/images/site/") + fileName;

                    picture.SaveAs(loadFileName);

                    var picObject = new Picture()
                    {
                        URL = fileName
                    };

                    if (dashBoardService.SavePicture(picObject))
                    {
                        pics.Add(picObject);
                        iDs.Add(picObject.Id);
                    }
                }

                result.Data = pics;
            }
            else
            {
                result.Data = "File cannot be null!";
            }


            return(result);
        }
Esempio n. 8
0
        public void AddBlock(DashboardBlock block)
        {
            if (block == null)
            {
                return;
            }
            if (DisplayedBlocks.Count >= MAX_BLOCK)
            {
                return;
            }
            DashBoardConfiguration configuration = DashBoardService.getDashboardConfigurationByName(block.TitleLabel.Content.ToString(), this.userOid);

            if (configuration == null)
            {
                configuration = new DashBoardConfiguration(block.TitleLabel.Content.ToString(), DisplayedBlocks.Count);
            }
            configuration.position = DisplayedBlocks.Count + 1;
            block.Configuration    = DashBoardService.saveDashboardConfiguration(configuration, userOid);

            RefreshData(block);
            this.DisplayedBlocks.Add(block);
            Display(this.DisplayedBlocks);
        }
Esempio n. 9
0
 public DashBoardController()
 {
     service = new DashBoardService();
 }
 public HomeController(DashBoardService dashBoardService, LookUpServices lookUpServices)
 {
     _dashBoardService = dashBoardService;
     _lookUpServices   = lookUpServices;
 }