コード例 #1
0
        protected override void OnInit(EventArgs e)
        {
            if (int.TryParse(Request.QueryString["mid"], out ModuleID) && ModuleID == 0 && Request.QueryString.Get("guid") != null && !string.IsNullOrEmpty(Request.QueryString.Get("guid")))
            {
                ext = MenuManager.GetExtentions(false).Where(x => x.SettingGuid == Guid.Parse(Request.QueryString.Get("guid"))).FirstOrDefault();
                if (ext == null)
                {
                    ext = ToolbarManager.GetExtentions().Where(x => x.SettingGuid == Guid.Parse(Request.QueryString.Get("guid"))).FirstOrDefault();
                }

                if (ext == null)
                {
                    ext = AppManager.GetExtentions(AppType.None).Where(x => x.SettingGuid == Guid.Parse(Request.QueryString.Get("guid"))).FirstOrDefault();
                }

                if (ext == null)
                {
                    ext = Core.Managers.BlockManager.GetExtentions().Where(x => x.Guid == Guid.Parse(Request.QueryString.Get("guid"))).FirstOrDefault();
                }

                if (ext == null)
                {
                    ext = Core.Managers.ExtensionManager.Extentions.Where(x => x.SettingGuid == Guid.Parse(Request.QueryString.Get("guid"))).FirstOrDefault();
                }
            }
            base.OnInit(e);
            WebForms.LinkCSS(Page, "extensioncommoncss", Page.ResolveUrl("~/DesktopModules/Vanjaro/UXManager/Library/Resources/StyleSheets/common.css"));
            FrameworkManager.Load(this, "FontAwesome");

            //For ThemeBuilder
            if (!string.IsNullOrEmpty(Request.QueryString["guid"]) && Request.QueryString["guid"].ToLower() == "726c5619-e193-4605-acaf-828576ba095a")
            {
                FrameworkManager.Load(this, "SpectrumColorPicker");
            }
        }
コード例 #2
0
        public void TestGet()
        {
            var manager = new FrameworkManager();
            var result  = manager.Get();

            Assert.IsTrue(result.Success);
        }
コード例 #3
0
ファイル: Bootstrapper.cs プロジェクト: anndream/ErpAlgerie
        protected override void Configure()
        {
            try
            {
                SetupDb();
                // Check and update modules
                var updateModules = Properties.Settings.Default.UpdateModules;
                FrameworkManager.UpdateModules(updateModules);

                // Init admin
                FrameworkManager.AdminExists(true);

                // Clean data and files
                FrameworkManager.CleanFiles();

                // Reload new modules
                FrameworkManager.ReloadModules();

                // Load Settings in memory
                DataHelpers.PosSettings = PosSettings.getInstance();

                var viewManager = this.Container.Get <ViewManager>();
                var setting     = new ElvaSettings().getInstance();
                DataHelpers.Settings = setting;
            }
            catch (Exception s)
            {
                MessageBox.Show(s.Message);
            }
        }
コード例 #4
0
        public void Installer()
        {
            if (FileLoded && !string.IsNullOrWhiteSpace(ModulePath))
            {
                try
                {
                    FrameworkManager.InstallPlugin(ModulePath, _safeFileName, FrameworkManager.InstallMode.Zip);
                    var _doRestart = _windowManager.ShowMessageBox(_("Veuillez relancer l'application pour activer le module"), _("Relancer"), System.Windows.MessageBoxButton.OK);

                    //if (_doRestart == System.Windows.MessageBoxResult.Yes)
                    //{
                    //    System.Windows.Forms.Application.Restart();
                    //    System.Windows.Application.Current.Shutdown();
                    //}
                }
                catch (Exception s)
                {
                    _windowManager.ShowMessageBox(s.Message);
                    return;
                }
            }
            else
            {
                _windowManager.ShowMessageBox(_("Charger un module '.zip' pour l'installer"));
                return;
            }
        }
コード例 #5
0
ファイル: DocumentBase.cs プロジェクト: zhkLearn/luaedit2010
        protected virtual bool TerminateDocument()
        {
            try
            {
                ContentChanged  = null;
                DiskFileChanged = null;
                ModifiedChanged = null;
                ReadOnlyChanged = null;
                _fileWatcher.Dispose();

                if (this.DockContent != null)
                {
                    this.DockContent.Close();
                }

                _terminated = true;
                RaiseDocumentTerminatedEvent();
                DocumentTerminated = null;
            }
            catch (Exception e)
            {
                string msg = string.Format("Error while closing document '{0}': {1}", this.FileName, e.Message);
                FrameworkManager.ShowMessageBox(msg, MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }

            return(true);
        }
コード例 #6
0
        public App() : base()
        {
            OpenFrameworkContext = new AppContext();
            SpringContext        = new XmlApplicationContext("AutumnBoxAop.atmbxml");
            OpenFrameworkManager = new FrameworkManager(OpenFrameworkContext);
#if PAID_VERSION
            AccountManager = SpringContext.GetObject <IAccountManager>("accountManager");
#endif
        }
コード例 #7
0
        public void GenerateTestJSON()


        {
            FrameworkManager FM   = new FrameworkManager();
            AspectsManager   AM   = new AspectsManager();
            AnswersManager   ASWM = new AnswersManager();
            QuestionsManager QM   = new QuestionsManager();

            NurseSelfAssessmentAnswersManager NSAM = new NurseSelfAssessmentAnswersManager();
            //Get Aspects
            var aspect_Resul = AM.Get();
            var aspects_List = (List <AspectEntity>)aspect_Resul.Entity;
            var aspects_Dict = aspects_List.ToDictionary(x => x.AspectId, x => x);



            //Get Answers
            var answers_result = ASWM.Get();
            var answers_List   = (List <AnswerEntity>)answers_result.Entity;
            var answers_Dict   = answers_List.ToDictionary(x => (x.QuestionId, x.Value), x => x);

            //Get Questions
            var questions_result = QM.Get();
            var questions_List   = (List <QuestionEntity>)questions_result.Entity;
            var question_Dict    = questions_List.ToDictionary(x => x.AspectId, x => x);

            var criteria = new Dictionary <int, AnswerEntity>();

            var criteria_entity = new ListingCriteriaModel();

            criteria_entity.EmmployerId  = 1;
            criteria_entity.JobListingId = 3;

            decimal value = (decimal)0.66;

            for (int i = 1; i <= 30; i++)
            {
                var question = question_Dict[i];
                var answer   = new AnswerEntity();
                if (answers_Dict.TryGetValue((question.QuestionId, value), out answer))
                {
                    criteria.Add(i, answer);
                }
                ;
            }
            criteria_entity.Answers = criteria;

            var json = JsonConvert.SerializeObject(criteria_entity);

            Console.WriteLine(json);



            Assert.IsTrue(true);
        }
コード例 #8
0
        static void Main(string[] args)
        {
            Console.WriteLine("//Reconstructing database //");
            FrameworkManager FM = new FrameworkManager();
            AspectsManager   AM = new AspectsManager();

            var aspect_R = AM.Get();

            ObjectDumper.Dump(aspect_R.Entity);
        }
コード例 #9
0
ファイル: DebugCommands.cs プロジェクト: zhkLearn/luaedit2010
        public override RPCCommand DoCommand()
        {
            // Open the document and break at the current line
            if (File.Exists(this.FileName))
            {
                DocumentsManager.Instance.OpenDocument(this.FileName, false);
            }

            string errFormatStr = string.Empty;
            string errMsg       = string.Empty;

            switch ((ErrorTypes)Enum.ToObject(typeof(ErrorTypes), this.ErrorType))
            {
            case ErrorTypes.SyntaxError: errFormatStr = "Syntax Error at line {0}: {1}"; break;

            case ErrorTypes.RuntimeError: errFormatStr = "Runtime Error at line {0}: {1}"; break;

            case ErrorTypes.MemoryError: errFormatStr = "Memory Error: {0}"; break;

            case ErrorTypes.Unhandled: errFormatStr = "Unhandled Error at line {0}: {1}"; break;
            }

            FrameworkManager.Instance.FlashMainDialog();

            if ((ErrorTypes)this.ErrorType == ErrorTypes.MemoryError)
            {
                errMsg = string.Format(errFormatStr, this.Message);
                FrameworkManager.ShowMessageBox(errMsg, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if ((ErrorTypes)this.ErrorType == ErrorTypes.Unhandled)
            {
                errMsg = string.Format(errFormatStr, this.Line, this.Message);
                FrameworkManager.ShowMessageBox(errMsg, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                errMsg = string.Format(errFormatStr, this.Line, this.Message);
                DialogResult dr = FrameworkManager.ShowMessageBox(errMsg, MessageBoxButtons.AbortRetryIgnore,
                                                                  MessageBoxIcon.Error);
                DebugAction debugAction = DebugAction.None;

                switch (dr)
                {
                case DialogResult.Retry: debugAction = DebugAction.Break; break;

                case DialogResult.Abort: debugAction = DebugAction.Stop; break;

                case DialogResult.Ignore: debugAction = DebugAction.Continue; break;
                }

                return(new DebugActionCommand(debugAction));
            }

            return(null);
        }
コード例 #10
0
 public void InstallDefaultUser()
 {
     try
     {
         FrameworkManager.AdminExists(true);
     }
     catch (Exception s)
     {
         SetError(s.Message);
     }
 }
コード例 #11
0
 public void ReloadAllModules()
 {
     try
     {
         var updateModules = Properties.Settings.Default.UpdateModules;
         FrameworkManager.UpdateModules(updateModules);
     }
     catch (Exception s)
     {
         SetError(s.Message);
     }
 }
コード例 #12
0
 private void CheckForNewModules()
 {
     try
     {
         // Reload new modules
         FrameworkManager.ReloadModules();
     }
     catch (Exception s)
     {
         SetError(s.Message);
     }
 }
コード例 #13
0
        public void VlidateLicence()
        {
            if (string.IsNullOrWhiteSpace(licenceFile))
            {
                MessageBox.Show("Charger votre licence d'abord");
                return;
            }
            if (string.IsNullOrWhiteSpace(clePublic))
            {
                MessageBox.Show("Clé public obligatoire!");
                return;
            }

            if (string.IsNullOrWhiteSpace(email) || string.IsNullOrEmpty(userName))
            {
                MessageBox.Show("Vérifer nom d'utilsateur ou email");
                return;
            }

            using (var publicK = new StreamWriter("public-lcs"))
            {
                publicK.Write(clePublic);
                publicK.Close();
            }


            File.Copy(licenceFile, "License.lic", true);

            try
            {
                if (FrameworkManager.ValidateLicence(clePublic, userName, email))
                {
                    MessageBox.Show("Licence validée");
                    var settings = new ElvaSettings().getInstance();
                    settings.UserName = userName;
                    settings.Email    = email;
                    settings.Save();
                    IsValide = true;
                    this.RequestClose();
                }
                else
                {
                    IsValide = false;
                    MessageBox.Show("Licence invalide");
                }
            }
            catch (Exception s)
            {
                MessageBox.Show(s.Message);
            }
        }
コード例 #14
0
ファイル: Program.cs プロジェクト: thrixton/edsdk-wrapper
        private static void frameworkTesting()
        {
            using (var f = new FrameworkManager())
            {
                foreach (var camera in f.Cameras)
                {
                    using (camera)
                    {
                        camera.SaveTo = SaveTo.Both;

                        Console.WriteLine(camera.ProductName);

                        foreach (var item in EnumUtilities.GetEnumValues <WhiteBalance>())
                        {
                            camera.WhiteBalance = item;
                        }

                        foreach (var item in camera.SupportedISOSensitivityValues)
                        {
                            camera.ISOSensitivity = item;
                        }
                        foreach (var item in camera.SupportedMeteringModes)
                        {
                            camera.MeteringMode = item;
                        }

                        foreach (var item in camera.SupportedApertureValues)
                        {
                            camera.ApertureValue = item;
                        }

                        foreach (var item in camera.SupportedShutterSpeeds)
                        {
                            camera.ShutterSpeed = item;
                        }

                        foreach (var item in camera.SupportedExposureCompensations)
                        {
                            camera.ExposureCompensation = item;
                        }

                        while (true)
                        {
                            Thread.Sleep(50);
                        }
                    }
                }
            }
        }
コード例 #15
0
 public void InitSeries()
 {
     try
     {
         // setup series
         FrameworkManager.CreateSeries();
         //var setting = ElvaSettings.getInstance();
         //setting.AppInitialized = true;
         //setting.Save();
     }
     catch (Exception s)
     {
         SetError(s.Message);
     }
 }
コード例 #16
0
        public void ActivateDemo()
        {
            if (string.IsNullOrWhiteSpace(clePublic))
            {
                MessageBox.Show("Clé public obligatoire!");
                return;
            }
            using (var publicK = new StreamWriter("public-lcs"))
            {
                publicK.Write(clePublic);
                publicK.Close();
            }

            var used = new ElvaSettings().getInstance().DemoUsed;

            if (false)
            {
                MessageBox.Show("Licence demo expirée, Contactez votre fournisseur/ 0665 97 76 79 / [email protected]");
                return;
            }
            else
            {
                FrameworkManager.CreateLicenceTrial(userName, email);
                try
                {
                    if (FrameworkManager.ValidateLicence(clePublic, userName, email))
                    {
                        MessageBox.Show("Licence validée");
                        IsValide = true;
                        this.RequestClose();
                    }
                    else
                    {
                        MessageBox.Show("Licence invalide");
                        IsValide = false;
                    }
                }
                catch (Exception s)
                {
                    MessageBox.Show(s.Message);
                }
            }
        }
コード例 #17
0
 public static void AddModules()
 {
     try
     {
         OpenFileDialog add = new OpenFileDialog();
         var            res = add.ShowDialog();
         add.DefaultExt = "dll";
         if (res == true)
         {
             var fullpath = Path.GetFullPath(add.FileName);
             FrameworkManager.InstallPlugin(fullpath, add.SafeFileName, FrameworkManager.InstallMode.Path);
         }
     }
     catch (Exception s)
     {
         DataHelpers.ShowMessage(s.Message);
         return;
     }
 }
コード例 #18
0
        public void ReloadSeries()
        {
            try
            {
                var res = DataHelpers.ShowMessage("Voulez-vous effacer les anciennes séries?", "Confirmation", MessageBoxButton.YesNo);
                if (res == MessageBoxResult.Yes)
                {
                    FrameworkManager.CreateSeries(true);
                }
                else
                {
                    FrameworkManager.CreateSeries(false);
                }

                DataHelpers.ShowMessage("Crétion des séries par default terminé.");
            }
            catch (Exception s)
            {
                DataHelpers.ShowMessage(s.Message);
            }
        }
コード例 #19
0
ファイル: Bootstrapper.cs プロジェクト: anndream/ErpAlgerie
        protected override void OnLaunch()
        {
            try
            {
                base.OnLaunch();
                FrameworkManager.CreateCulture();

                // TEMP
                // FrameworkManager.GenerateLicence();
                // FrameworkManager.CreateLicenceTrial("admin", "admin");
                // FrameworkManager.CreateLicenceStandard("pos", "*****@*****.**");

                // Check AppInit

                var setting = new ElvaSettings().getInstance();

                FrameworkManager.CheckValidation();

                if (setting.AppInitialized == false)
                {
                    MessageBox.Show("Configuration de premiére utilisation");

                    // Setup modules
                    FrameworkManager.UpdateModules();

                    // setup series
                    FrameworkManager.CreateSeries();

                    setting.AppInitialized = true;
                    setting.Save();

                    MessageBox.Show("Configuration terminée");
                }
            }
            catch (Exception s)
            {
                MessageBox.Show(s.Message);
            }
        }
コード例 #20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            WebForms.RegisterStartupScript(Page, App.Name + "-UIEngineAngularBootstrapPath", "<script>var " + App.Name + "_UIEngineAngularBootstrapPath ='" + UIEngineAngularBootstrapPath + "'; var " + App.Name + "_UITemplatePath = '" + AppTemplatePath + "';</script>", false);

            //Register App JS
            if (!IsPostBack)
            {
                WebForms.RegisterStartupScriptInclude(Page, App.Name + "-AppJS", Page.ResolveUrl(ScriptHandler + "?appname=" + App.Name.ToLower() + "&portalid=" + PortalId.ToString() + "&moduleid=" + ModuleId.ToString()));


                Dictionary <string, object> appProperties = new Dictionary <string, object>
                {
                    { "AppName", App },
                    { "AppTemplatePath", Page.ResolveUrl(AppTemplatePath) },
                    { "FrameworkTemplatePath", Page.ResolveUrl(FrameworkTemplatePath) },
                    { "AngularTemplates", AngularViews },
                    { "ShowMissingKeys", ShowMissingKeys.ToString().ToLower() },
                    { "ResourceFilePath", AppResourceFilePath },
                    { "AppConfigJS", AppConfigJS },
                    { "AppJS", AppJSPath },
                    { "Dependencies", FrameworkManager.GetDependenciesModuleNames(Dependencies) }
                };

                Application["app-" + App.Name.ToLower()] = appProperties;

                InstallScheduler();
            }

            //Register Angular Template Paths
            WebForms.RegisterClientScriptBlock(Page, "AngularTemplates", "var mnAngularTemplatePath = { };", true);
            WebForms.RegisterStartupScript(Page, App.Name + "-TemplatePath", "mnAngularTemplatePath['" + App.Name + "'] = '" + Page.ResolveUrl(AppTemplatePath) + "';", true);

            //Register APP CSS
            if (!IsPostBack && File.Exists(Server.MapPath(AppCSSPath)))
            {
                WebForms.LinkCSS(Page, App.Name + "-CSS", Page.ResolveUrl(AppCSSPath), true);
            }
        }
コード例 #21
0
        public void DeleteAllBreakpoints()
        {
            if (FrameworkManager.ShowMessageBox("Do you want to delete all breakpoints?",
                                                MessageBoxButtons.YesNo,
                                                MessageBoxIcon.Question) == DialogResult.Yes)
            {
                foreach (string fileName in _breakpoints.Keys)
                {
                    foreach (Breakpoint bp in _breakpoints[fileName].Values)
                    {
                        bp.BreakpointChanged -= OnBreakpointChanged;

                        if (BreakpointRemoved != null)
                        {
                            BreakpointRemoved(this, bp);
                        }
                    }

                    _breakpoints[fileName].Clear();
                }

                _breakpoints.Clear();
            }
        }
コード例 #22
0
        private void solutionExplorerTreeView_ItemAfterEdit(object sender, TreeListViewAfterEditEventArgs e)
        {
            ILuaEditDocument doc = e.Item.Tag as ILuaEditDocument;

            if (doc == null)
            {
                e.Cancel = true;
            }
            else
            {
                bool isDir = false;

                try
                {
                    isDir = (File.GetAttributes(doc.FileName) & FileAttributes.Directory) == FileAttributes.Directory;
                }
                catch (Exception ex)
                {
                    string msg = string.Format("Error while trying to rename '{0}': {1}", doc.FileName, ex.Message);
                    FrameworkManager.ShowMessageBox(msg, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    e.Cancel = true;
                    return;
                }

                try
                {
                    string newFileName = null;

                    if (isDir)
                    {
                        newFileName = Path.Combine(Directory.GetParent(doc.FileName).FullName, e.NewValue);
                    }
                    else
                    {
                        if (e.Item.Tag is ILuaEditDocumentProject || e.Item.Tag is ILuaEditDocumentSolution)
                        {
                            newFileName = Path.Combine(Path.GetDirectoryName(doc.FileName), e.NewValue + Path.GetExtension(doc.FileName));
                        }
                        else
                        {
                            newFileName = Path.Combine(Path.GetDirectoryName(doc.FileName), e.NewValue);
                        }
                    }

                    if (newFileName != doc.FileName)
                    {
                        DocumentsManager.Instance.RenameDocument(doc, newFileName);

                        if (e.Item != null)
                        {
                            e.Item.ToolTip = doc.FileName;
                        }
                    }
                }
                catch (Exception ex)
                {
                    e.Cancel = true;
                    FrameworkManager.ShowMessageBox(ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
コード例 #23
0
 public void ReloadModules()
 {
     FrameworkManager.UpdateModules(true);
     DataHelpers.Shell.SetupSideMenu().Wait();
 }
コード例 #24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["m2v"] == null)
            {
                m2v = null;
            }
            else
            {
                m2v = Convert.ToBoolean(Request.QueryString["m2v"]);
            }

            if (IsAllowed())
            {
                if (string.IsNullOrEmpty(Request.QueryString["ctl"]) && (string.IsNullOrEmpty(Request.QueryString["icp"]) || Convert.ToBoolean(Request.QueryString["icp"]) == false))
                {
                    if (string.IsNullOrEmpty(Request.QueryString["uxmode"]))
                    {
                        Literal lt = new Literal();
                        IDictionary <string, object> dynObjects = new ExpandoObject() as IDictionary <string, object>;
                        dynObjects.Add("Setting", GetBaseModel());
                        string Template = RazorEngineManager.RenderTemplate("VanjaroUXManager", Page.ResolveUrl("~/DesktopModules/Vanjaro/UXManager/Library/"), "Base", dynObjects);
                        Template = new DNNLocalizationEngine(null, Server.MapPath("~/DesktopModules/Vanjaro/UXManager/Library/App_LocalResources/Shared.resx"), ShowMissingKeys).Parse(Template);
                        lt.Text  = Template;
                        Controls.Add(lt);
                    }

                    string DirectoryPath = System.Web.Hosting.HostingEnvironment.MapPath("~/DesktopModules/Vanjaro/UXManager/Library/Resources/tui/");
                    if (Directory.Exists(DirectoryPath))
                    {
                        foreach (string file in Directory.GetFiles(DirectoryPath))
                        {
                            string FileName = Path.GetFileName(file);
                            if (!string.IsNullOrEmpty(FileName))
                            {
                                if (FileName.EndsWith(".js"))
                                {
                                    WebForms.RegisterClientScriptInclude(Page, FileName.Replace(".", ""), Page.ResolveUrl("~/DesktopModules/Vanjaro/UXManager/Library/Resources/tui/" + FileName), false);
                                }
                                else
                                {
                                    WebForms.LinkCSS(Page, FileName.Replace(".", ""), Page.ResolveUrl("~/DesktopModules/Vanjaro/UXManager/Library/Resources/tui/" + FileName), false);
                                }
                            }
                        }
                    }

                    WebForms.LinkCSS(Page, "UXManagerAppCss", Page.ResolveUrl("~/DesktopModules/Vanjaro/UXManager/Library/Resources/StyleSheets/app.css"));
                    WebForms.LinkCSS(Page, "GrapesJsCss", Page.ResolveUrl("~/DesktopModules/Vanjaro/UXManager/Library/Resources/Scripts/GrapesJs/css/grapes.min.css"));
                    WebForms.LinkCSS(Page, "GrapickJsCss", Page.ResolveUrl("~/DesktopModules/Vanjaro/UXManager/Library/Resources/Scripts/GrapesJs/css/grapick.min.css"));
                    WebForms.RegisterClientScriptInclude(Page, "GrapesJsJs", Page.ResolveUrl("~/DesktopModules/Vanjaro/UXManager/Library/Resources/Scripts/uxmanager.min.js"), false);
                    WebForms.LinkCSS(Page, "GrapesJsPanelCss", Page.ResolveUrl("~/DesktopModules/Vanjaro/UXManager/Library/Resources/Scripts/jsPanel/jspanel.min.css"));
                    WebForms.LinkCSS(Page, "GrapesJspluginCss", Page.ResolveUrl("~/DesktopModules/Vanjaro/UXManager/Library/Resources/Scripts/GrapesJsManagers/css/uxmanager.css"));
                    WebForms.LinkCSS(Page, "FontawesomeV4Css", Page.ResolveUrl("~/DesktopModules/Vanjaro/UXManager/Library/Resources/Scripts/GrapesJs/css/fontawesome/v4.css"));

                    if (!IsAllowed())
                    {
                        WebForms.RegisterClientScriptBlock(Page, "MenuSettingsBlocks", "$(document).ready(function(){$('[href=\"#MenuSettings\"]').click();$('#mode-switcher').remove();setTimeout(function(){$('.gjs-cv-canvas__frames').css('pointer-events','none');}, 100); });", true);
                    }

                    LocalizeGrapeJS();

                    FrameworkManager.Load(this, "FontAwesome");
                }
                string NavigateURL  = PageManager.GetCurrentTabUrl(PortalSettings);
                string ClientScript = "var AppMenus=" + JsonConvert.SerializeObject(AppManager.GetAll(AppType.Module)) + "; var m2vPageTabUrl='" + NavigateURL + "'; var CurrentTabUrl ='" + NavigateURL + "'; var IsAdmin=" + PortalSettings.UserInfo.IsInRole("Administrators").ToString().ToLower() + ";";
                WebForms.RegisterClientScriptBlock(Page, "GrapesJsAppsExts", ClientScript, true);

                if (TabPermissionController.HasTabPermission("EDIT") && !Request.QueryString.AllKeys.Contains("mid"))
                {
                    string OpenPopup = string.Empty;
                    if (m2v.HasValue && !m2v.Value && (Vanjaro.Core.Managers.PageManager.GetPages(PortalSettings.ActiveTab.TabID).Count == 0))
                    {
                        OpenPopup = "#/choosetemplate";
                    }
                    else if (Request.QueryString["m2vsetup"] != null && Request.QueryString["m2vsetup"] == "page")
                    {
                        OpenPopup = "#detail";
                    }

                    if (!string.IsNullOrEmpty(OpenPopup))
                    {
                        NavigateURL = PageManager.GetCurrentTabUrl(PortalSettings, "&mid=0&icp=true&guid=10E56C75-548E-4A10-822E-52E6AA2AB45F" + OpenPopup);
                        WebForms.RegisterStartupScript(Page, "m2v", "<script type=\"text/javascript\" vanjarocore=\"true\">OpenPopUp(event, 800,'right','Choose Template', '" + NavigateURL + "')</script>", false);
                    }
                }
            }
        }
コード例 #25
0
        private void removeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (solutionExplorerTreeView.SelectedItems.Count > 0)
            {
                string confirmMsg = string.Empty;

                if (removeToolStripMenuItem.Text == "Remove")
                {
                    if (solutionExplorerTreeView.SelectedItems.Count == 1)
                    {
                        ILuaEditDocument doc = solutionExplorerTreeView.SelectedItems[0].Tag as ILuaEditDocument;
                        confirmMsg = string.Format("'{0}' will be removed.", doc);
                    }
                    else
                    {
                        confirmMsg = "The selected items will be removed.";
                    }

                    if (!string.IsNullOrEmpty(confirmMsg) &&
                        FrameworkManager.ShowMessageBox(confirmMsg, MessageBoxButtons.OKCancel,
                                                        MessageBoxIcon.Information) == DialogResult.OK)
                    {
                        TreeListViewItem[] selectedItems = new TreeListViewItem[0];
                        Array.Resize <TreeListViewItem>(ref selectedItems, solutionExplorerTreeView.SelectedItems.Count);
                        solutionExplorerTreeView.SelectedItems.CopyTo(selectedItems, 0);

                        foreach (TreeListViewItem tlvi in selectedItems)
                        {
                            ILuaEditDocumentProject prjDoc = tlvi.Tag as ILuaEditDocumentProject;

                            if (prjDoc != null && prjDoc.ParentDocument != null)
                            {
                                if (DocumentsManager.Instance.CloseDocument(prjDoc))
                                {
                                    prjDoc.ParentDocument.RemoveDocument(prjDoc);
                                }
                            }
                        }
                    }
                }
                else
                {
                    if (solutionExplorerTreeView.SelectedItems.Count == 1)
                    {
                        ILuaEditDocument doc = solutionExplorerTreeView.SelectedItems[0].Tag as ILuaEditDocument;

                        if (doc != null && doc is ILuaEditDocumentFolder)
                        {
                            confirmMsg = string.Format("'{0}' and all its content will be deleted permanently.", doc);
                        }
                        else
                        {
                            confirmMsg = string.Format("'{0}' will be deleted permanently.", doc);
                        }
                    }
                    else
                    {
                        confirmMsg = "The selected items will be deleted permanently.";
                    }

                    if (!string.IsNullOrEmpty(confirmMsg) &&
                        FrameworkManager.ShowMessageBox(confirmMsg, MessageBoxButtons.OKCancel,
                                                        MessageBoxIcon.Information) == DialogResult.OK)
                    {
                        TreeListViewItem[] selectedItems = new TreeListViewItem[0];
                        Array.Resize <TreeListViewItem>(ref selectedItems, solutionExplorerTreeView.SelectedItems.Count);
                        solutionExplorerTreeView.SelectedItems.CopyTo(selectedItems, 0);

                        foreach (TreeListViewItem tlvi in selectedItems)
                        {
                            ILuaEditDocument doc = tlvi.Tag as ILuaEditDocument;
                            DocumentsManager.Instance.DeleteDocument(doc);
                        }
                    }
                }
            }
        }
コード例 #26
0
 public void Dispose()
 {
     FrameworkManager.Dispose();
 }
コード例 #27
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            //WebForms.InitURLLibrary(this);

            //Request Services Framework
            ServicesFramework.Instance.RequestAjaxScriptSupport();
            ServicesFramework.Instance.RequestAjaxAntiForgerySupport();

            //Request jQuery & UI Support
            JavaScript.RequestRegistration(CommonJs.jQuery);

            if (Dependencies.Contains(Frameworks.jQueryUI.ToString()))
            {
                JavaScript.RequestRegistration(CommonJs.jQueryUI);
                WebForms.LinkCSS(Page, "JQuery" + "-JQuery-css", FrameworkManager.Request("JQuery", "css", "smoothness.css"));
            }

            WebForms.RegisterClientScriptInclude(Page, "DNNModal", Page.ResolveUrl("js/dnn.modalpopup.js"));

            //Load Angular JS
            FrameworkManager.Load(this, "AngularJS");

            //Load Angular Common Service
            FrameworkManager.LoadPlugin(this, "AngularJS", "mnCommonService", "mnCommonService.min.js");

            //Load Ckeditor
            if (Dependencies.Contains(AngularPlugins.CKEditor.ToString()))
            {
                FrameworkManager.Load(this, "Ckeditor", false);
            }

            //Load ColorPicker
            if (Dependencies.Contains(JavaScriptPlugins.ColorPicker.ToString()))
            {
                FrameworkManager.Load(this, "ColorPicker");
            }

            if (Dependencies.Contains(JavaScriptPlugins.ValidationJS.ToString()))
            {
                FrameworkManager.Load(this, "ValidationJS");
            }

            if (Dependencies.Contains(Frameworks.FontAwesome.ToString()))
            {
                FrameworkManager.Load(this, "FontAwesome");
            }

            if (Dependencies.Contains(JavaScriptPlugins.SpectrumColorPicker.ToString()))
            {
                FrameworkManager.Load(this, "SpectrumColorPicker");
            }

            if (Dependencies.Contains(JavaScriptPlugins.ContextMenu.ToString()))
            {
                FrameworkManager.Load(this, "ContextMenu");
            }

            //Load JsonViewer
            if (Dependencies.Contains(JavaScriptPlugins.JsonViewer.ToString()))
            {
                FrameworkManager.Load(this, "JsonViewer");
            }

            //Load JsonViewer
            if (Dependencies.Contains(JavaScriptPlugins.Barcode.ToString()))
            {
                FrameworkManager.Load(this, "Barcode");
            }

            if (Dependencies.Contains(JavaScriptPlugins.Notify.ToString()))
            {
                FrameworkManager.Load(this, "Notify");
            }

            if (Dependencies.Contains(JavaScriptPlugins.Numeral.ToString()))
            {
                FrameworkManager.Load(this, "Numeral");
            }

            if (Dependencies.Contains(JavaScriptPlugins.CodeMirror.ToString()))
            {
                FrameworkManager.Load(this, "CodeMirror");
            }

            if (Dependencies.Contains(JavaScriptPlugins.Toastr.ToString()))
            {
                FrameworkManager.Load(this, "Toastr");
            }

            if (Dependencies.Contains(JavaScriptPlugins.BootstrapDatepicker.ToString()))
            {
                FrameworkManager.Load(this, "BootstrapDatepicker");
            }

            if (Dependencies.Contains(AngularPlugins.Grid.ToString()))
            {
                FrameworkManager.LoadPlugin(this, "AngularJS", "SmartTable", "smart-table.min.js");
            }

            if (Dependencies.Contains(AngularPlugins.FileUpload.ToString()))
            {
                FrameworkManager.LoadPlugin(this, "AngularJS", "FileUpload", "ng-file-upload.min.js");
            }

            if (Dependencies.Contains(AngularPlugins.CSVImport.ToString()))
            {
                FrameworkManager.LoadPlugin(this, "AngularJS", "AngularCsvImport", "angular-csv-import.min.js");
                WebForms.RegisterClientScriptBlock(Page, "ImportHandler", "var mnImportHandler = '" + Page.ResolveUrl("DesktopModules/Vanjaro/Common/Handlers/ImportMapHandler.ashx?portalid=" + PortalId.ToString()) + "';", true);
            }


            WebForms.LinkCSS(Page, "AngularJS" + "-SweetAlert-css", FrameworkManager.Request("AngularJs", "Plugins", "SweetAlert/sweetalert.css"));
            FrameworkManager.LoadPlugin(this, "AngularJS", "SweetAlert", "alert.min.js");
            FrameworkManager.LoadPlugin(this, "AngularJS", "SweetAlert", "SweetAlert.min.js");


            if (Dependencies.Contains(AngularPlugins.TreeView.ToString()))
            {
                WebForms.LinkCSS(Page, "AngularJS" + "-TreeView-css", FrameworkManager.Request("AngularJs", "Plugins", "TreeView/angular-ui-tree.min.css"));
                FrameworkManager.LoadPlugin(this, "AngularJS", "TreeView", "angular-ui-tree.min.js");
            }

            if (Dependencies.Contains(AngularPlugins.Dialog.ToString()))
            {
                WebForms.LinkCSS(Page, "AngularJS" + "-Dialog-css", FrameworkManager.Request("AngularJs", "Plugins", "Dialog/ngDialog.min.css"));
                WebForms.LinkCSS(Page, "AngularJS" + "-Dialog-default-css", FrameworkManager.Request("AngularJs", "Plugins", "Dialog/ngDialog-theme-default.min.css"));
                FrameworkManager.LoadPlugin(this, "AngularJS", "Dialog", "ngDialog.min.js");
            }

            //Load Angular Loading Bar
            FrameworkManager.LoadPlugin(this, "AngularJS", "loading-bar", "loading-bar.min.js");
            WebForms.LinkCSS(Page, "AngularJS" + "-loading-css", FrameworkManager.Request("AngularJs", "Plugins", "loading-bar/loading-bar.min.css"));

            //Load Angular XEditable
            if (Dependencies.Contains(AngularPlugins.InlineEditor.ToString()))
            {
                FrameworkManager.LoadPlugin(this, "AngularJS", "x-editable", "js/xeditable.min.js");
                WebForms.LinkCSS(Page, "AngularJS" + "-xeditable-css", FrameworkManager.Request("AngularJs", "Plugins", "x-editable/css/xeditable.css"));
            }

            //Load Angular Tags Input
            if (Dependencies.Contains(AngularPlugins.Tags.ToString()))
            {
                FrameworkManager.LoadPlugin(this, "AngularJS", "TagsInput", "js/ng-tags-input.min.js");
                WebForms.LinkCSS(Page, "AngularJS" + "-tags-input-css", FrameworkManager.Request("AngularJs", "Plugins", "tagsinput/css/ng-tags-input.min.css"));
                WebForms.LinkCSS(Page, "AngularJS" + "-tags-input-bootstrap-css", FrameworkManager.Request("AngularJs", "Plugins", "tagsinput/css/ng-tags-input.bootstrap.min.css"));
            }

            //Load autocomplete
            if (Dependencies.Contains(AngularPlugins.AutoComplete.ToString()))
            {
                FrameworkManager.LoadPlugin(this, "AngularJS", "autocomplete", "js/autocomplete.min.js");
                WebForms.LinkCSS(Page, "AngularJS" + "-autocomplete-css", FrameworkManager.Request("AngularJs", "Plugins", "autocomplete/css/autocomplete.css"));
            }



            //Load Bootstrap
            FrameworkManager.Load(this, "Bootstrap");

            //Load WebAPI
            FrameworkManager.Load(this, "WebAPI");

            if (Dependencies.Contains(JavaScriptPlugins.ReCaptcha.ToString()))
            {
                FrameworkManager.Load(this, "ReCaptcha");
            }

            //Add Necessary Markup for Angular App
            Literal lit = new Literal
            {
                Text = "<div class=\"container-fluid " + App.Name + " \" id=\"" + App.Name + ModuleId.ToString() + "\" data-app-name=\"" + App.Name + " \" data-show-missing-keys=\"" + ShowMissingKeys.ToString().ToLower() + "\" data-roles=\"" + string.Join(",", AccessRoles) + "\" data-ModuleId=\"" + ModuleId.ToString() + "\" ng-controller=\"" + ControllerName + "\"><div ng-view=\"\" class=\"view-animate\"></div></div>"
            };

            Controls.Add(lit);

            if (!IsPostBack)
            {
                //Add Necessary Script to Initialize App
                string AngularAppScript = "angular.element(document).ready(function () {angular.bootstrap(document.getElementById(\"" + App.Name + ModuleId.ToString() + "\"), [\"" + App.Name + "\"]);});";
                WebForms.RegisterStartupScript(Page, "angular-init" + ModuleId.ToString(), AngularAppScript, true);

                //serialized form data into hidden field
                Dictionary <string, object> dicFormData = new Dictionary <string, object>();
                foreach (string key in HttpContext.Current.Request.Form.AllKeys)
                {
                    if (!string.IsNullOrEmpty(key))
                    {
                        if (!string.IsNullOrEmpty(HttpContext.Current.Request.Form[key]))
                        {
                            dicFormData.Add(key, HttpContext.Current.Request.Form[key].Replace("'", "&#39;"));
                        }
                        else
                        {
                            dicFormData.Add(key, HttpContext.Current.Request.Form[key]);
                        }
                    }
                }
                Controls.Add(new Literal()
                {
                    Text = "<input type=\"hidden\" name=\"hfFormData\" value=\'" + JsonConvert.SerializeObject(dicFormData) + "\'>"
                });
            }

            //serialized form data into hidden field
            //Dictionary<string, object> dicFormData = new Dictionary<string, object>();
            //foreach (string key in HttpContext.Current.Request.Form.AllKeys)
            //{
            //    dicFormData.Add(key, HttpContext.Current.Request.Form[key]);
            //}
            //this.Controls.Add(new Literal() { Text = "<input type=\"hidden\" name=\"hfFormData\" value=\'" + JsonConvert.SerializeObject(dicFormData) + "\'>" });


            //Literal s = new Literal();
            //lit.Text = "<script>" + AngularAppScript + "</script>";
            //this.Controls.Add(s);
        }
コード例 #28
0
ファイル: BridgeFactory.cs プロジェクト: shibc-heart/HY_hub
 static BridgeFactory()
 {
     BridgeManager = new FrameworkManager();
 }
コード例 #29
0
        static void Main(string[] args)
        {
            Console.WriteLine("//Reconstructing database //");
            FrameworkManager FM   = new FrameworkManager();
            AspectsManager   AM   = new AspectsManager();
            AnswersManager   ASWM = new AnswersManager();
            QuestionsManager QM   = new QuestionsManager();


            NurseSelfAssessmentAnswersManager NSAM = new NurseSelfAssessmentAnswersManager();

            //Get Aspects
            var aspect_Resul = AM.Get();
            var aspects_List = (List <AspectEntity>)aspect_Resul.Entity;
            var aspects_Dict = aspects_List.ToDictionary(x => x.AspectId, x => x);


            //Get User Quizz Answers

            var NSAM_Resul = NSAM.GetAllQuizz_OldDB();
            var answ_List  = (List <UsersQuizzesEntity>)NSAM_Resul.Entity;

            //Get Answers
            var answers_result = ASWM.Get();
            var answers_List   = (List <AnswerEntity>)answers_result.Entity;
            var answers_Dict   = answers_List.ToDictionary(x => (x.QuestionId, x.Value), x => x);

            //Get Questions
            var questions_result = QM.Get();
            var questions_List   = (List <QuestionEntity>)questions_result.Entity;
            var question_Dict    = questions_List.ToDictionary(x => x.QuestionId, x => x);



            List <Object> results       = new List <Object>();
            int           error_counter = 0;

            //Parse data
            foreach (UsersQuizzesEntity entity in answ_List)
            {
                //Console.WriteLine(entity.Results);
                JObject parent_json = JObject.Parse(entity.Results);
                var     answer      = parent_json.Value <JObject>("answers").Properties();

                var result = new Result();

                if (answer != null)
                {
                    var nurse_answer_dict = answer.ToDictionary(k => Int32.Parse(k.Name), v => Decimal.Parse(v.Value.ToString()));

                    foreach (KeyValuePair <int, decimal> ans in nurse_answer_dict)
                    {
                        NurseSelfAssessmentAnswersEntity ans_entity = new NurseSelfAssessmentAnswersEntity();
                        ans_entity.QuestionId = ans.Key;
                        ans_entity.Value      = ans.Value;
                        ans_entity.LastUpdate = entity.DateVal;
                        ans_entity.UserId     = entity.UserId;
                        ans_entity.UserQuizId = entity.UserQuizId;

                        AnswerEntity answer_entity = null;
                        if (answers_Dict.TryGetValue((ans_entity.QuestionId, ans_entity.Value), out answer_entity))
                        {
                            ans_entity.AnswerId = answer_entity.AnswerId;
                        }

                        QuestionEntity question_entity = null;
                        if (question_Dict.TryGetValue(ans.Key, out question_entity))
                        {
                            ans_entity.AspectId = (int)question_entity.AspectId;
                        }
                        // insert answer into database
                        result = NSAM.InsertAnswer(entity.UserId, ans_entity);

                        if (!result.Success)
                        {
                            Console.WriteLine(result.Message);
                            error_counter++;
                        }
                    }
                }


                if (!result.Success)
                {
                    Console.WriteLine(result.Message);
                    error_counter++;
                }
            }


            Console.WriteLine(String.Format("process completed with {0} error", error_counter));


            System.Threading.Thread.Sleep(5000);
        }
コード例 #30
0
 static App()
 {
     MainAopContext       = new XmlApplicationContext("AutumnBoxAop.atmbxml");
     OpenFrameworkContext = new AppContext();
     OpenFrameworkManager = new FrameworkManager(OpenFrameworkContext);
 }
コード例 #31
0
 public CockpitForm()
 {
     _manager = new FrameworkManager();
     _manager.CameraAdded += this.HandleCameraAdded;            
     this.InitializeComponent();
 }