コード例 #1
0
        private void btnAlterGroupSet_Click(object sender, EventArgs e)
        {
            try
            {
                NoiseRecorderGroup alterGrp = new NoiseRecorderGroup();
                alterGrp.ID     = Convert.ToInt32(txtGroupID.Text);
                alterGrp.Name   = txtGroupName.Text;
                alterGrp.Remark = txtGroupNote.Text;
                int query = NoiseDataBaseHelper.UpdateGroup(alterGrp);

                if (query != -1)
                {
                    GlobalValue.groupList = NoiseDataBaseHelper.GetGroups();
                    XtraMessageBox.Show("更新成功!", GlobalValue.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    //LoadGroupList();
                    BindTree();
                }
                else
                {
                    throw new Exception("数据入库发生错误。");
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("更新失败:" + ex.Message, GlobalValue.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }