Exemplo n.º 1
0
        public void ShowMetainfoEditor()
        {
            try
            {
                OpenMetaInfoEditorCommand cmd = new OpenMetaInfoEditorCommand();
                cmd.Execute();

                ModelEdit frm = m_dbtoolsform;
                if (frm != null)
                {
                    frm.Visible = true;
                    frm.BringToFront();
                    return;
                }
                try
                {
                    frm = new ModelEdit();
                    frm.Show();
                    m_dbtoolsform = frm;
                }
                catch
                {
                    throw;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Exemplo n.º 2
0
        public AddVirtualField(string tablename, ModelEdit parent, paraMetaInfo param)
        {
            InitializeComponent();
            TableName_comboBox.Left = edit_TableName.Left;
            TableName_comboBox.Top  = edit_TableName.Top;
            FieldName_comboBox.Left = edit_FieldName.Left;
            FieldName_comboBox.Top  = edit_FieldName.Top;

            m_parent        = parent;
            m_paramMetaInfo = param;

            if (param.m_nFieldType != 1)
            {
                TableName_comboBox.Visible = false;
                TableName_comboBox.Enabled = false;
                edit_TableName.Visible     = true;
                edit_TableName.Enabled     = false;
                edit_TableName.Text        = tablename;
                FieldName_comboBox.Visible = true;
                FieldName_comboBox.Enabled = true;
                edit_FieldName.Visible     = false;
                edit_FieldName.Enabled     = false;
                FieldName_comboBox.Items.Clear();

                //DataTable table = m_parent.QueryData("SELECT * FROM " + tablename);
                DataTable table = Helper.GetDataTableProxy(tablename, m_parent.m_conn);

                FieldName_comboBox.Items.Clear();
                for (int i = 0; i < table.Columns.Count; i++)
                {
                    string strColumnName = table.Columns[i].ColumnName;
                    FieldName_comboBox.Items.AddRange(new object[] { strColumnName });
                }
                // 设置光标位置
                FieldName_comboBox.Select();
            }
            else
            {
                TableName_comboBox.Visible = true;
                TableName_comboBox.Enabled = true;
                edit_TableName.Visible     = false;
                edit_TableName.Enabled     = false;
                FieldName_comboBox.Visible = false;
                FieldName_comboBox.Enabled = false;
                edit_FieldName.Visible     = true;
                edit_FieldName.Enabled     = true;
                FieldName_comboBox.Items.Clear();

                //DataTable table = m_parent.QueryData("SELECT name FROM sysobjects WHERE xtype = 'u' order by name asc");
                DataTable table = Helper.GetDataTableProxy("sysobjects", "xtype = 'u'", "name asc", m_parent.m_conn);
                foreach (DataRow row in table.Rows)
                {
                    TableName_comboBox.Items.Add(row["name"].ToString().Trim());
                }
                // 设置光标位置
                TableName_comboBox.Select();
            }
        }
Exemplo n.º 3
0
        private string modelID;        // 模块的id

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="conn">sql连接</param>
        /// <param name="node">模块对应的树结点</param>
        /// <param name="modelEditor">模块编辑器对象</param>
        public ConfigModelForm(SqlConnection conn, TreeNode node, ModelEdit modelEditor)
        {
            this.conn        = conn;
            this.node        = node;
            this.modelEditor = modelEditor;
            this.imageList   = modelEditor.imglstIcons;
            this.modelID     = node.Tag.ToString();
            InitializeComponent();
            InitData();
        }
Exemplo n.º 4
0
        private string modelID; // 模块的id

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="conn">sql连接</param>
        /// <param name="node">模块对应的树结点</param>
        /// <param name="modelEditor">模块编辑器对象</param>
        public ConfigModelForm(SqlConnection conn, TreeNode node, ModelEdit modelEditor)
        {
            this.conn = conn;
            this.node = node;
            this.modelEditor = modelEditor;
            this.imageList = modelEditor.imglstIcons;
            this.modelID = node.Tag.ToString();
            InitializeComponent();
            InitData();
        }
Exemplo n.º 5
0
        private List<string> encodableTypeList = new List<string>(); // 可以进行编码设置的类型链表

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="image">要定义的图标</param>
        public AddImageForm(string fileName, TreeNode node, ModelEdit modelEditor)
        {
            this.fileName = fileName;
            this.node = node;
            this.modelEditor = modelEditor;
            InitializeComponent();
            comboBoxEx1.SelectedIndex = 2; // 默认为低图标质量
            comboBoxEx2.SelectedIndex = 1; // 默认为16位色深
            FillEncodableList();
            ShowImage();
        }
Exemplo n.º 6
0
        private List <string> encodableTypeList = new List <string>(); // 可以进行编码设置的类型链表

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="image">要定义的图标</param>
        public AddImageForm(string fileName, TreeNode node, ModelEdit modelEditor)
        {
            this.fileName    = fileName;
            this.node        = node;
            this.modelEditor = modelEditor;
            InitializeComponent();
            comboBoxEx1.SelectedIndex = 2; // 默认为低图标质量
            comboBoxEx2.SelectedIndex = 1; // 默认为16位色深
            FillEncodableList();
            ShowImage();
        }
Exemplo n.º 7
0
 public ActionResult Markdown()
 {
     if (Manager.EditMode && Module.IsAuthorized(ModuleDefinition.RoleDefinition.Edit))
     {
         ModelEdit model = new ModelEdit();
         ObjectSupport.CopyData(Module.Contents, model.Contents);
         return(View(model));
     }
     else
     {
         ModelDisplay model = new ModelDisplay();
         ObjectSupport.CopyData(Module.Contents, model.Contents);
         return(View("MarkdownDisplay", model));
     }
 }
Exemplo n.º 8
0
        public IconConfig(TreeNode node, ModelEdit parentForm)
        {
            InitializeComponent();
            IconListView.Items.Clear();

            this.IconListView.SmallImageList = ((MainForm)Program.MainForm).imageList2;

            // 前8个图标是模块下的节点图标,所以跳过
            for (int i = 8; i < ((MainForm)Program.MainForm).imageList2.Images.Count; ++i)
            {
                ListViewItem listViewItem = new ListViewItem("",  i);
                IconListView.Items.Add(listViewItem);
            }
            m_nModid     = (int)node.Tag;
            m_Node       = node;
            m_ParentForm = parentForm;
        }
Exemplo n.º 9
0
        public async Task <ActionResult> Markdown_Partial(ModelEdit model)
        {
            ObjectSupport.CopyData(model.Contents, Module.Contents);
            await Module.SaveAsync();

            if (IsApply)
            {
                return(FormProcessed(model, "Contents saved", OnClose: OnCloseEnum.Nothing, OnPopupClose: OnPopupCloseEnum.ReloadModule, OnApply: OnApplyEnum.ReloadModule));
            }
            else
            {
                if (Manager.IsInPopup)
                {
                    throw new InternalError("Save & Display not available in a popup window");
                }
                Manager.EditMode = false;
                return(Redirect(Manager.ReturnToUrl, SetCurrentEditMode: true));
            }
        }
Exemplo n.º 10
0
        //TabControl切换模块后
        private void tabMain_SelectedIndexChanged(object sender, EventArgs e)
        {
            int sel = tabMain.SelectedIndex;

            if (sel == 0)
            {
                //编辑工艺
            }
            else if (sel == 1)
            {
                //编辑模型
                ModelEdit.Init();
            }
            else if (sel == 2)
            {
                //编辑图纸
                SheetEdit.FreshSheetTree();
            }
        }
Exemplo n.º 11
0
        //打开或新建工艺时初始化
        private void OpenOrCreateProjectInit()
        {
            //变量值
            IsProjectOpen = true;

            //控件状态
            pnlWelcome.Hide();
            pnlMain.Show();

            this.Text = ProPath + "\\" + ProName + ".3dppm";
            //更新会签
            if (NXFun.isFileExist(ToFullPath(NXFun.SignOffXML)))
            {
                bool result = XML3DPPM.UpdateSignOff(XmlFile, ToFullPath(NXFun.SignOffXML));
                if (result)
                {
                    NXFun.MessageBox("更新会签信息成功,请在\"编辑图纸->二维图表\"模块点击\"更新表头\"来刷新会签信息。");
                }
                else
                {
                    NXFun.MessageBox("更新会签信息失败,请确认会签文件是否有效!");
                }
            }
            //操作
            ProcessEdit.ProPath = ProPath;
            ProcessEdit.ProName = ProName;
            ProcessEdit.Init();

            ModelEdit.ProPath = ProPath;
            ModelEdit.ProName = ProName;
            ModelEdit.Init();

            SheetEdit.ProPath = ProPath;
            SheetEdit.ProName = ProName;
            SheetEdit.Init();
        }
Exemplo n.º 12
0
        public static void SetMainControl(ERMTControl view)
        {
            ERMTUserControl currentUserControl = new ERMTUserControl {
                Name = "new"
            };

            switch (view)
            {
            case ERMTControl.About:
            {
                About about = new About();
                about.ShowDialog();
                break;
            }

            case ERMTControl.EditRegion:
            {
                EditRegion editRegion = new EditRegion();
                currentUserControl = editRegion;
                SetMainControl(editRegion);
                ApplicationPrincipalForm.LoadLeftButtons();
                break;
            }

            case ERMTControl.ElectoralCycle:
            {
                IndexUserControl indexUserControl = new IndexUserControl
                {
                    IndexContentType = IndexContentType.ElectoralCycle
                };
                currentUserControl = indexUserControl;
                SetMainControl(indexUserControl);
                ApplicationPrincipalForm.LoadLeftButtons("electoralcycle");
                indexUserControl.ShowHtml();
                break;
            }

            case ERMTControl.ElectoralCycleModifyPhase:
            {
                ElectoralCycleModifyPhase electoralCycleModifyPhase = new ElectoralCycleModifyPhase();
                currentUserControl = electoralCycleModifyPhase;
                SetMainControl(electoralCycleModifyPhase);
                ApplicationPrincipalForm.LoadLeftButtons();
                break;
            }

            case ERMTControl.FactorModify:
            {
                FactorModify modifyFactor = new FactorModify();
                currentUserControl = modifyFactor;
                SetMainControl(modifyFactor);
                ApplicationPrincipalForm.LoadLeftButtons();
                break;
            }

            case ERMTControl.FactorNew:
            {
                FactorNew newFactor = new FactorNew();
                currentUserControl = newFactor;
                SetMainControl(newFactor);
                ApplicationPrincipalForm.LoadLeftButtons();
                break;
            }

            case ERMTControl.FactorReorder:
            {
                FactorsReorder reorderFactors = new FactorsReorder();
                currentUserControl = reorderFactors;
                SetMainControl(reorderFactors);
                ApplicationPrincipalForm.LoadLeftButtons();
                break;
            }

            case ERMTControl.KnowledgeResources:
            {
                IndexUserControl indexUserControl = new IndexUserControl
                {
                    IndexContentType = IndexContentType.KnowledgeResources
                };
                currentUserControl = indexUserControl;
                SetMainControl(indexUserControl);
                ApplicationPrincipalForm.LoadLeftButtons("KnowledgeResources");
                indexUserControl.ShowHtml();
                break;
            }

            case ERMTControl.Login:
            {
                LoginUserControl loginUserControl = new LoginUserControl();
                currentUserControl = loginUserControl;
                SetMainControl(loginUserControl);
                break;
            }

            case ERMTControl.MarkerTypeCRUD:
            {
                MarkerTypeCRUD markerTypeControl = new MarkerTypeCRUD();
                currentUserControl = markerTypeControl;
                SetMainControl(markerTypeControl);
                ApplicationPrincipalForm.LoadLeftButtons();
                break;
            }

            case ERMTControl.ModelEdit:
            {
                ModelEdit modelEdit = new ModelEdit();
                currentUserControl = modelEdit;
                SetMainControl(modelEdit);
                ApplicationPrincipalForm.LoadLeftButtons();
                break;
            }

            case ERMTControl.ModelNew:
            {
                ModelNew modelNew = new ModelNew();
                currentUserControl = modelNew;
                SetMainControl(modelNew);
                ApplicationPrincipalForm.LoadLeftButtons();
                break;
            }

            case ERMTControl.ModelReorderFactors:
            {
                ModelReorderFactors modelReorderFactors = new ModelReorderFactors();
                currentUserControl = modelReorderFactors;
                SetMainControl(modelReorderFactors);
                ApplicationPrincipalForm.LoadLeftButtons();
                break;
            }

            case ERMTControl.RiskActionRegister:
            {
                RiskAndActionRegister riskActionRegister = new RiskAndActionRegister(true);
                currentUserControl = riskActionRegister;
                SetMainControl(riskActionRegister);
                ApplicationPrincipalForm.LoadLeftButtons("riskandaction");
                break;
            }

            case ERMTControl.RiskMapping:
            {
                //RiskMapping riskMapping = new RiskMapping();
                //currentUserControl = riskMapping;
                //SetMainControl(riskMapping);
                currentUserControl = ControlCache.RiskMappingInstance;
                SetMainControl(ControlCache.RiskMappingInstance);
                ApplicationPrincipalForm.LoadLeftButtons("map");
                break;
            }

            case ERMTControl.Start:
            {
                SetMainControl(ControlCache.StartInstance);
                currentUserControl = ControlCache.StartInstance;
                ApplicationPrincipalForm.LoadLeftButtons("Start");
                break;
            }

            case ERMTControl.TestUserControl:
            {
                TestUserControl testUserControl = new TestUserControl();
                SetMainControl(testUserControl);
                break;
            }

            case ERMTControl.UserModify:
            {
                UserModify userModify = new UserModify();
                currentUserControl = userModify;
                SetMainControl(userModify);
                ApplicationPrincipalForm.LoadLeftButtons();
                break;
            }

            case ERMTControl.UserNew:
            {
                UserNew userNew = new UserNew();
                currentUserControl = userNew;
                SetMainControl(userNew);
                ApplicationPrincipalForm.LoadLeftButtons();
                break;
            }

            case ERMTControl.UserResetPassword:
            {
                UserChangePassword ucp = new UserChangePassword();
                ucp.ShowDialog();

                break;
            }
            }
            if (currentUserControl.Name != "new")
            {
                currentUserControl.ShowTitle();
            }
        }