Exemple #1
0
        /// <summary>
        /// 添加文件夹
        /// </summary>
        public string Add()
        {
            string       returnValue = string.Empty;
            FrmFolderAdd frmFolderAdd;

            if (this.LastControl == this.tvFolder)
            {
                if ((this.ParentEntityId.Length == 0) || (this.tvFolder.SelectedNode == null))
                {
                    frmFolderAdd = new FrmFolderAdd();
                }
                else
                {
                    frmFolderAdd = new FrmFolderAdd(this.ParentEntityId, this.tvFolder.SelectedNode.Text);
                }
            }
            else
            {
                DataRow dataRow = BaseInterfaceLogic.GetDataGridViewEntity(this.grdFolder);
                if (dataRow == null)
                {
                    frmFolderAdd = new FrmFolderAdd();
                }
                else
                {
                    frmFolderAdd = new FrmFolderAdd(dataRow[BaseFolderEntity.FieldId].ToString(), dataRow[BaseFolderEntity.FieldFolderName].ToString());
                }
            }
            if (frmFolderAdd.ShowDialog(this) == DialogResult.OK)
            {
                returnValue     = frmFolderAdd.EntityId;
                this.Changed    = true;
                this.FormLoaded = false;
                // 绑定屏幕数据
                this.FormOnLoad();
                this.FormLoaded = true;
            }
            return(returnValue);
        }
Exemple #2
0
        /// <summary>
        /// 添加文件夹
        /// </summary>
        /// <param name="root">根目录</param>
        /// <returns>主键</returns>
        public string AddFolder(bool root)
        {
            string       returnValue = string.Empty;
            FrmFolderAdd frmFolderAdd;

            if ((root) || (this.tvFolder.SelectedNode == null))
            {
                frmFolderAdd = new FrmFolderAdd();
            }
            else
            {
                frmFolderAdd = new FrmFolderAdd((this.tvFolder.SelectedNode.Tag as DataRow)[BaseModuleEntity.FieldId].ToString(), this.tvFolder.SelectedNode.Text);
            }
            if (frmFolderAdd.ShowDialog(this) == DialogResult.OK)
            {
                returnValue     = frmFolderAdd.EntityId;
                this.Changed    = true;
                this.FormLoaded = false;
                // 绑定屏幕数据
                this.FormOnLoad();
                this.FormLoaded = true;
            }
            return(returnValue);
        }