示例#1
0
        private void toolStripMenuItem1_1_Click(object sender, EventArgs e)
        {
            FormAddUnitType f = new FormAddUnitType();

            if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                LoadNav();
            }
        }
示例#2
0
        private void toolStripMenuItem1_2_Click(object sender, EventArgs e)
        {
            DevExpress.XtraNavBar.NavBarGroup group = m_MouseSelectControlObject.HintObject as DevExpress.XtraNavBar.NavBarGroup;
            string          id = group.Tag.ToString();
            FormAddUnitType f  = new FormAddUnitType(id);

            if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                LoadNav();
            }
        }
示例#3
0
        private void Event_SubItemClick(object sender, EventArgs e)
        {
            string tag = (sender as ToolStripMenuItem).Tag.ToString();

            if (tag == "REFRESH")
            {
                LoadNav(); //刷新
                return;
            }
            if (m_MouseSelectControlObject != null)
            {
                Model.T_BASE_UNITTYPEModel selectModel = new Model.T_BASE_UNITTYPEModel();
                if (m_MouseSelectControlObject.ObjectType.ToString().ToUpper() == "GROUP")
                {
                    var hitMenu = m_MouseSelectControlObject.HintObject as NavBarGroup;
                    selectModel = hitMenu.Tag as Model.T_BASE_UNITTYPEModel;
                }
                else if (m_MouseSelectControlObject.ObjectType.ToString().ToUpper() == "LINK")
                {
                    var hitMenu = m_MouseSelectControlObject.HintObject as NavBarItemLink;
                    selectModel = (hitMenu.Item.Tag as NavBarItemTag).Tag as Model.T_BASE_UNITTYPEModel;
                }
                if (String.IsNullOrEmpty(selectModel.LXBM))
                {
                    return;
                }
                if (tag.Split('_').Length == 2)
                {
                    switch (tag.Split('_')[1])
                    {
                    case "0":     //add
                    {
                        FormAddUnitType f = new FormAddUnitType();
                        f.FLXBM = selectModel.LXBM;
                        f.FL    = tag.Split('_')[0];
                        if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            LoadNav();
                        }
                        break;
                    }

                    case "1":     //edit
                    {
                        FormAddUnitType f = new FormAddUnitType(selectModel.LXBM);
                        if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            LoadNav();
                            foreach (Form f2 in this.MdiChildren)
                            {
                                if (f2.Tag.ToString() == selectModel.LXBM)
                                {
                                    f2.Text = f.LXMC;
                                }
                            }
                        }
                        break;
                    }

                    case "2":     //del
                    {
                        if (XtraMessageBox.Show("您确认要删除'" + selectModel.LXMC + "'?", "信息提示", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
                        {
                            if (Access.UnitType.UnitTypeDel(selectModel.LXBM))
                            {
                                LoadNav();
                                foreach (Form f2 in this.MdiChildren)
                                {
                                    if (f2.Tag.ToString() == selectModel.LXBM)
                                    {
                                        f2.Close();
                                    }
                                }
                            }
                        }
                        break;
                    }
                    }
                }
            }
        }