编程人生

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

namespace CDR.components
{
 /// <summary>
 /// CallerType 的摘要说明。
 /// </summary>
 public enum CallerType
 {
  Call = 1,
  Relay,
  SoftSwitch
 }

 public class CallerTypes
 {
  public static HybridDictionary types = new  HybridDictionary();
  
  static CallerTypes()
  {
   types[CallerType.Call] = "主叫";
   types[CallerType.Relay] = "中继";
   types[CallerType.SoftSwitch] = "软交换";
  }

  public static HybridDictionary Types
  {
   get{return types;}
  }
 }
}

  private void Page_Load(object sender, System.EventArgs e)
  {
   // 在此处放置用户代码以初始化页面
   if(!IsPostBack)
   {
    BindCallerType(txtCallerTypeID);
   }
  }

  private void BindCallerType(DropDownList ddl)
  {
   try
   {
    ddl.Items.Clear();
    ddl.DataSource = CallerTypes.types.Values;
    ddl.DataBind();
   }
   catch
   {}
  }

posted on 2006-09-29 15:06  choice  阅读(318)  评论(0编辑  收藏  举报