Esempio n. 1
0
        RecentDocs recentfiles = LifetimeService.Instance.Container.Resolve <RecentDocs>(); //21Dec2013

        public Window1(IUnityContainer container, IAnalyticsService analytics, IDashBoardService dashBoardService)
        {
            InitializeComponent();
            ///loading file when its double clicked ////

            try
            {
                //// rest of the old code //
                AssociateShortcutToolbarCommands();             //18Mar2014
                recentfiles.recentitemclick = RecentItem_Click; //
                _analyticService            = analytics;
                MainWindowMenuFactory mf = new MainWindowMenuFactory(Menu, maintoolbar, dashBoardService);
                Menu.Items.Insert(Menu.Items.Count - 2, omh.OutputMenu);       //place output menu just before 2nd-last item.
                RefreshRecent();                                               //recent menu
                Menu.Items.Insert(Menu.Items.Count - 2, chmh.CommandHistMenu); //04Mar2013 //place output menu just before 2nd-last item
            }
            catch (Exception ex)                                               //17Jan2014
            {
                MessageBox.Show("Menus can't be generated...");
                logService.WriteToLogLevel("Menus can't be generated.\n" + ex.StackTrace, LogLevelEnum.Fatal);
                this.Close();
                return;
            }

            this.WindowState = System.Windows.WindowState.Normal;
            this.Dispatcher.UnhandledException += new DispatcherUnhandledExceptionEventHandler(Dispatcher_UnhandledException);
            UIControllerService layoutController = container.Resolve <UIControllerService>();

            layoutController.DocGroup = documentContainer;
            //layoutController.LayoutManager = DockContainer;
            container.RegisterInstance <IUIController>(layoutController);
            //its too early to call it here. BlueSky R pacakge is not yet loaded   SetRDefaults();//30Sep2014
        }
        RecentDocs recentfiles = LifetimeService.Instance.Container.Resolve<RecentDocs>();//21Dec2013

        public Window1(IUnityContainer container, IAnalyticsService analytics, IDashBoardService dashBoardService)
        {
            InitializeComponent();
            ///loading file when its double clicked ////

            try
            {

                //// rest of the old code //
                AssociateShortcutToolbarCommands();//18Mar2014
                recentfiles.recentitemclick = RecentItem_Click;//
                _analyticService = analytics;
                MainWindowMenuFactory mf = new MainWindowMenuFactory(Menu, maintoolbar, dashBoardService);
                Menu.Items.Insert(Menu.Items.Count - 2, omh.OutputMenu);//place output menu just before 2nd-last item.
                RefreshRecent();//recent menu
                Menu.Items.Insert(Menu.Items.Count - 2, chmh.CommandHistMenu);//04Mar2013 //place output menu just before 2nd-last item
            }
            catch (Exception ex)//17Jan2014
            {
                MessageBox.Show("Menus can't be generated...");
                logService.WriteToLogLevel("Menus can't be generated.\n" + ex.StackTrace, LogLevelEnum.Fatal);
                this.Close();
                return;
            }

            this.WindowState = System.Windows.WindowState.Normal;
            this.Dispatcher.UnhandledException += new DispatcherUnhandledExceptionEventHandler(Dispatcher_UnhandledException);
            UIControllerService layoutController = container.Resolve<UIControllerService>();

            layoutController.DocGroup = documentContainer;
            //layoutController.LayoutManager = DockContainer;
            container.RegisterInstance<IUIController>(layoutController);
            //its too early to call it here. BlueSky R pacakge is not yet loaded   SetRDefaults();//30Sep2014
            
        }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DashboardController"/> class.
 /// </summary>
 /// <param name="logger">The logger.</param>
 /// <param name="httpContextAccessor">The HTTP context accessor.</param>
 /// <param name="baseLogger">The base logger.</param>
 /// <param name="configuration">The configuration.</param>
 /// <param name="dashBoardService">The dash board service.</param>
 /// <param name="userManager">The user manager.</param>
 public DashboardController(ILogger <DashboardController> logger, IHttpContextAccessor httpContextAccessor, ILogger <BaseController> baseLogger, IConfiguration configuration, IDashBoardService dashBoardService, UserManager <ApplicationUser> userManager) : base(baseLogger, httpContextAccessor, configuration)
 {
     this.logger = logger;
     this._httpContextAccessor = httpContextAccessor;
     this._dashBoardService    = dashBoardService;
     this._userManager         = userManager;
 }
        public Window1(IUnityContainer container, IAnalyticsService analytics, IDashBoardService dashBoardService)
        {
            InitializeComponent();
            try
            {
                //// rest of the old code //
                AssociateShortcutToolbarCommands();             //18Mar2014
                recentfiles.recentitemclick = RecentItem_Click; //
                _analyticService            = analytics;
                MainWindowMenuFactory mf = new MainWindowMenuFactory(Menu, maintoolbar, dashBoardService, "test");
                Menu.Items.Insert(Menu.Items.Count - 2, omh.OutputMenu);
                RefreshRecent();//recent menu
                Menu.Items.Insert(Menu.Items.Count - 2, chmh.CommandHistMenu);

                RDataShowWarningDialogCheck = false;
            }
            catch (Exception ex)//17Jan2014
            {
                MessageBox.Show(BSky.GlobalResources.Properties.UICtrlResources.MenuGenerationFailedMsg);
                logService.WriteToLogLevel("Menus can't be generated.\n" + ex.StackTrace, LogLevelEnum.Fatal);
                this.Close();
                return;
            }

            this.WindowState = System.Windows.WindowState.Normal;
            this.Dispatcher.UnhandledException += new DispatcherUnhandledExceptionEventHandler(Dispatcher_UnhandledException);
            UIControllerService layoutController = container.Resolve <UIControllerService>();

            layoutController.DocGroup = documentContainer;
            container.RegisterInstance <IUIController>(layoutController);

            AddGetModelControlToGrid();//Adding to the right of toolbar in its own grid.
        }
 public TimedHostedService(ILogger <TimedHostedService> logger
                           , IHubContext <DashBoardHub> hubContext, IDashBoardService IDashBoardService
                           , IMapper mapper)
 {
     _mapper            = mapper;
     _hubContext        = hubContext;
     _iDashBoardService = IDashBoardService;
 }
        public DashBoardController(
            IDashBoardService IDashBoardService
            , IMapper mapper, IHttpContextAccessor httpContextAccessor)
        {
            _mapper = mapper;
            _IHttpContextAccessor = httpContextAccessor;

            _iDashBoardService = IDashBoardService;
        }
Esempio n. 7
0
 public AddEditMealViewModel(INavigation navigation, AirlineContext context, Users users)
 {
     _navigation   = navigation;
     _context      = context;
     _boardServive = new DashBoardService(context);
     _currentUser  = users;
     SaveCommand   = new Command(Save);
     Title         = "Add New Meal";
 }
Esempio n. 8
0
 public DashBoardViewModel(INavigation navigation, AirlineContext context, Users users)
 {
     _navigation    = navigation;
     _context       = context;
     _boardServive  = new DashBoardService(context);
     AddMealCommand = new Command(AddMeal);
     _currentUser   = users;
     UserName       = _currentUser.Name;
     GetUserMeal();
 }
Esempio n. 9
0
 public MealListViewModel(INavigation navigation, AirlineContext context, Users users, Meals meal)
 {
     _navigation       = navigation;
     _context          = context;
     Meal              = meal;
     _currentUser      = users;
     _boardService     = new DashBoardService(_context);
     EditMealCommmand  = new Command(EditMeal);
     DeleteMealCommand = new Command(DeleteMeal);
 }
Esempio n. 10
0
 public void getData()
 {
     iDashBoardService   = new DashBoardService();
     labelRegLecs.Text   = iDashBoardService.getLecturersCount().ToString();
     labelRegStu.Text    = iDashBoardService.getStudentsCount().ToString();
     labelRegSubs.Text   = iDashBoardService.getSubjectsCount().ToString();
     label1RegRooms.Text = iDashBoardService.getLocationsCount().ToString();
     txtLatestLec.Text   = iDashBoardService.getLatestLecturer();
     txtLatestStu.Text   = iDashBoardService.getLatestGroupName();
     txtLatestSub.Text   = iDashBoardService.getLatestSubject();
 }
 public DashboardTimedHostedService(
     IDashBoardService dashBoardService,
     IDashBoardHubEventBase hubEventBase,
     DashBoardHub dashboardHub,
     ISerialisationHelperService serialisationHelperService,
     ILogger logger)
     : base("Dashboard", logger, serialisationHelperService)
 {
     hubEventBase.ClientHeartbeatCallback += RegisterClient;
     _dashBoardService = dashBoardService;
     _dashboardHub     = dashboardHub;
     _logger           = logger;
 }
Esempio n. 12
0
 public HomeController(
     IDashBoardService dashBoardService,
     ILogger logger,
     TelemetryClient telemetryClient,
     IHttpContextAccessor httpContextAccessor,
     AuthorizationSettings authorizationSettings)
     : base(logger, telemetryClient)
 {
     _dashBoardService      = dashBoardService;
     _logger                = logger;
     _httpContextAccessor   = httpContextAccessor;
     _authorizationSettings = authorizationSettings;
 }
Esempio n. 13
0
        public MainWindowMenuFactory(Menu menu, ToolBar maintoolbar, IDashBoardService dashBoardService, string commcode = "dsrew324$%#")
        {
            //control the generation of menuitems based on version
            Version version = Assembly.GetCallingAssembly().GetName().Version;

            strversion        = version.ToString();
            _commcode         = commcode;
            _dashBoardService = dashBoardService;
            _menu             = menu;
            _mainToolbar      = maintoolbar;
            dashBoardService.AddDashBoardItem += new EventHandler <DashBoardEventArgs>(dashBoardService_AddDashBoardItem);
            dashBoardService.Configure();//Creates menu from menu.xml
        }
        //////////////////////////////////////////////////////////////////////////////////
        //21Jul2015 Get DashBoardItems for creating toolbar icons
        private void CreateToolbarIcons()
        {
            IDashBoardService dashBoardService = LifetimeService.Instance.Container.Resolve <IDashBoardService>();

            List <DashBoardItem> dbis = dashBoardService.GetDashBoardItems(); //Creates menu from menu.xml

            CreateSomeMenus(dbis);                                            // generate Menu

            foreach (DashBoardItem dbi in dbis)                               //generate toolbar icons
            {
                AddToolbarIcon(dbi);
            }
        }
Esempio n. 15
0
 public DashBoardController(IDashBoardService service)
 {
     _service = service;
 }
        protected override void OnExecute(object param)
        {
            System.Windows.Forms.DialogResult dresult = System.Windows.Forms.MessageBox.Show(
                BSky.GlobalResources.Properties.Resources.RestartToApplyChanges +
                BSky.GlobalResources.Properties.Resources.ConfirmDialogInstall,
                BSky.GlobalResources.Properties.Resources.InstallNewDialog,
                System.Windows.Forms.MessageBoxButtons.YesNoCancel,
                System.Windows.Forms.MessageBoxIcon.Question);
            if (dresult == System.Windows.Forms.DialogResult.Yes)//save
            {
                IUnityContainer   container        = LifetimeService.Instance.Container;
                IDataService      service          = container.Resolve <IDataService>();
                IUIController     controller       = container.Resolve <IUIController>();
                IDashBoardService dashboardService = container.Resolve <IDashBoardService>();
                Window1           mainWin          = container.Resolve <Window1>();//15Jan2013

                extractedfiles = new List <string>();
                OpenFileDialog openFileDialog = new OpenFileDialog();
                openFileDialog.Filter = FileNameFilter;
                bool?output = openFileDialog.ShowDialog(Application.Current.MainWindow);
                if (output.HasValue && output.Value)
                {
                    FileStream     fileStreamIn = new FileStream(openFileDialog.FileName, FileMode.Open, FileAccess.Read);
                    ZipInputStream zipInStream = new ZipInputStream(fileStreamIn);
                    string         xamlFile = string.Empty, outputFile = string.Empty;
                    ZipEntry       entry   = zipInStream.GetNextEntry();
                    string         tempDir = Path.GetTempPath();

                    //Extract the files
                    while (entry != null)
                    {
                        //if(System.IO.File.Exists((@".\config\" + entry.Name)))
                        //{
                        //    if(MessageBox.Show("Do you want to replace existing file?","Warning",MessageBoxButton.YesNo,MessageBoxImage.Hand) == MessageBoxResult.No)
                        //        continue;
                        //}
                        FileStream fileStreamOut = new FileStream(Path.Combine(tempDir, entry.Name), FileMode.Create, FileAccess.Write);
                        if (entry.Name.EndsWith(".xaml"))
                        {
                            xamlFile = entry.Name;
                        }
                        if (entry.Name.EndsWith(".xml"))
                        {
                            outputFile = entry.Name;
                        }
                        int    size;
                        byte[] buffer = new byte[1024];
                        do
                        {
                            size = zipInStream.Read(buffer, 0, buffer.Length);
                            fileStreamOut.Write(buffer, 0, size);
                        } while (size > 0);
                        fileStreamOut.Close();
                        entry = zipInStream.GetNextEntry();
                        MessageBox.Show("Extracted:" + entry.Name + " in " + tempDir);
                        //adding fullpath filename to list //08May2015
                        extractedfiles.Add(Path.Combine(tempDir, entry.Name));
                    }
                    zipInStream.Close();
                    fileStreamIn.Close();

                    if (string.IsNullOrEmpty(outputFile))
                    {
                        MessageBox.Show(BSky.GlobalResources.Properties.Resources.CantInstallDialogNoOutFile);
                        return;
                    }
                    //Load the dialog object, check the location and modify menu file.
                    if (!string.IsNullOrEmpty(xamlFile) && !string.IsNullOrEmpty(outputFile))
                    {
                        FileStream stream = System.IO.File.Open(Path.Combine(tempDir, xamlFile), FileMode.Open);
                        try
                        {
                            object obj = XamlReader.Load(stream);
                            BSky.Controls.BSkyCanvas canvas = obj as BSky.Controls.BSkyCanvas;

                            string menulocation = canvas.MenuLocation;
                            string title        = canvas.Title;
                            if (string.IsNullOrEmpty(canvas.Title))
                            {
                                title = Microsoft.VisualBasic.Interaction.InputBox("Get Item Name", "Item Name", "New Node");
                                if (!string.IsNullOrEmpty(title))
                                {
                                    MessageBox.Show(BSky.GlobalResources.Properties.Resources.CantInstallDialogNoTitle, BSky.GlobalResources.Properties.Resources.DialogTitleEmpty);
                                    return;
                                }
                            }

                            //23Apr2015 bool? result = dashboardService.SetElementLocaton(menulocation, title, Path.Combine(@".\config\", xamlFile), false, "");
                            bool?            result    = dashboardService.SetElementLocaton(menulocation, title, Path.Combine(string.Format(@"{0}", BSkyAppData.RoamingUserBSkyConfigL18nPath), xamlFile), false, "");//23Apr2015
                            MessageBoxResult msgResult = MessageBoxResult.No;
                            if (result.HasValue && !result.Value)
                            {
                                msgResult = MessageBox.Show(BSky.GlobalResources.Properties.Resources.ConfirmDialogOverwrite, BSky.GlobalResources.Properties.Resources.WarnOverwrite, MessageBoxButton.YesNo);
                            }
                            if (result.HasValue && (result.Value || msgResult == MessageBoxResult.Yes))
                            {
                                //23Apr2015 canvas.OutputDefinition = Path.GetFullPath(@".\Config\" + outputFile);
                                canvas.OutputDefinition = Path.GetFullPath(string.Format(@"{0}", BSkyAppData.RoamingUserBSkyConfigL18nPath) + outputFile);//23Apr2015

                                System.IO.File.Copy(Path.Combine(tempDir, outputFile), canvas.OutputDefinition, true);

                                string xaml = XamlWriter.Save(canvas);
                                //23Apr2015 FileStream outputstream = System.IO.File.Create(@".\Config\" + xamlFile);
                                FileStream outputstream = System.IO.File.Create(string.Format(@"{0}", BSkyAppData.RoamingUserBSkyConfigL18nPath) + xamlFile);//23Apr2015
                                TextWriter writer       = new StreamWriter(outputstream);
                                writer.Write(xaml);
                                writer.Close();

                                MessageBox.Show(BSky.GlobalResources.Properties.Resources.RestartToApplyChanges2, BSky.GlobalResources.Properties.Resources.DialogInstalled);
                            }
                            else
                            {
                                string sInput            = "New Command Node";
                                string aboveBelowSibling = "Below";//position of new command based on sibling location. Enum can be used for Above/Below
                                string location          = dashboardService.SelectLocation(ref sInput, ref aboveBelowSibling);
                                //sInput is prefixed to XAML and XML filenames. You can think of dropping it for prefixing
                                //string sInput = Microsoft.VisualBasic.Interaction.InputBox("Get Item Name", "Item Name", "Command Name");
                                if (!string.IsNullOrEmpty(location))
                                {
                                    //string sInputNoBlanks = sInput.Replace(' ','_');//26sep2012
                                    //23Apr2015 dashboardService.SetElementLocaton(location, sInput, Path.Combine(@".\Config\", sInput + xamlFile), true, aboveBelowSibling);
                                    dashboardService.SetElementLocaton(location, sInput, Path.Combine(string.Format(@"{0}", BSkyAppData.RoamingUserBSkyConfigL18nPath), sInput + xamlFile), true, aboveBelowSibling);//23Apr2015

                                    ///12Oct2012 canvas.OutputDefinition = Path.GetFullPath(@".\config\" + sInput + outputFile);///output template filename will be same as in zip
                                    //23Apr2015 canvas.OutputDefinition = Path.GetFullPath(@".\Config\" + sInput + xamlFile.Replace("xaml", "xml"));///output template filename will be same as dialog filename. No matter whats in zip file.
                                    canvas.OutputDefinition = Path.GetFullPath(string.Format(@"{0}", BSkyAppData.RoamingUserBSkyConfigL18nPath) + sInput + xamlFile.Replace("xaml", "xml"));//23Apr2015 //output template filename will be same as dialog filename. No matter whats in zip file.

                                    System.IO.File.Copy(Path.Combine(tempDir, outputFile), canvas.OutputDefinition, true);

                                    ///Following commented lines should not execute 17Jan2013
                                    ///These are writing a xaml and putting datatemplate tag in XAML while installing.
                                    //string xaml = XamlWriter.Save(canvas);
                                    //FileStream outputstream = System.IO.File.Create(@".\Config\" + sInput + xamlFile);
                                    //TextWriter writer = new StreamWriter(outputstream);
                                    //writer.Write(xaml);
                                    //writer.Close();
                                    //23Apr2015 string installpath = Path.GetFullPath(@".\Config\" + sInput + xamlFile);
                                    string installpath = Path.GetFullPath(string.Format(@"{0}", BSkyAppData.RoamingUserBSkyConfigL18nPath) + sInput + xamlFile);//23Apr2015

                                    System.IO.File.Copy(Path.Combine(tempDir, xamlFile), installpath, true);

                                    MessageBox.Show(BSky.GlobalResources.Properties.Resources.RestartToApplyChanges2, BSky.GlobalResources.Properties.Resources.DialogInstalled);
                                    mainWin.Window_Refresh_Menus();//15Jan2013
                                }
                            }
                            CleanTempFiles();
                        }
                        catch (Exception e)
                        {
                            MessageBox.Show(BSky.GlobalResources.Properties.Resources.CantInstallDialog, BSky.GlobalResources.Properties.Resources.InstallFailed);
                            logService.WriteToLogLevel("Couldn't install Dialog", LogLevelEnum.Error);
                        }
                    }
                }
            }
        }
 public HomeController(IDashBoardService dashBoardService)
 {
     this.dashBoardService = dashBoardService;
 }
Esempio n. 18
0
 public DashBoardAPIController(IDashBoardService IDashBoardService)
 {
     _IDashBoardService = IDashBoardService;
 }
Esempio n. 19
0
 public DashBoardController(IDashBoardService service) : base(service)
 {
     _srv = service;
 }
Esempio n. 20
0
 public DashboardController(IDashBoardService dashBoardService)
 {
     this.dashBoardService = dashBoardService;
 }
Esempio n. 21
0
 public DashboardController(IDashBoardService service)
 {
     this.service = service;
 }
Esempio n. 22
0
 public DashBoardController(IDashBoardService dashBoardService)
 {
     _dashBoardService = dashBoardService;
 }
Esempio n. 23
0
 public void loadChartLocations()
 {
     iDashBoardService = new DashBoardService();
     this.chartLocations.Series["Lecture Rooms"].Points.AddXY("Locations", iDashBoardService.getLecCount());
     this.chartLocations.Series["Laboratories"].Points.AddXY("Locations", iDashBoardService.getLabCount());
 }
 public PurchaseDashboardController(IDashBoardService dashBoardService, IPurchaseDashboardService purchaseDashboardService)
 {
     _dashBoardService         = dashBoardService;
     _purchaseDashboardService = purchaseDashboardService;
 }
 public DashBoardController(IDashBoardService dashBoardServices)
 {
     _dashBoardServices = dashBoardServices;
 }
Esempio n. 26
0
 public HomeController(IDashBoardService dashBoardService, IDomainHelper domainHelper, IAuditService auditService)
 {
     _dashBoardService = dashBoardService;
     _domainHelper     = domainHelper;
     _auditService     = auditService;
 }
 public DashboardController(IDashBoardService dashBoardService, ISalesDashboardService salesDashboardService)
 {
     _dashBoardService      = dashBoardService;
     _salesDashboardService = salesDashboardService;
 }
Esempio n. 28
0
 public DashBoardController(IDashBoardService IDashBoardService, IUserService IUserService, IDataService IDataService)
 {
     _iUserService      = IUserService;
     _iDashBoardService = IDashBoardService;
     _iDataService      = IDataService;
 }
 public DashBoardController(IDashBoardService iDashBoardService, IMapper mapper)
 {
     this._IDashBoardService = iDashBoardService;
     _mapper = mapper;
 }
 public DashBoardController(IDashBoardService dashBoardService)
 {
     _dashBoardService = dashBoardService;
 }
Esempio n. 31
0
 public DashBoardOrchestrator(IDashBoardService IDashBoardService)
 {
     this._IDashBoardService = IDashBoardService;
 }
 public DashBoardController(IDashBoardService dashBoardService, ILogger <DashBoardController> logger)
 {
     _dashBoardService = dashBoardService;
     _logger           = logger;
 }