예제 #1
0
        private void treeView1_MouseDown(object sender, MouseEventArgs e)
        {
            newSelectedNode = treeView1.GetNodeAt(e.X, e.Y);

            if (newSelectedNode != null)
            {
                string formName;
                DataRow[] foundRows;
                foundRows = MainForm.theUserpermission.Tables[0].Select("Permission_code = '" + newSelectedNode.Tag.ToString() + "'");
                if (foundRows.Length == 1)
                {
                    formName = foundRows[0]["Form_name"].ToString();
                    if (formName != "")
                    {
                        bool ifExist = false;	//窗口实例是否已经存在
                        switch (formName)
                        {
                            #region 系统维护

                            //系统维护///////////////////////////////////////////////////////////////////////////////////////////////////

                            //组织机构
                            case "FrameInfo.DeptManager":
                                ifExist = OnlyShow("CottonFac.FrameInfo.DeptManager");
                                if (!ifExist)
                                {
                                    FrameInfo.DeptManager deptManager = new CottonFac.FrameInfo.DeptManager();
                                    deptManager.MdiParent = this.ParentForm;
                                    deptManager.Show();
                                }
                                break;
                            //角色
                            case "FrameInfo.RoleManager":
                                ifExist = OnlyShow("CottonFac.FrameInfo.RoleManager");
                                if (!ifExist)
                                {
                                    FrameInfo.RoleManager roleManager = new CottonFac.FrameInfo.RoleManager();
                                    roleManager.MdiParent = this.ParentForm;
                                    roleManager.Show();
                                }
                                break;
                            //用户角色
                            case "FrameInfo.UserRoleManage":
                                ifExist = OnlyShow("CottonFac.FrameInfo.UserRoleManage");
                                if (!ifExist)
                                {
                                    FrameInfo.UserRoleManage userRoleManage = new CottonFac.FrameInfo.UserRoleManage();
                                    userRoleManage.MdiParent = this.ParentForm;
                                    userRoleManage.Show();
                                }
                                break;
                            //基本数据项维护

                            case "FrameInfo.DataDict":
                                ifExist = OnlyShow("CottonFac.FrameInfo.DataDict");
                                if (!ifExist)
                                {
                                    FrameInfo.DataDict dataDict = new CottonFac.FrameInfo.DataDict();
                                    dataDict.MdiParent = this.ParentForm;
                                    dataDict.Show();
                                }
                                break;
                            //系统帐套维护
                            case "AccountManage":
                                {
                                    //AccountManage();
                                }
                                break;

                            //通知公告
                            case "Callboard.Callboard":
                                ifExist = OnlyShow("CottonFac.Callboard.Callboard");
                                if (!ifExist)
                                {
                                    Callboard.Callboard Callboard = new CottonFac.Callboard.Callboard();
                                    //Callboard.MdiParent = this.ParentForm;
                                    Callboard.ShowDialog();
                                }
                                break;
                            ////数据备份/恢复
                            //case "DataBak.DataBak":
                            //    ifExist = OnlyShow("CottonFac.DataBak.DataBak");
                            //    if (!ifExist)
                            //    {
                            //        DataBak.DataBak DataBak = new CottonFac.DataBak.DataBak();
                            //        //Callboard.MdiParent = this.ParentForm;
                            //        DataBak.ShowDialog();
                            //    }
                            //    break;
                            //系统操作日志
                            case "FrameInfo.ShowLog":
                                ifExist = OnlyShow("CottonFac.FrameInfo.ShowLog");
                                if (!ifExist)
                                {
                                    //FrameInfo.ShowLog ShowLog = new CottonFac.FrameInfo.ShowLog();
                                    //Callboard.MdiParent = this.ParentForm;
                                    //ShowLog.ShowDialog();
                                }
                                break;
                            //系统初始化设置
                            case "BaseItem.dlgInitFac":
                                ifExist = OnlyShow("CottonFac.BaseItem.dlgInitFac");
                                if (!ifExist)
                                {
                                    //BaseItem.dlgInitFac dlgInitFac = new CottonFac.BaseItem.dlgInitFac(MainForm.theFactoryCode,MainForm.thePurchaseSiteCode);
                                    ////Callboard.MdiParent = this.ParentForm;
                                    //dlgInitFac.ShowDialog();
                                }
                                break;

                            #endregion
                            #region 粮食局
                            //行政区域维护zxp20130402
                            case "GrainDepot.RegionInfo":
                                ifExist = OnlyShow("GrainDepot.RegionInfo");
                                if (!ifExist)
                                {
                                    GrainDepot.RegionInfo regionInfo = new CottonFac.GrainDepot.RegionInfo();
                                    regionInfo.MdiParent = this.ParentForm;
                                    regionInfo.Show();

                                }
                                break;
                                //温度查看20130403
                            case "GrainDepot.GrainDeoptSynchronization":
                                ifExist = OnlyShow("GrainDepot.GrainDeoptSynchronization");
                                if (!ifExist)
                                {
                                    GrainDepot.GrainDeoptSynchronization grainDeoptSynchronizatio = new CottonFac.GrainDepot.GrainDeoptSynchronization();
                                    grainDeoptSynchronizatio.MdiParent = this.ParentForm;
                                    grainDeoptSynchronizatio.Show();

                                }
                                break;
                            case "GrainDepot.GrainDeoptHighBack":
                                if (!OnlyShow("GrainDepot.GrainDeoptHighBack"))
                                {
                                    GrainDepot.GrainDeoptSynchronization grainDeoptSynchronizatio = new CottonFac.GrainDepot.GrainDeoptSynchronization();
                                    grainDeoptSynchronizatio.MdiParent = this.ParentForm;
                                    grainDeoptSynchronizatio.Show();
                                }
                                break;
                            #endregion

                        }
                    }
                }
            }
        }
예제 #2
0
 private void Frame_1012_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     bool ifExist = false;
     ifExist = OnlyShow("CottonFac.FrameInfo.DataDict");
     if (!ifExist)
     {
         FrameInfo.DataDict dataDict = new CottonFac.FrameInfo.DataDict();
         dataDict.MdiParent = this.ParentForm;
         dataDict.Show();
     }
 }