Exemple #1
0
        public MyDictionary GetItem(MyDictionary.DictionaryType type, string code)
        {
            //string sql = "select * from JCHVRF_Dictionary where Type='" + type.ToString()
            //    + "' and Code = '" + code + "'";
            DataTable dt = JCBase.Utility.Util.InsertDsCachForLoad("JCHVRF_Dictionary");

            if (dt != null && dt.Rows.Count > 0)
            {
                DataView dv = dt.DefaultView;
                dv.RowFilter = "Type='" + type.ToString() + "' and Code = '" + code + "'";
                dt           = dv.ToTable();
                DataRow      dr  = dt.Rows[0];
                MyDictionary dic = new MyDictionary();
                dic.Code    = code;
                dic.DicType = type;
                dic.Name    = (dr["Name"] is DBNull) ? "" : dr["Name"].ToString().Trim();
                return(dic);
            }
            return(null);
        }
Exemple #2
0
        public List <MyDictionary> GetList(MyDictionary.DictionaryType type)
        {
            //string sql = "select * from JCHVRF_Dictionary where trim(Type)='" + type.ToString() + "'";
            DataTable dt = JCBase.Utility.Util.InsertDsCachForLoad("JCHVRF_Dictionary");

            if (dt != null && dt.Rows.Count > 0)
            {
                DataView dv = dt.DefaultView;
                dv.RowFilter = "trim(Type)='" + type.ToString() + "'";
                dt           = dv.ToTable();
                List <MyDictionary> list = new List <MyDictionary>();
                foreach (DataRow dr in dt.Rows)
                {
                    MyDictionary dic = new MyDictionary();
                    dic.DicType = type;
                    dic.Code    = (dr["Code"] is DBNull) ? "" : dr["Code"].ToString().Trim();
                    dic.Name    = (dr["Name"] is DBNull) ? "" : dr["Name"].ToString().Trim();
                    list.Add(dic);
                }
                return(list);
            }
            return(null);
        }
Exemple #3
0
 public List <MyDictionary> GetList(MyDictionary.DictionaryType type)
 {
     return(GetList(type));
 }
Exemple #4
0
 public MyDictionary GetItem(MyDictionary.DictionaryType type, string code)
 {
     return(_dal.GetItem(type, code));
 }