Ejemplo n.º 1
0
 public string GetSavedData(FormFieldDataType dataType)
 {
     if (dataType == FormFieldDataType.Data)
     {
         return(String.Format("{1}{0}{2}{0}{3}", ItemSplitter, this.Id, this.Text, this.Value));
     }
     else //if(dataType== FormFieldDataType.Item)
     {
         return(String.Format("{1}{0}{2}{0}{3}", ItemSplitter, this.Id, this.Text, this.Type));
     }
 }
Ejemplo n.º 2
0
 public FormFieldCollection(String data, FormFieldDataType dataType)
 {
     if (String.IsNullOrEmpty(data))
     {
         return;
     }
     string[] datas = data.Split(new String[] { GroupSplitter }, StringSplitOptions.None);
     foreach (String s in datas)
     {
         this._FORM_FIELDS.Add(new FormField(s, dataType));
     }
 }
Ejemplo n.º 3
0
        public string GetSavedDatas(FormFieldDataType dataType)
        {
            StringBuilder sb = new StringBuilder();

            foreach (FormField ff in this._FORM_FIELDS)
            {
                if (sb.Length > 0)
                {
                    sb.Append(GroupSplitter);
                }
                sb.Append(ff.GetSavedData(dataType));
            }
            return(sb.ToString());
        }
Ejemplo n.º 4
0
 public FormField(string data, FormFieldDataType dataType)
 {
     if (String.IsNullOrEmpty(data))
     {
         return;
     }
     string[] datas = data.Split(new String[] { ItemSplitter }, StringSplitOptions.None);
     if (datas.Length != 3)
     {
         return;
     }
     if (dataType == FormFieldDataType.Data)
     {
         this.Id    = datas[0];
         this.Text  = datas[1];
         this.Value = datas[2];
     }
     else //if(dataType== FormFieldDataType.Item)
     {
         this.Id   = datas[0];
         this.Text = datas[1];
         this.Type = datas[2];
     }
 }