public static bool VerifyChangeHistory(List <Mrr_ChangeHistoryData> dataList) { Utilities.BrowserUtilities.SwitchToFrame(); try { for (int i = 0; i < dataList.Count; ++i) { Mrr_ChangeHistoryData data = dataList[i]; IControl historyRow = DL_Lab_Mrr_AuditHistory.GetHistoryRow(i); if (!IsDataMatched(data, historyRow)) { Utilities.BrowserUtilities.SwitchToWindow(); return(false); } } Utilities.BrowserUtilities.SwitchToWindow(); return(true); } catch (Exception e) { new Reports.DebugLog.DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e); } Utilities.BrowserUtilities.SwitchToWindow(); return(false); }
static bool IsDataMatched(Mrr_ChangeHistoryData data, IControl historyRow) { try { IControl dateTimeCell = DL_Lab_Mrr_AuditHistory.GetDateTimeCell_Row(historyRow); IControl referenceRangeCell = DL_Lab_Mrr_AuditHistory.GetReferenceRangeCell_Row(historyRow); IControl actionCell = DL_Lab_Mrr_AuditHistory.GetActionCell_Row(historyRow); String dateTimeText = Control_PropertyUtilities.GetText(dateTimeCell); dateTimeText.Trim(); String referenceRangeText = Control_PropertyUtilities.GetText(referenceRangeCell); referenceRangeText.Trim(); String actionText = Control_PropertyUtilities.GetText(actionCell); if (!dateTimeText.Contains(data.DateTime.Replace("\\r", "\r"))) { return(false); } if (!referenceRangeText.Equals(data.ReferenceRange.Replace("\\r", "\r"), StringComparison.InvariantCultureIgnoreCase)) { return(false); } if (!actionText.Equals(data.Action, StringComparison.InvariantCultureIgnoreCase)) { return(false); } return(true); } catch (Exception e) { } return(false); }