Пример #1
0
 //修改
 void _barbtnUpdate_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (treeListData.FocusedNode == null)
     {
         ControlsHelper.ShowWarningMessage("提醒", "请点击修改的站点");
     }
     else
     {
         string id = treeListData.FocusedNode["ID"].ToString();
         CoSite site = dataSource.Find(obj=>obj.ID == id);
         FrmSiteEdit frmSite = new FrmSiteEdit(DBOperateType.Update, site, null);
         if (frmSite.ShowDialog() == DialogResult.OK)
         {
             BindList();
             treeListData.ExpandAll();
             ControlsHelper.ShowAlertMessage(this.ParentForm, "修改", "修改成功");
         }
     }
 }
Пример #2
0
 //新增
 void _barbtnInsert_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     this.Cursor = Cursors.WaitCursor;
     if (treeListData.FocusedNode == null)
     {
         ControlsHelper.ShowWarningMessage("提醒", "请点击新增站点的上级站点");
     }
     else
     {
         string id = treeListData.FocusedNode["ID"].ToString();
         FrmSiteEdit frmSite = new FrmSiteEdit(DBOperateType.Insert, null, id);
         if (frmSite.ShowDialog() == DialogResult.OK)
         {
             BindList();
             treeListData.ExpandAll();
             ControlsHelper.ShowAlertMessage(this.ParentForm, "新增", "新增成功");
         }
     }
     this.Cursor = Cursors.Default;
 }