using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LYFZ.WXLibrary
{
  public class KeywordObjects
    {
      public KeywordObjects() { 
      
      }
      public KeywordObjects(string keywordString)
      {
          string[] temps = keywordString.Split(',');
          if (temps.Length == 3)
          {
              this._FunctionCode = temps[0];
              this._Keyword = temps[1];
              try
              {
                  if (temps[2].Trim() == "0")
                  {
                      this.IsEnabled = false;
                  }
                  else {
                      this.IsEnabled = true;
                  }
              }
              catch { }
             
          }
      }
      public KeywordObjects(System.Data.DataRow row)
      {
          this._FunctionCode = row["FunctionCode"].ToString();
          this._Keyword = row["Keyword"].ToString();
          if (row["isEnabled"].ToString() == "0")
          {
              this.IsEnabled = false;
          }
          else {
              this.IsEnabled = true;
          }
      }
      string _Keyword = "";
      /// <summary>
      /// 关键字
      /// </summary>
      public string Keyword
      {
          get { return _Keyword; }
          set { _Keyword = value; }
      }
      string _FunctionCode = "";
      /// <summary>
      /// 所属功能模块
      /// </summary>
      public string FunctionCode
      {
          get { return _FunctionCode; }
          set { _FunctionCode = value; }
      }
      bool _isEnabled = true;
      /// <summary>
      /// 是否启用
      /// </summary>
      public bool IsEnabled
      {
          get { return _isEnabled; }
          set { _isEnabled = value; }
      }
    }
}