private bool method_8(IVersionEdit iversionEdit_0, string string_0, bool bool_2, bool bool_3) { bool flag = true; try { if (iversionEdit_0.Reconcile(string_0)) { this.method_10(iversionEdit_0 as IWorkspaceEdit, false); flag = false; } else if (iversionEdit_0.CanPost() && bool_2) { iversionEdit_0.Post(string_0); this.method_10(iversionEdit_0 as IWorkspaceEdit, true); if (!bool_3) { } } else { this.method_10(iversionEdit_0 as IWorkspaceEdit, true); } if (!flag) { } } catch { this.method_10(iversionEdit_0 as IWorkspaceEdit, false); flag = false; } return(flag); }
/// <summary> /// 提交当前版本 /// </summary> /// <param name="pWorkspace">工作区</param> /// <param name="VersionName">父版本名称</param> /// <returns>是否提交成功(经过仲裁)</returns> public static bool PostVersion(IWorkspace pWorkspace, string VersionName) { IVersionEdit pVersionEdit = (IVersionEdit)pWorkspace; pVersionEdit.Reconcile(VersionName); pVersionEdit.Post(VersionName); return(true); }
/// <summary> /// 提交当前版本(经过仲裁) /// </summary> /// <param name="pWorkspace">工作区</param> /// <param name="sVersion">父版本名称</param> public static void PostVerison(IWorkspace pWorkspace, string sVersion) { IVersion pVersion = (IVersion)pWorkspace; if (!IsLocked(pVersion)) { throw new Exception("不能提交数据到父版本,其它用户正在编辑"); } IWorkspaceEdit pWorkspaceEdit = (IWorkspaceEdit)pVersion; if (!pWorkspaceEdit.IsBeingEdited()) { throw new Exception("请开始编辑会话"); } IVersionEdit pVersionEdit = (IVersionEdit)pVersion; IVersionInfo pVersionInfo = pVersion.VersionInfo; try { string sParentName = pVersionInfo.VersionName; bool bConflicts = pVersionEdit.Reconcile(sParentName); if (bConflicts) { pWorkspaceEdit.StopEditing(true); } else { if (pVersionEdit.CanPost()) { pVersionEdit.Post(sParentName); pWorkspaceEdit.StopEditing(true); } else { pWorkspaceEdit.StopEditing(true); // false //MessageBox.Show("不能提交数据到父版本[" + sParentName + "]"); } } } catch (Exception ex) { throw ex; } finally { if (pWorkspaceEdit.IsBeingEdited()) { pWorkspaceEdit.StopEditing(true); // false } pWorkspaceEdit.StartEditing(true); } }
private bool method_4(IVersionEdit iversionEdit_0, string string_0, bool bool_0, bool bool_1) { bool flag = true; IVersion version = iversionEdit_0 as IVersion; this.method_10(version, 0); try { if (this.method_11(iversionEdit_0 as IVersion)) { flag = false; } else { this.method_5(iversionEdit_0 as IWorkspaceEdit); this.txtMessage.Text = "正在将版本 " + version.VersionName + " 合并到版本 " + string_0; if (iversionEdit_0.Reconcile(string_0)) { this.txtMessage.Text = "在合并版本 " + version.VersionName + " 到版本 " + string_0 + " 时发现冲突"; this.method_6(iversionEdit_0 as IWorkspaceEdit, false); flag = false; } else if (iversionEdit_0.CanPost() && bool_0) { this.txtMessage.Text = "合并 " + version.VersionName; iversionEdit_0.Post(string_0); this.method_6(iversionEdit_0 as IWorkspaceEdit, true); if (bool_1) { this.method_7(iversionEdit_0 as IVersion); } } else { this.method_6(iversionEdit_0 as IWorkspaceEdit, true); } } if (flag) { this.method_10(version, 2); return(flag); } this.method_10(version, 1); } catch { this.method_6(iversionEdit_0 as IWorkspaceEdit, false); flag = false; } return(flag); }