Beispiel #1
0
 //删除声母表选中行
 private void sm_del_Click(object sender, EventArgs e)
 {
     if (dataGridView_sm.SelectedRows.Count > 0)
     {
         shengmu smobj = dataGridView_sm.SelectedRows[0].Tag as shengmu;
         Cursor.Current = Cursors.WaitCursor;
         try
         {
             if (sm_list.Remove(smobj))
             {
                 RefreshSmList();
             }
             else
             {
                 MessageBox.Show("删除失败!");
             }
         }
         finally
         {
             Cursor.Current = Cursors.Default;
         }
     }
     else
     {
         MessageBox.Show("请选择要删除的行!", "系统提示");
     }
 }
Beispiel #2
0
        //新增声母表
        private void sm_add_Click(object sender, EventArgs e)
        {
            shengmu smobj = new shengmu();

            smobj.id    = sm_id;
            smobj.count = smtxt1.Text.Trim() + "&" + sm_combox.Text.Trim() + "&" + smtxt2.Text.Trim();
            sm_list.Add(smobj);
            RefreshSmList();
            sm_id++;
            smtxt1.Focus();
        }
Beispiel #3
0
 /// <summary>
 /// 刷新列表
 /// </summary>
 /// <param name="id"></param>
 public void RefreshCode(int id)
 {
     Cursor.Current = Cursors.WaitCursor;
     _obj           = bll.Get(id);
     if (_obj != null)
     {
         smtxt1.Text    = "";
         sm_combox.Text = "→";
         smtxt2.Text    = "";
         ymtxt1.Text    = "";
         ym_combox.Text = "→";
         ymtxt2.Text    = "";
         CommonHelper.setForm(_obj, panel1.Controls);
         sm_list = new List <shengmu>();
         if (!string.IsNullOrEmpty(_obj.SHENGMU))
         {
             string[] shengmulit = null;
             shengmulit = _obj.SHENGMU.Split('〓');
             for (int i = 0; i < shengmulit.Length; i++)
             {
                 shengmu sm_obj = new shengmu()
                 {
                     id = i + 1, count = shengmulit[i]
                 };
                 sm_list.Add(sm_obj);
             }
             RefreshSmList();
         }
         ym_list = new List <yunmu>();
         if (!string.IsNullOrEmpty(_obj.YUNMU))
         {
             string[] yunmulit = null;
             yunmulit = _obj.YUNMU.Split('〓');
             for (int i = 0; i < yunmulit.Length; i++)
             {
                 yunmu ym_obj = new yunmu()
                 {
                     id = i + 1, count = yunmulit[i]
                 };
                 ym_list.Add(ym_obj);
             }
             RefreshYmList();
         }
     }
     else
     {
         SetDefault();
     }
     Cursor.Current = Cursors.Default;
 }