Example #1
0
        //修改
        void _barbtnUpdate_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            if (treeListData.FocusedNode == null)
            {
                ControlsHelper.ShowWarningMessage("提醒", "请选中修改的项");
            }
            else if (parameterType.TreeFlag && treeListData.FocusedNode.ParentNode == null)
            {
                ControlsHelper.ShowWarningMessage("提醒", "根节点不允许修改");
            }
            else
            {
                int id = int.Parse(treeListData.FocusedNode["ID"].ToString());
                SysParameter parameter = dataSource.Find(obj => obj.ID == id);

                FrmParameterEdit frm = new FrmParameterEdit(DBOperateType.Update, parameter, null);
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    BindList();
                    ControlsHelper.ShowAlertMessage(this.ParentForm, "修改", "修改成功");
                }
            }
            this.Cursor = Cursors.Default;
        }
Example #2
0
 //新增
 void _barbtnInsert_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     this.Cursor = Cursors.WaitCursor;
     if (dataSource == null)
     {
         ControlsHelper.ShowWarningMessage("提醒", "请查询后再新增");
     }
     else if (parameterType.TreeFlag && treeListData.FocusedNode == null)
     {
         ControlsHelper.ShowWarningMessage("提醒", "请点击新增项的上级项");
     }
     else
     {
         FrmParameterEdit frm = new FrmParameterEdit(DBOperateType.Insert, null, dictQuery[lookUpQueryType.Name].ToString());
         if (frm.ShowDialog() == DialogResult.OK)
         {
             BindList();
             ControlsHelper.ShowAlertMessage(this.ParentForm, "新增", "新增成功");
         }
     }
     this.Cursor = Cursors.Default;
 }