コード例 #1
0
        public object getAllDictionary()
        {
            Bis.DictionaryMethod bisDictionary = new Bis.DictionaryMethod();

            try
            {
                ViewModel.Search searchDictionary = new ViewModel.Search();
                DataSet          ds = bisDictionary.GetDictionaryData(searchDictionary);
                System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
                List <Dictionary <string, object> > rows = new List <Dictionary <string, object> >();
                Dictionary <string, object>         row;
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    row = new Dictionary <string, object>();
                    foreach (DataColumn col in ds.Tables[0].Columns)
                    {
                        row.Add(col.ColumnName, dr[col]);
                    }
                    rows.Add(row);
                }
                return(serializer.Serialize(rows));
            }
            catch (Exception)
            {
                throw;
            }
        }