예제 #1
0
        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            TreeListNode focusedNode = treeList1.FocusedNode;

            if (focusedNode == null)
            {
                return;
            }

            if (base.AddRight)
            {
                MsgBox.Show("您没有权限进行此项操作!");
                return;
            }
            if (!base.AddRight)
            {
                MsgBox.Show("您没有权限进行此项操作!");
                return;
            }

            Form_Add_GDPTitle frm = new Form_Add_GDPTitle();

            frm.Text = "增加" + focusedNode.GetValue("Title") + "的子分类";

            if (frm.ShowDialog() == DialogResult.OK)
            {
                PSP_GDPTypes psp_Type = new PSP_GDPTypes();
                psp_Type.Title    = frm.GDPTitle;
                psp_Type.Flag     = (int)focusedNode.GetValue("Flag");
                psp_Type.Flag2    = (int)focusedNode.GetValue("Flag2");
                psp_Type.ParentID = (int)focusedNode.GetValue("ID");

                try
                {
                    psp_Type.ID = (int)Common.Services.BaseService.Create("InsertPSP_GDPTypes", psp_Type);
                    dataTable.Rows.Add(Itop.Common.DataConverter.ObjectToRow(psp_Type, dataTable.NewRow()));
                }
                catch (Exception ex)
                {
                    MsgBox.Show("增加子分类出错:" + ex.Message);
                }
            }
        }
예제 #2
0
        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            TreeListNode focusedNode = treeList1.FocusedNode;

            if (focusedNode == null)
            {
                return;
            }

            if (base.AddRight)
            {
                MsgBox.Show("您没有权限进行此项操作!");
                return;
            }
            if (!base.AddRight)
            {
                MsgBox.Show("您没有权限进行此项操作!");
                return;
            }

            Form_Add_GDPTitle frm = new Form_Add_GDPTitle();
            frm.Text = "增加" + focusedNode.GetValue("Title") + "的子分类";

            if(frm.ShowDialog() == DialogResult.OK)
            {
                PSP_GDPTypes psp_Type = new PSP_GDPTypes();
                psp_Type.Title = frm.GDPTitle;
                psp_Type.Flag = (int)focusedNode.GetValue("Flag");
                psp_Type.Flag2 = (int)focusedNode.GetValue("Flag2");
                psp_Type.ParentID = (int)focusedNode.GetValue("ID");

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