コード例 #1
0
        public static bool SaveCodeReview(ref SqlSyncBuildData buildData, ref SqlSyncBuildData.ScriptRow scriptRow, string scriptText, string comment, string reviewBy, DateTime reviewDate, string reviewNumber, int reviewStatus)
        {
            try
            {
                SqlSyncBuildData.CodeReviewRow newRow = buildData.CodeReview.NewCodeReviewRow();
                newRow.CodeReviewId = Guid.NewGuid();
                newRow.Comment      = comment;
                newRow.ReviewBy     = reviewBy;
                newRow.ReviewDate   = reviewDate;
                newRow.ReviewNumber = reviewNumber;
                newRow.ReviewStatus = (short)reviewStatus;
                newRow.CheckSum     = CodeReviewManager.CalculateReviewCheckSum(newRow.CodeReviewId,
                                                                                newRow.ReviewBy,
                                                                                newRow.ReviewDate,
                                                                                newRow.Comment,
                                                                                newRow.ReviewNumber,
                                                                                newRow.ReviewStatus,
                                                                                scriptText);

                newRow.SetParentRow(scriptRow);
                CodeReviewManager.SetValidationKey(ref newRow);
                buildData.CodeReview.AddCodeReviewRow(newRow);
                buildData.CodeReview.AcceptChanges();

                CodeReviewManager.SaveCodeReviewToDatabase(newRow);

                return(true);
            }
            catch
            {
                return(false);
            }
        }
コード例 #2
0
 public static bool UpdateCodeReview(ref SqlSyncBuildData buildData, ref SqlSyncBuildData.CodeReviewRow reviewRow, string scriptText)
 {
     try
     {
         reviewRow.CheckSum = CodeReviewManager.CalculateReviewCheckSum(reviewRow, scriptText);
         CodeReviewManager.SetValidationKey(ref reviewRow);
         buildData.CodeReview.AcceptChanges();
         CodeReviewManager.UpdateCodeReviewToDatabase(reviewRow);
         return(true);
     }
     catch
     {
         return(false);
     }
 }