关于hashtable 用法之三

来源:互联网 发布:淘宝钱盾一直认证失败 编辑:程序博客网 时间:2024/06/06 05:47

  #region public Hashtable  GetFlowFormData(string strFlowINSTNo)
  public Hashtable GetFlowFormData(string strFlowINSTNo)
  {
   
   Hashtable hsTable = new Hashtable();
   DataTable dt = FlowHelper.getFormData(strFlowINSTNo);
   
   if (dt==null|| dt.Rows.Count==0)
   {
    return hsTable;
   }

   for(int i=0;i<dt.Rows.Count;i++)
   {
    string strKey = dt.Rows[i]["FORM_ITME_NO"] != null?dt.Rows[i]["FORM_ITME_NO"].ToString().Trim():"";
    string strValue = dt.Rows[i]["FORM_DATA"] != null?dt.Rows[i]["FORM_DATA"].ToString().Trim():"";
    hsTable.Add(strKey,strValue);
   }

   return hsTable;
  }
  #endregion

 

 

以下是关相关的调用

   Hashtable htItemData = ctlF020501.GetFlowFormData(FlowInstNo);

     string strItemValue = htItemData.Contains(strControlId)?htItemData[strControlId].ToString():"";

原创粉丝点击