/// <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 { CheckInForm form = new CheckInForm(); form.DocFileEntity = docFileEntity; if (form.ShowDialog() == DialogResult.OK) { 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); } } }
/// <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 { CheckInForm form = new CheckInForm(); form.DocFileEntity = docFileEntity; if (form.ShowDialog() == DialogResult.OK) { 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); } } }