Exemplo n.º 1
0
 private void BindCert()
 {
     this.DropDownList12.DataSource     = Dicts.GetCacheDictsByName("CertType").Items;
     this.DropDownList12.DataTextField  = "KeyValue";
     this.DropDownList12.DataValueField = "KeyName";
     this.DropDownList12.DataBind();
 }
Exemplo n.º 2
0
        private void GetDictItemsByName()
        {
            DictsInfo cacheDictsByName = Dicts.GetCacheDictsByName(WebUtils.GetQueryString("dictname"));

            if (cacheDictsByName != null && cacheDictsByName.Items.Count > 0)
            {
                base.Response.Write(JsonUtils.ObjectToJson <System.Collections.Generic.IList <DictItemInfo> >(cacheDictsByName.Items));
            }
            else
            {
                base.Response.Write(string.Empty);
            }
        }
Exemplo n.º 3
0
 private void InitSettings()
 {
     if (!this.isLoad)
     {
         this.dropField.Attributes.Add("FieldID", base.FieldName);
         this.dropField.Items.Clear();
         if (base.Settings.DataSource.IsNullOrEmpty())
         {
             this.dropField.Items.Add(new ListItem("未设置", "-1"));
         }
         else
         {
             string dataFrom = base.Settings.DataFrom;
             if (dataFrom != null)
             {
                 if (!(dataFrom == "Text"))
                 {
                     if (!(dataFrom == "DataDictionary"))
                     {
                         if (dataFrom == "SQLQuery")
                         {
                             this.dropField.DataSource     = BaseFieldControl.dbo.GetDataTable(base.Settings.DataSource);
                             this.dropField.DataTextField  = "KeyValue";
                             this.dropField.DataValueField = "KeyName";
                             this.dropField.DataBind();
                         }
                     }
                     else
                     {
                         this.dropField.DataSource     = Dicts.GetCacheDictsByName(base.Settings.DataSource).Items;
                         this.dropField.DataTextField  = "KeyValue";
                         this.dropField.DataValueField = "KeyName";
                         this.dropField.DataBind();
                     }
                 }
                 else
                 {
                     string[] array = base.Settings.DataSource.Split(new char[]
                     {
                         ','
                     });
                     for (int i = 0; i < array.Length; i++)
                     {
                         string   text   = array[i];
                         string[] array2 = text.Split(new char[]
                         {
                             '|'
                         });
                         if (array2.Length == 2)
                         {
                             this.dropField.Items.Add(new ListItem(array2[0], array2[1]));
                         }
                         else
                         {
                             this.dropField.Items.Add(new ListItem(text, text));
                         }
                     }
                 }
             }
         }
     }
     this.isLoad = true;
 }