Example #1
0
        private void barButtonItem11_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            //typeFlag2 = this.ctrlPowerEachList1.FocusedObject.UID;
            if (this.ctrlPowerEachList1.FocusedObject == null)
            {
                MsgBox.Show("没有指定的项目存在,请先添加项目分类管理!");
                return;
            }
            FrmEditProject5 frm = new FrmEditProject5();

            frm.FlagId = typeFlag2;
            frm.Type = type;
            try
            {
                if (treeList1.FocusedNode["ID"].ToString() != null && treeList1.FocusedNode["ID"].ToString() == "")
                    frm.PowerUId = treeList1.FocusedNode["ID"].ToString();
            }
            catch { }
            //treeList1.FocusedNode.GetValue("ID");

            if (frm.ShowDialog() == DialogResult.OK)
            {
                //PSP_PowerTypes_Liao psp_Type = new PSP_PowerTypes_Liao();
                //psp_Type.Title = frm.TypeTitle;
                //psp_Type.Flag = 0;
                //psp_Type.Flag2 = typeFlag2;
                //psp_Type.ParentID = 0;

                //try
                //{
                //    psp_Type.ID = (int)Common.Services.BaseService.Create("InsertPSP_PowerTypes_Liao", psp_Type);
                //    dataTable.Rows.Add(Itop.Common.DataConverter.ObjectToRow(psp_Type, dataTable.NewRow()));
                //}
                //catch (Exception ex)
                //{
                //    MsgBox.Show("增加项目出错:" + ex.Message);
                //}

            }
            ReLoad();
        }
Example #2
0
        private void barButtonItem13_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (treeList1.FocusedNode == null)
            {
                return;
            }

            //if (treeList1.FocusedNode.ParentNode == null)
            //{
            //    MsgBox.Show("一级分类名称不能修改!");
            //    return;
            //}
            FrmEditProject5 frm = new FrmEditProject5();

            frm.FlagId = typeFlag2;
            frm.Type = type;
            frm.PowerUId = treeList1.FocusedNode["ID"].ToString();
            frm.Isupdate = true;
            ////FormTypeTitle frm = new FormTypeTitle();
            ////frm.TypeTitle = treeList1.FocusedNode.GetValue("Title").ToString();
            ////frm.Text = "修改项目名";

            if (frm.ShowDialog() == DialogResult.OK)
            {
                ////PSP_PowerTypes_Liao psp_Type = new PSP_PowerTypes_Liao();
                ////Class1.TreeNodeToDataObject<PSP_PowerTypes_Liao>(psp_Type, treeList1.FocusedNode);
                ////psp_Type.Title = frm.TypeTitle;

                ////try
                ////{
                ////    Common.Services.BaseService.Update<PSP_PowerTypes_Liao>(psp_Type);
                ////    treeList1.FocusedNode.SetValue("Title", frm.TypeTitle);
                ////}
                ////catch (Exception ex)
                ////{
                ////    //MsgBox.Show("修改出错:" + ex.Message);
                ////}
            }
            ReLoad();
        }
Example #3
0
        private void treeList1_DoubleClick(object sender, EventArgs e)
        {
            //  FrmEditProject3 fep = new FrmEditProject3();
            if (!EditRight)
                return;
            if (treeList1.FocusedNode == null)
            {
                return;
            }
            FrmEditProject5 fep = new FrmEditProject5();
            string uid1="不存在 ";
            try
            {
                fep.FlagId = typeFlag2;
                fep.PowerUId = treeList1.FocusedNode["ID"].ToString();
                uid1 = treeList1.FocusedNode["ID"].ToString();
                fep.Type = type;
                fep.Isupdate = true;
            }
            catch { }
            if (uid1 == "不存在 ")
            {
                MsgBox.Show("没有记录存在,无法修改!");
                return;
            }

            if (fep.ShowDialog() == DialogResult.OK)
            {
                ReLoad();
                //LoadData();
                treeList1.ExpandAll();
                FoucsLocation(uid1, treeList1.Nodes);
            }
        }