Exemple #1
0
        /// <summary>
        /// Builds a list of EForms filtered by disease (if applicable)
        /// </summary>
        private void BuildEForms()
        {
            // set visibility
            EformComponentHolder.Visible = false;
            EformListPanel.Visible       = true;

            // get static eforms
            var masterEformList = from eform in CaisisConfiguration.GetEformsConfigList()
                                  orderby(eform.Disease == "General" ? 0 : 1) ascending, eform.Disease ascending, eform.Name ascending
                select new
            {
                Name      = eform.Name,
                Disease   = eform.Disease,
                FileName  = eform.FileName,
                EFormType = "static",
                EFormId   = string.Empty,
                Active    = eform.Active
            };

            // filter by disease
            if (!string.IsNullOrEmpty(QueryDiseaseName))
            {
                masterEformList = masterEformList.Where(e => e.Disease.Equals(QueryDiseaseName, StringComparison.CurrentCultureIgnoreCase));
            }

            if (masterEformList.Count() > 0)
            {
                // bind list of eforms
                EformsRptr.DataSource = masterEformList;
                EformsRptr.DataBind();
                NoResultsMsg.Visible = false;
            }

            EFormCount.Text = masterEformList.Count().ToString();
        }
Exemple #2
0
        private XmlDocument GetEFormsXml()
        {
            string modFolder     = Caisis.UI.Core.Classes.XmlUtil.GetParentModuleDirectory(base.EFormFileName + ".xml", "EForms");
            string eformsXmlFile = AppDomain.CurrentDomain.BaseDirectory.ToString() + "\\Modules\\" + modFolder + "\\EForms\\" + base.EFormFileName + ".xml";

            return(CaisisConfiguration.GetEFormsXml(eformsXmlFile));
        }
Exemple #3
0
        override protected void Page_Load(object sender, System.EventArgs e)
        {
            if (Request.QueryString["inquireAboutRoles"] != null && Request.QueryString["userId"].Length > 0)
            {
                AddUserTable.Visible = false;

                valMsg.Text = "\n\nWould you like to add this user to a group? <a href=\"AdminUserToGroup.aspx?userId=" + Request.QueryString["userId"] + "&newUser=yes\">Yes</a>&nbsp;&nbsp;&nbsp;<a href=\"AdminAddUser.aspx\">No</a>";
            }
            else
            {
                base.Page_Load(sender, e);
                RandomPasswordHolder.Value = PageUtil.GenPassword(6);
            }

            // display the ldap search button only if we can successfully connect to LDAP
            if (CaisisConfiguration.PingLDAP())
            {
                SearchLdapButton.Visible = true;
            }
            bool useLDAP = CaisisConfiguration.UseLDAP();

            if (useLDAP)
            {
                PasswordValidator.Enabled        = false;
                UseLDAPRow.Visible               = true;
                UserPassword.Attributes["class"] = "LDAPGray";
            }
        }
Exemple #4
0
        override protected void Page_Load(object sender, System.EventArgs e)
        {
            GlobalInstitution.Text = CaisisConfiguration.GetWebConfigValue("institutionShortName");

            base.Page_Load(sender, e);
            base.SetTitle(ComponentTitle);
        }
Exemple #5
0
        /// <summary>
        /// Publish the exception to the system event log and/or database and/or error email.
        /// </summary>
        /// <param name="ex">The exception to be published.</param>
        /// <param name="errorType">Optional user error subject text.</param>
        public static void Publish(Exception ex, string errorType)
        {
            string LOWER_TRUE_STRING = bool.TrueString.ToLower();

            string logErrorsToSystemEventLog = CaisisConfiguration.GetWebConfigValue("logErrorsToSystemEventLog");
            string emailErrors         = CaisisConfiguration.GetWebConfigValue("emailErrors");
            string logErrorsToDatabase = CaisisConfiguration.GetWebConfigValue("logErrorsToDatabase");

            //log errors to application log
            if (!string.IsNullOrEmpty(logErrorsToSystemEventLog) && logErrorsToSystemEventLog.ToLower().Equals(LOWER_TRUE_STRING))
            {
                ExceptionHandler.WriteToApplicationLog(ex);
            }

            //send errors to admin email address
            if (!string.IsNullOrEmpty(emailErrors) && emailErrors.ToLower().Equals(LOWER_TRUE_STRING))
            {
                ExceptionHandler.SendErrorEmail(ex, errorType);
            }

            // log errors to database table for reporting in admin
            if (!string.IsNullOrEmpty(logErrorsToDatabase) && logErrorsToDatabase.ToLower().Equals(LOWER_TRUE_STRING))
            {
                ExceptionHandler.WriteToDatabaseLog(ex);
            }
        }
        protected override void Page_Load(object sender, System.EventArgs e)
        {
            ProcInstitution_1.Value = CaisisConfiguration.GetWebConfigValue("institutionShortName");
            base.Page_Load(sender, e);

            string SurgeryDate = "";

            if (Session[SessionKey.CurrentClinicDate] != null)
            {
                SurgeryDate = Session[SessionKey.CurrentClinicDate].ToString();
            }
            if (SurgeryDate.Length > 0)
            {
                SetHiddenDateFieldPair(ProcDateText_1, ProcDate_1, SurgeryDate);
            }

            ////string Surgeon = "";
            //if (Session[SessionKey.CurrentListType] != null && Session[SessionKey.CurrentListType].ToString().ToUpper().Equals("CLINIC") && Session[SessionKey.CurrentListCrit].ToString().Length > 0)
            //{
            //    Surgeon = Session[SessionKey.CurrentListCrit].ToString();
            //}
            //if (Surgeon.Length > 0 && string.IsNullOrEmpty(ProcSurgeon_1.Value))
            //{
            //    if (Surgeon.IndexOf(",") > -1)
            //    {
            //        Surgeon = Surgeon.Remove(Surgeon.IndexOf(","));
            //    }
            //    ProcSurgeon_1.Value = Surgeon;
            //}
        }
Exemple #7
0
        /// <summary>
        ///
        /// </summary>
        public void BuildEFormDropDownList()
        {
            if (ConfigTypeName == typeof(PaperFormConfig).Name)
            {
                configName = "Paper Form";
                // filter list if needed
                configList = CaisisConfiguration.GetPaperFormConfigList().OfType <ICaisisConfiguration>();
            }
            else if (ConfigTypeName == typeof(EformConfig).Name)
            {
                configName    = "Eform";
                configList    = CaisisConfiguration.GetEformsConfigList().OfType <ICaisisConfiguration>();
                DefaultEForm  = UserPrefDefaultEForm();
                DefaultEForms = UserPrefDefaultEForms();
            }
            // finally, filter out only active nodes
            configList = configList.Where(c => !string.IsNullOrEmpty(c.DisplayName) && c.Active);

            // get distinct list of diseases
            var diseases = configList.SelectMany(c => c.Diseases).Distinct();

            // bind outer repeater
            EformDropDownRptr.DataSource = diseases;
            EformDropDownRptr.DataBind();
        }
Exemple #8
0
 private void RedirectOnLogout()
 {
     // do not redirect to login page if using novell access manager; otherwise send user back to login page
     if (!CaisisConfiguration.GetWebConfigValue("LDAPAuthenticationMode").ToLower().Equals("accessmgr"))
     {
         Response.Redirect("Login.aspx", false);
     }
 }
Exemple #9
0
        /// <summary>
        /// Builds a list of all tabs
        /// </summary>
        private void BuildTabs()
        {
            var tabs = CaisisConfiguration.GetModuleConfigList().Where(m => m.IsTab);

            //XmlDocument xmlDoc = XmlUtil.GetModulesConfigXml();
            //XmlNodeList listOfTabs = xmlDoc.SelectNodes("modules/module[@isTab='true']");
            TabsRptr.DataSource = tabs;
            TabsRptr.DataBind();
        }
Exemple #10
0
        /// <summary>
        /// Builds a list of all tabs
        /// </summary>
        private void BuildModules()
        {
            var tabs = from tab in CaisisConfiguration.GetModuleConfigList()
                       where tab.IsTab
                       select tab.Name;

            ModulesRptr.DataSource = tabs;
            ModulesRptr.DataBind();

            ModulesCount.Text = tabs.Count().ToString();
        }
Exemple #11
0
        /// <summary>
        /// Retrieves a list of Widgets specific to current User.
        /// </summary>
        /// <param name="page">The page object used to load widget controls</param>
        /// <returns>A list of Widgets specific to current users.</returns>
        public static IEnumerable <BaseWidgetControl> GetWidgets(Page page)
        {
            // retrieve all widgets
            var widgets = GetAllWidgets(page);
            // retrieve widget config
            var configs = CaisisConfiguration.GetWidgetConfigList();

            // a list of filtered (by permission, configuration) user widgets
            var filteredWidgets = new List <BaseWidgetControl>();

            // FILTER: filter widgets which have config nodes and are active
            foreach (var config in configs)
            {
                // only care about active widgets
                if (config.Active)
                {
                    // find widget which matches config
                    foreach (var widget in widgets)
                    {
                        if (widget.Name == config.Name)
                        {
                            // set widget properties via config
                            SetWidgetByConfig(widget, config);
                            // add to filtered list
                            filteredWidgets.Add(widget);
                        }
                    }
                }
            }

            // FILTER: filter nodes which are associated with tabs
            XmlDocument xmlDoc = XmlUtil.GetModulesConfigXml();

            string        groupViewCode = page.Session[SessionKey.GroupViewCode].ToString();
            TabController ct            = new TabController(groupViewCode);
            DataTable     tabs          = ct.CreateTabDataTable(xmlDoc);
            var           tabNames      = from row in tabs.AsEnumerable()
                                          let tabName = row["TabName"].ToString()
                                                        select tabName;
            var filtered = from widget in filteredWidgets
                           where
                           // if not associated with a module
                           widget.Modules.Count() == 0
                           ||
                           // otherwise validate, user has access to at least one tab
                           (from module in widget.Modules
                            where tabNames.Contains(module, StringComparer.OrdinalIgnoreCase)
                            select module).Count() > 0
                           select widget;


            // return filters list
            return(filtered);
        }
        private void BindSpecimensGrid()
        {
            SpecimenManagerDa da = new SpecimenManagerDa();
            string            _identifierType = CaisisConfiguration.GetWebConfigValue("SpecimenModuleDefaultId");
            DataTable         dt = da.GetSpecimensInCollectionForPrint(colId, _identifierType);

            this.totalSpecimens.Text = dt.Rows.Count.ToString();

            this.SpecimenGridView.DataSource = dt;
            this.SpecimenGridView.DataBind();
        }
Exemple #13
0
        /// <summary>
        /// Builds a list of all tabs
        /// </summary>
        private void BuildTabs()
        {
            var tabs = from tab in CaisisConfiguration.GetModuleConfigList()
                       where tab.IsTab
                       select tab.Name.ToUpper();

            //XmlDocument xmlDoc = XmlUtil.GetModulesConfigXml();
            //XmlNodeList listOfTabs = xmlDoc.SelectNodes("modules/module[@isTab='true']");
            TabsRptr.DataSource = tabs;
            TabsRptr.DataBind();
        }
Exemple #14
0
 protected override void Page_Load(object sender, System.EventArgs e)
 {
     if (!this.IsPostBack)
     {
         QueryView.SQLConnectionString   = CaisisConfiguration.GetWebConfigValue("dbConnectionString");
         QueryView.UserName              = GetInstanceOwner();
         QueryView.QueryTableName        = "Patients";
         QueryView.SavedQueriesTableName = "savedqueries";
     }
     QueryView.DatasetSql = CacheManager.GetDatasetSQL(Page.Session[SessionKey.DatasetId]);
 }
Exemple #15
0
        /// <summary>
        /// Adjusts visibility of the contact admin link
        /// </summary>
        private void SetEmailLink()
        {
            string adminEmail = CaisisConfiguration.GetWebConfigValue("adminEmail");

            if (!string.IsNullOrEmpty(adminEmail))
            {
                ContactAdminLink.Visible = true;
            }
            else
            {
                ContactAdminLink.Visible = false;
            }
        }
Exemple #16
0
    protected void SearchLDAP(object sender, EventArgs e)
    {
        SecurityController sc         = new SecurityController();
        string             ldapServer = CaisisConfiguration.GetWebConfigValue("LDAPServer");

        if (!string.IsNullOrEmpty(ldapServer))
        {
            ldapServer = "LDAP://" + ldapServer;
        }

        string username = sc.GetUserName();
        string password = DomainPassword.Text;

        IEnumerable <KeyValuePair <string, string> > searchResults = null;

        try
        {
            if (LastNameSearchOption.Checked)
            {
                searchResults = SearchLDAPByLastName(SearchString.Text, ldapServer, username, password);
            }
            else if (EmailSearchOption.Checked)
            {
                searchResults = SearchLDAPByEmail(SearchString.Text, ldapServer, username, password);
            }
            else
            {
                // do nothing
            }
        }
        // ?? ideally validate server vs client auth exception
        catch (Exception ex)
        {
            ErrorMessage.Visible = true;
        }

        // build results
        SearchResults.DataSource = searchResults;
        SearchResults.DataBind();

        if (searchResults == null || searchResults.Count() == 0)
        {
            SearchResultsRow.Visible = false;
        }
        else
        {
            SearchResults.Items.Insert(0, new ListItem("select a user ...", ""));
            SearchResultsRow.Visible = true;
        }
    }
Exemple #17
0
        // Checks EForm Registry to see if form should autoprint when approved
        protected bool PromptForPrint()
        {
            XmlNode node = CaisisConfiguration.GetEFormNode(this.EFormName);

            if (node != null)
            {
                XmlAttribute nodeAtt = node.Attributes["promptForPrint"];
                if (nodeAtt != null)
                {
                    return(nodeAtt.Value.Length > 0 && nodeAtt.Value.ToLower() == "true");
                }
            }
            return(false);
        }
        protected override void Page_Load(object sender, System.EventArgs e)
        {
            base.Page_Load(sender, e);

            EFormTitle.Text = base.EFormTitle;

//			PatientName.Text = "";

            if (Session[SessionKey.PtFirstName] != null && Session[SessionKey.PtFirstName].ToString().Length > 0)
            {
                PatientName.Text  = "";
                PatientName.Text += Session[SessionKey.PtFirstName].ToString();
            }
            if (Session[SessionKey.PtLastName] != null && Session[SessionKey.PtLastName].ToString().Length > 0)
            {
                PatientName.Text += " " + Session[SessionKey.PtLastName].ToString();
            }

            // centralize setting of new eform drop down this with eform list
            ListItemCollection lic = new ListItemCollection();

            lic.Add(new ListItem("", ""));
            XmlNodeList list = CaisisConfiguration.GetEFormsList();

            foreach (XmlNode node in list)
            {
                string   name  = node.Attributes["displayname"].Value;
                string   value = node.Attributes["name"].Value;
                ListItem item  = new ListItem(name, value);
                lic.Add(item);
            }
            // Old Code to populate dropdown list
            //lic.Add(new ListItem("Prostate Surgery EForm", "Prostate Surgery EForm"));
            ////lic.Add(new ListItem("Prostate New Patient EForm", "Prostate New Patient EForm"));
            //lic.Add(new ListItem("Urology Prostate Follow Up", "Uro Pros FU"));
            //lic.Add(new ListItem("GU Prostate Follow Up", "GU Pros FU"));
            EFormDropDown.DataSource     = lic;
            EFormDropDown.DataTextField  = "Text";
            EFormDropDown.DataValueField = "Value";
            EFormDropDown.DataBind();

            string epid = CustomCryptoHelper.Encrypt(Session[SessionKey.PatientId].ToString());

            StartNewEFormImg.Attributes.Add("onClick", "if (checkEformTypeChosen('" + EFormDropDown.ClientID + "')) { startBtnClick(this.id, '" + epid + "' ) } else { alert('Please select an EForm type.') }");

            // set repeater
            this.SetPatientEFormList();

//			this.ShowEFormNarrative();
        }
Exemple #19
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            txtTo.ReadOnly           = true;
            MailForm.Visible         = true;
            sentMessageTable.Visible = false;

            if (Page.IsPostBack)
            {
                if (txtFrom.Text != null && txtFrom.Text.Length > 0)
                {
                    this.btnSend_Click(sender, e);

                    MailForm.Visible         = false;
                    sentMessageTable.Visible = true;
                }

/*				else
 *                              {
 *                                      ErrorMsg.Text = "Please enter a valid email address in the 'from' field.";
 *                              }
 */
            }
            else
            {
                //
                if (Request.QueryString["userError"] != null && Request.QueryString["userError"].Length > 0 && Request.QueryString["userError"] == "true")
                {
                    txtSubject.Text = "Caisis Error Report";
                }

                UserDa  user = new UserDa();
                DataSet ds   = user.GetByUserName(User.Identity.Name);

                //populate from address
                if (ds.Tables[0].Rows.Count > 0)
                {
                    string emailAddress = ds.Tables[0].Rows[0]["UserEmail"].ToString();
                    fromFName.Value = ds.Tables[0].Rows[0]["UserFirstName"].ToString();
                    fromLName.Value = ds.Tables[0].Rows[0]["UserLastName"].ToString();
                    fromUName.Value = ds.Tables[0].Rows[0]["UserName"].ToString();
                    if (emailAddress != null && !emailAddress.Equals(""))
                    {
                        txtFrom.Text     = emailAddress;
                        txtFrom.ReadOnly = true;
                    }
                }

                txtTo.Text = CaisisConfiguration.GetWebConfigValue("adminEmail");
            }
        }
Exemple #20
0
        /// <summary>
        /// Build a list of all eform components, filtered by disease
        /// </summary>
        private void BuildEFormComponents()
        {
            // set visibility
            EformComponentHolder.Visible = true;
            EformListPanel.Visible       = false;

            // get componenets by disease
            if (!string.IsNullOrEmpty(QueryDiseaseName))
            {
                var components = from component in GetEformComponentsByDisease(QueryDiseaseName)
                                 select new
                {
                    Disease   = QueryDiseaseName,
                    Component = component.Key,
                    Path      = component.Value
                };

                if (components.Count() > 0)
                {
                    // build list of componenets
                    EformComponentsRptr.DataSource = components;
                    EformComponentsRptr.DataBind();
                    NoComponentResultsMsg.Visible = false;

                    EFormComponentCount.Text = components.Count().ToString();
                }
            }
            // combine all disease/view components
            else
            {
                var views = CaisisConfiguration.GetViewConfigList();
                // for each view, create a list of objects represeting a component, flatten lists
                var components = (from view in views
                                  orderby view.Name ascending
                                  select from component in GetEformComponentsByDisease(view.Name)
                                  select new
                {
                    Disease = view.Name,
                    Component = component.Key,
                    Path = component.Value
                }
                                  ).SelectMany(c => c);

                // build list of componenets
                EformComponentsRptr.DataSource = components;
                EformComponentsRptr.DataBind();

                EFormComponentCount.Text = components.Count().ToString();
            }
        }
        override protected void Page_Load(object sender, EventArgs e)
        {
            GlobalInstitution.Text = CaisisConfiguration.GetWebConfigValue("institutionShortName");

            base.Page_Load(sender, e);
            base.SetTitle(ComponentTitle);

            //string SurgeryDate = "";
            //if (Session[SessionKey.CurrentClinicDate] != null) SurgeryDate = Session[SessionKey.CurrentClinicDate].ToString();
            //if (SurgeryDate.Length > 0)
            //{
            //    SetHiddenDateFieldPair(ProcDateText, ProcDate, SurgeryDate);
            //}
        }
Exemple #22
0
        protected override void Page_Load(object sender, EventArgs e)
        {
            ListItem defaultIns = new ListItem();

            defaultIns.Value = CaisisConfiguration.GetWebConfigValue("institutionShortName");
            defaultIns.Text  = CaisisConfiguration.GetWebConfigValue("institutionShortName");
            DxInstitutionDefaultBtn.Items.Add(defaultIns);

            base.Page_Load(sender, e);
            base.SetTitle(ComponentTitle);

            string[] searchFilter = new string[] { "BMD", "Bone Mineral Density" };
            BuildBMDDiagnostics(this._patientId, this._eformName, "Dynamic", Diagnostic.DxType, " IN ", searchFilter);
        }
        protected override void Page_Load(object sender, System.EventArgs e)
        {
            // get ID type from web config
            _identifierType     = CaisisConfiguration.GetWebConfigValue("SpecimenModuleDefaultId");
            IdentifierType.Text = _identifierType;

            // Set Helper variables
            isPostBack  = Page.IsPostBack;
            setCriteria = !string.IsNullOrEmpty(getQS("setCriteria")); // No Value or Non-existant makes this false
            if (!isPostBack)
            {
                LoadPriorQueryParams();
            }
        }
Exemple #24
0
        private bool HasModuleAccess(string url)
        {
            Dictionary <string, string> map = null;

            if (!CacheManager.IsInCache("modulesecurity"))
            {
                XmlNodeList tabs = CaisisConfiguration.GetTabsList();
                map = new Dictionary <string, string>();

                var q =
                    from XmlNode x in tabs
                    let locationEl = x["location"]
                                     let tabName = x.Attributes["name"].Value.ToUpper()
                                                   where locationEl != null && locationEl.InnerText.StartsWith("/")
                                                   select new
                {
                    Location = locationEl.InnerText.Split('/')[1],
                    Tab      = tabName
                };

                foreach (var t in q)
                {
                    map[t.Location.ToUpper()] = t.Tab;
                }

                CacheManager.InsertIntoCache("modulesecurity", map, 240);
            }
            else
            {
                map = (Dictionary <string, string>)CacheManager.GetFromCache("modulesecurity");
            }

            if (Session[SessionKey.GroupViewCode] != null)
            {
                string upperUrl      = url.ToUpper();
                string groupViewCode = Session[SessionKey.GroupViewCode].ToString();

                foreach (string location in map.Keys)
                {
                    if (upperUrl.Contains(location))
                    {
                        return(groupViewCode.Contains(map[location]));
                    }
                }
            }

            // default allow
            return(true);
        }
Exemple #25
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            // Verify User Permission and Valid Eform Id
            string queryEformId   = Request.QueryString["encEformId"];
            string queryEformName = Request.QueryString["encEformName"];

            if (PermissionManager.HasPermission(PermissionManager.EditSecurity))
            {
                XmlDocument xmlDoc = null;
                // load xml from db
                if (!string.IsNullOrEmpty(queryEformId))
                {
                    int       eformId = int.Parse(Security.CustomCryptoHelper.Decrypt(queryEformId));
                    BOL.EForm biz     = new Caisis.BOL.EForm();
                    biz.Get(eformId);
                    string eformXML = biz[BOL.EForm.EFormXML].ToString();
                    // attempt to load/parse xml into document
                    try
                    {
                        xmlDoc = new XmlDocument();
                        xmlDoc.LoadXml(eformXML);
                    }
                    catch
                    {
                        Response.Write(eformXML);
                    }
                }
                // load eform from file
                else if (!string.IsNullOrEmpty(queryEformName))
                {
                    string eformName = Security.CustomCryptoHelper.Decrypt(queryEformName);
                    xmlDoc = CaisisConfiguration.GetEFormsXmlByName(eformName);
                }
                // write if xml document exists
                if (xmlDoc != null && !string.IsNullOrEmpty(xmlDoc.InnerXml))
                {
                    Response.Clear();
                    // set header
                    Response.ContentType = "text/xml";
                    // write xml to response stream
                    xmlDoc.Save(Response.OutputStream);
                }

                // cleanup
                Response.Flush();
                Response.End();
            }
        }
Exemple #26
0
        protected void HidePasswordButtons()
        {
            string loginMode = CaisisConfiguration.GetWebConfigValue("LDAPAuthenticationMode");

            if (string.Equals(loginMode, "On", StringComparison.CurrentCultureIgnoreCase) || string.Equals(loginMode, "AccessMgr", StringComparison.CurrentCultureIgnoreCase))
            {
                ChangePasswordButton.Visible = false;
                ForgotPasswordButton.Visible = false;

                // does it use EZ Password?
                string useEzPassword = CaisisConfiguration.GetWebConfigValue("AccessMgrURL");
                if (string.Equals(useEzPassword, "ezpassword", StringComparison.CurrentCultureIgnoreCase))
                {
                    EzPasswordImg.Visible = true;
                }
            }
        }
Exemple #27
0
        /// <summary>
        /// Builds a list of all modules/tabs
        /// </summary>
        private void BuildModulesTabs()
        {
            var tabs = from tab in CaisisConfiguration.GetModuleConfigList()
                       where tab.IsTab
                       select tab.Name;

            ModulesRptr.DataSource = tabs;
            ModulesRptr.DataBind();

            // set labels
            ListMainLabel.Text  = "Modules / Tabs";
            ListCountLabel.Text = tabs.Count().ToString();
            ListLabel.Text      = "Modules in Caisis";

            // set list visibility
            ModulesRptr.Visible      = true;
            ModuleGroupsRptr.Visible = false;
        }
Exemple #28
0
        /// <summary>
        /// Renders the CusotmMenu Control to the specified HtmlTextWriter
        /// </summary>
        /// <param name="output">Output writer</param>
        protected override void Render(HtmlTextWriter output)
        {
            EnsureDataBindings(this.Controls);
            this.EnableViewState = false;
            MenuList menu;
            string   viewMode = new Caisis.Security.SecurityController().GetViewMode();

            // special case
            if (!string.IsNullOrEmpty(CaisisConfigurationType) && CaisisConfigurationType == "PatientDataEntryConfig")
            {
                xDoc = CaisisConfiguration.GetPatientDataConfig();
                menu = LoadMenusFromXml();
            }
            else
            {
                xDoc.Load(this.MapPathSecure(this.XMLMenuFile));
                if (CacheManager.IsInCache(this.XMLMenuFile + "XmlDoc") && CacheManager.IsInCache(this.XMLMenuFile + viewMode))
                {
                    XmlDocument cachedXml = (XmlDocument)CacheManager.GetFromCache(this.XMLMenuFile + "XmlDoc");
                    if (xDoc.InnerXml == cachedXml.InnerXml)
                    {
                        menu = (MenuList)CacheManager.GetFromCache(this.XMLMenuFile + viewMode);
                    }
                    else
                    {
                        menu = LoadMenusFromXml();
                        CacheManager.InsertIntoCache(this.XMLMenuFile + viewMode, menu, 10);
                        CacheManager.InsertIntoCache(this.XMLMenuFile + "XmlDoc", xDoc, 10);
                    }
                }
                else
                {
                    menu = LoadMenusFromXml();
                    CacheManager.InsertIntoCache(this.XMLMenuFile + viewMode, menu, 10);
                    CacheManager.InsertIntoCache(this.XMLMenuFile + "XmlDoc", xDoc, 10);
                }
            }
            menu.RenderControl(output);
            Literal l = new Literal();

            l.Text = "<script type='text/javascript' language='javascript'>if(InitMenu) { InitMenu(); }</script>";
            l.RenderControl(output);
        }
Exemple #29
0
        /// <summary>
        /// Builds a list of default idenfitiers used for default search parameters
        /// as well as identifier on various forms.
        /// </summary>
        private void BuildDefaultIdentifiers()
        {
            // determine if list should be Shown
            string showIdentifierOnLogin = CaisisConfiguration.GetWebConfigValue("ShowIdentifiersOnLogin");

            // only build and show list if web config key explicity set to true
            if (!string.IsNullOrEmpty(showIdentifierOnLogin) && bool.Parse(showIdentifierOnLogin))
            {
                LookupCodeDa lkpDa         = new LookupCodeDa();
                DataView     defaultIdList = lkpDa.GetLookupCodesAttributeValues("IdType", "UseAsDefault").DefaultView;
                DefaultIdentifiersRadioList.DataSource = defaultIdList;
                DefaultIdentifiersRadioList.DataBind();

                // only show identifiers radio when values exist
                if (defaultIdList.Count > 0)
                {
                    // show list
                    IdentifiersPanel.Visible = true;
                    // select value in list if in cookie
                    HttpCookie defaultIdTypeCookie = GetDefaultIdTypeCookie();
                    if (defaultIdTypeCookie != null)
                    {
                        string defaultIdType = defaultIdTypeCookie.Value;
                        // if a value exists in cookie, check default radio
                        if (!string.IsNullOrEmpty(defaultIdType))
                        {
                            foreach (ListItem item in DefaultIdentifiersRadioList.Items)
                            {
                                if (item.Value == defaultIdType)
                                {
                                    item.Selected = true;
                                    break;
                                }
                            }
                        }
                    }
                }
                else
                {
                    IdentifiersPanel.Visible = false;
                }
            }
        }
Exemple #30
0
        protected override void OnLoad(EventArgs e)
        {
            string graphMode = CaisisConfiguration.GetWebConfigValue("ShowLabGraph");

            if (string.Equals(graphMode, "All", StringComparison.InvariantCultureIgnoreCase))
            {
                labOpenGraph.Visible = true;
            }
            else if (string.Equals(graphMode, "PSA", StringComparison.InvariantCultureIgnoreCase))
            {
                psaOpenGraph.Visible = true;
            }
            else if (string.Equals(graphMode, "Both", StringComparison.InvariantCultureIgnoreCase))
            {
                labOpenGraph.Visible = true;
                psaOpenGraph.Visible = true;
            }

            base.OnLoad(e);
        }