Example #1
0
        /// <summary>
        /// Sets required key fields and helper data sources
        /// </summary>
        private void InitParamaters()
        {
            _diseaseName            = !string.IsNullOrEmpty(QueryDiseaseName) ? QueryDiseaseName : string.Empty;
            _diseaseAttributeLookup = new Dictionary <int, int>();
            _lkpDiseaseAttributeId  = null;

            // set data sources
            LookupCodeDa da = new LookupCodeDa();

            if (QueryDiseaseId.HasValue)
            {
                var lkpAttributes = BOL.BusinessObject.GetByFields <LookupAttribute>(new Dictionary <string, object> {
                    { LookupAttribute.AttributeName, "Disease" }
                });
                if (lkpAttributes.Count() > 0)
                {
                    _lkpDiseaseAttributeId = (int)lkpAttributes.First()[LookupAttribute.AttributeId];
                    // get lookup codes for current disease
                    var diseaseLkpCode = BOL.BusinessObject.GetByFields <LookupCodeAttribute>(new Dictionary <string, object>
                    {
                        { LookupCodeAttribute.AttributeId, _lkpDiseaseAttributeId.Value },
                        { LookupCodeAttribute.AttributeValue, QueryDiseaseName }
                    });
                    // create lookup to get lookup attribute id by lookup code id
                    _diseaseAttributeLookup = diseaseLkpCode.ToDictionary(b => (int)b[LookupCodeAttribute.LookupCodeId], b => (int)b[LookupCodeAttribute.LookupCodeAttributeId]);
                }
            }
            // set main lookup data source
            _lkpCodesTable = da.GetLookupFieldNames().Tables[0];
        }
Example #2
0
        protected void BindLookupCodeDropDowns()
        {
            LookupCodeDa da = new LookupCodeDa();
            DataTable    lookupDataSource = da.GetLookupFieldNames().Tables[0];

            LookupCodes.DataSource = lookupDataSource;
            LookupCodes.DataBind();
            ChildLookupCodeField.DataSource = lookupDataSource;
            ChildLookupCodeField.DataBind();
        }
        /// <summary>
        ///
        /// </summary>
        private void BuildDropDownLists()
        {
            LookupCodeDa da             = new LookupCodeDa();
            DataTable    lookupCodeList = da.GetLookupFieldNames().Tables[0];

            LookupCodesList.DataSource = lookupCodeList;
            LookupCodesList.DataBind();

            // Bind dropdown list
            LookupAttributesList.DataSource = LookupAttributesDataView;
            LookupAttributesList.DataBind();
        }
Example #4
0
        protected void PopulateLookupFieldDropDown()
        {
            LookupCodeDa da = new LookupCodeDa();
            DataSet      ds = da.GetLookupFieldNames();

            if (ds.Tables.Count > 0)
            {
                fieldName.DataSource     = ds.Tables[0].DefaultView;
                fieldName.DataTextField  = "LkpFieldName";
                fieldName.DataValueField = "LkpFieldName";
                fieldName.DataBind();
            }
        }