public void addNewWord(String chinese, String english)
        {
            TransDataModel newData = new TransDataModel()
            {
                id      = english.Substring(0, 1).ToUpper() + english.Substring(1),
                chinese = chinese,
                english = english
            };
            OptResult r = translator.addNewWordToDict(newData.id, new Dictionary <LanguageEnum, string>()
            {
                { LanguageEnum.CHINESE, newData.chinese },
                { LanguageEnum.ENGLISH, newData.english }
            });

            if (r.result == true)
            {
                gridData.Add(newData);
                dataGrid.ItemsSource = null;
                dataGrid.ItemsSource = gridData;
            }
            else
            {
                new Alert(r.info, this).ShowDialog();
            }
        }
        public void delWord(String id)
        {
            TransDataModel rmData = new TransDataModel();

            foreach (TransDataModel data in gridData)
            {
                if (data.id.Equals(id))
                {
                    rmData = data;
                    break;
                }
            }
            OptResult r = translator.delWordFromDict(id);

            if (r.result == true)
            {
                gridData.Remove(rmData);
                dataGrid.ItemsSource = null;
                dataGrid.ItemsSource = gridData;
            }
            else
            {
                new Alert(r.info, this).ShowDialog();
            }
        }