Ejemplo n.º 1
0
        /// <summary>
        /// checkin文件
        /// </summary>
        /// <param name="tgv"></param>
        /// <param name="fileType"></param>
        private void CheckInFile(TreeGridView tgv, DataType.FileType fileType)
        {
            int rowIndex = tgv.CurrentCell.RowIndex;

            if (rowIndex <= 0)
            {
                MessageBox.Show("请选择文件", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            DataGridViewRow row           = tgv.Rows[rowIndex];
            String          Id            = row.Cells["DFL_ID"].Value.ToString();
            DOC_FILE_LIST   docFileEntity = _docFileListService.GetDocFileEntityByDCID(Id);

            // HYPDM.Entities.PDM_PHYSICAL_FILE physicalfile = _physicalService.GetPhysicalFile(Id, "");
            HYDocumentMS.IFileHelper file = new FileHelper();
            Boolean bl = file.isHasAuth(DataType.AuthParmsType.CheckIn, LoginInfo.LoginID, row.Cells["DFL_ID"].Value.ToString());

            if (bl == false)
            {
                MessageBox.Show("你没有权限检入此文件!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (docFileEntity == null)
            {
                return;
            }
            if (docFileEntity.CHECKOUTFLG == "N")
            {
                MessageBox.Show("文件名【" + docFileEntity.DFL_FILE_NAME + "】" + "\n" + "不为检出状态,不能进行检入操作!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            else
            {
                HYPDM.WinUI.Document.CheckInForm form = new HYPDM.WinUI.Document.CheckInForm();
                form.DocFileEntity = docFileEntity;

                if (form.ShowDialog() == DialogResult.OK)
                {
                    if (form.FileServerAckReult1)
                    {
                        docFileEntity.CHECKINFLG     = "Y";
                        docFileEntity.CHECKINDATE    = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                        docFileEntity.CHECKOUTFLG    = "N";
                        docFileEntity.DFL_VER_LATEST = "V" + DateTime.Now.ToString("yyyyMMddHHmmss");
                        docFileEntity.LASTUPDATEDATE = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                        docFileEntity.LASTUPDATEUSER = LoginInfo.LoginID;
                        docFileEntity.Save();

                        VersionSave("1", docFileEntity);
                        MessageBox.Show("文件检入成功!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        this.DialogResult = DialogResult.No;
                        MessageBox.Show("文件检入失败", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// checkin文件
        /// </summary>
        /// <param name="tgv"></param>
        /// <param name="fileType"></param>
        private void CheckInFile(TreeGridView tgv, DataType.FileType fileType)
        {
            int rowIndex = tgv.CurrentCell.RowIndex;

            if (rowIndex <= 0)
            {
                MessageBox.Show("请选择文件", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            DataGridViewRow row = tgv.Rows[rowIndex];
            String Id = row.Cells["DFL_ID"].Value.ToString();
            DOC_FILE_LIST docFileEntity = _docFileListService.GetDocFileEntityByDCID(Id);
            // HYPDM.Entities.PDM_PHYSICAL_FILE physicalfile = _physicalService.GetPhysicalFile(Id, "");
            HYDocumentMS.IFileHelper file = new FileHelper();
            Boolean bl = file.isHasAuth(DataType.AuthParmsType.CheckIn, LoginInfo.LoginID, row.Cells["DFL_ID"].Value.ToString());
            if (bl == false)
            {
                MessageBox.Show("你没有权限检入此文件!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (docFileEntity == null) return;
            if (docFileEntity.CHECKOUTFLG == "N")
            {
                MessageBox.Show("文件名【" + docFileEntity.DFL_FILE_NAME + "】" + "\n" + "不为检出状态,不能进行检入操作!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            else
            {
                HYPDM.WinUI.Document.CheckInForm form = new HYPDM.WinUI.Document.CheckInForm();
                form.DocFileEntity = docFileEntity;

                if (form.ShowDialog() == DialogResult.OK)
                {
                    if (form.FileServerAckReult1)
                    {
                        docFileEntity.CHECKINFLG = "Y";
                        docFileEntity.CHECKINDATE = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                        docFileEntity.CHECKOUTFLG = "N";
                        docFileEntity.DFL_VER_LATEST = "V" + DateTime.Now.ToString("yyyyMMddHHmmss");
                        docFileEntity.LASTUPDATEDATE = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                        docFileEntity.LASTUPDATEUSER = LoginInfo.LoginID;
                        docFileEntity.Save();

                        VersionSave("1", docFileEntity);
                        MessageBox.Show("文件检入成功!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        this.DialogResult = DialogResult.No;
                        MessageBox.Show("文件检入失败", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Error);

                    }

                }
            }
        }