示例#1
0
        private void EditFiles()
        {
            if (this.grdFiles.CurrentRow == null ||
                this.grdFiles.CurrentRow.RowType != Janus.Windows.GridEX.RowType.Record)
            {
                XMessageBox.ShowError("请选择要编辑的记录!");
                return;
            }

            XModelBase currentModel = this.grdFiles.CurrentRow.DataRow as XModelBase;

            XTaskFilesInfo taskFileInfo = currentModel as XTaskFilesInfo;

            if (taskFileInfo.InputUserId != XCommon.LoginUsersInfo.RID)
            {
                XMessageBox.ShowError("不能修改非本人提交的任务文档!");
                return;
            }

            frmTaskFilesEdit frm = new frmTaskFilesEdit(currentModel);

            if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                this.grdFiles.Refresh();
            }
        }
示例#2
0
        private void AddFiles()
        {
            TreeNode selectedNode = this.tvTask.SelectedNode;

            if (!this.IsChildTaskNode(selectedNode))
            {
                XMessageBox.ShowError("请选择要提交文档的子任务!");
                return;
            }

            IList <XModelBase> gridList = this.grdFiles.DataSource as IList <XModelBase>;

            XTaskInfo taskInfo = selectedNode.Tag as XTaskInfo;

            if (taskInfo.AssignPeople != XCommon.LoginUsersInfo.RID)
            {
                XMessageBox.ShowError("当前登录人不是任务负责人,不能提交文档!");
                return;
            }

            frmTaskFilesEdit frm = new frmTaskFilesEdit(gridList, selectedNode);

            if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                this.grdFiles.DataSource = null;
                this.grdFiles.DataSource = frm.ModelList;
                this.grdFiles.Refresh();
            }
        }