Esempio n. 1
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;
                }
            }
        }