コード例 #1
0
 public ConstituentAttributeCollection(ConstituentAttribute[] attributes)
 {
     _attributes = attributes;
 }
コード例 #2
0
ファイル: WebClient.cs プロジェクト: ThePublicTheater/NYSF
 public static ConstituentAttributeCollection GetConstituentAttributes()
 {
     DataSet result = unsecuredClient.GetConstituentInfoEx(
         SessionKey: HttpContext.Current.Session[TessSessionKeySessionKey].ToString(),
         TableListTokens: "AT");
     DataRowCollection attRows = result.Tables["ConstituentAttribute"].Rows;
     List<ConstituentAttribute> atts = new List<ConstituentAttribute>();
     foreach (DataRow attRow in attRows)
     {
         string name = attRow["attribute"].ToString();
         int id = Convert.ToInt32(attRow["keyword_no"]);
         switch (Convert.ToInt32(attRow["data_type"]))
         {
             case 1: // string
                 string strVal = attRow["attribute_value"].ToString();
                 ConstituentAttribute<string> newStrAtt =
                     new ConstituentAttribute<string>(name, id, strVal);
                 atts.Add(newStrAtt);
                 break;
             case 2: // int
                 int intVal = Convert.ToInt32(attRow["attribute_value"]);
                 ConstituentAttribute<int> newIntAtt =
                     new ConstituentAttribute<int>(name, id, intVal);
                 atts.Add(newIntAtt);
                 break;
             case 3: // date
                 DateTime dateVal = Convert.ToDateTime(attRow["attribute_value"]);
                 ConstituentAttribute<DateTime> newDateAtt =
                     new ConstituentAttribute<DateTime>(name, id, dateVal);
                 atts.Add(newDateAtt);
                 break;
         }
     }
     return new ConstituentAttributeCollection(atts.ToArray());
 }
コード例 #3
0
 public Enumerator(ConstituentAttribute[] attributes)
 {
     _attributes = attributes;
 }