public static bool Compare <T>(this ComparisionOperator oper, T leftSide, T rightSide) where T : IComparable <T> { switch (oper) { case ComparisionOperator.LessThan: return(leftSide.CompareTo(rightSide) < 0); case ComparisionOperator.GreaterThan: return(leftSide.CompareTo(rightSide) > 0); case ComparisionOperator.LessThanOrEqualTo: return(leftSide.CompareTo(rightSide) <= 0); case ComparisionOperator.GreaterThanOrEqualTo: return(leftSide.CompareTo(rightSide) >= 0); case ComparisionOperator.EqualTo: return(leftSide.CompareTo(rightSide) == 0); case ComparisionOperator.NotEqualTo: return(leftSide.CompareTo(rightSide) != 0); default: throw new ArgumentOutOfRangeException("oper"); } }
public static bool Compare(this ComparisionOperator oper, double leftSide, double rightSide) { switch (oper) { case ComparisionOperator.LessThan: return(leftSide.SafeCompareTo(rightSide) < 0); case ComparisionOperator.GreaterThan: return(leftSide.SafeCompareTo(rightSide) > 0); case ComparisionOperator.LessThanOrEqualTo: return(leftSide.SafeCompareTo(rightSide) <= 0); case ComparisionOperator.GreaterThanOrEqualTo: return(leftSide.SafeCompareTo(rightSide) >= 0); case ComparisionOperator.EqualTo: return(leftSide.SafeEquals(rightSide)); case ComparisionOperator.NotEqualTo: return(!leftSide.SafeEquals(rightSide)); default: throw new ArgumentOutOfRangeException("oper"); } }
public SqlCondition(string propertyName, ComparisionOperator comparisionOperator, object value, LogicalOperator logicalOperator) { this.AppendWithOperator = logicalOperator; this.PropertyName = propertyName; this.ComparisionOperator = comparisionOperator; this.Value = value; this.initiallyfixLikeValue(); }
public SqlSelect <T> AddCondition(string propertyName, ComparisionOperator comparisionOperator, object value, LogicalOperator logicalOperator = LogicalOperator.And) { if (comparisionOperator != ComparisionOperator.IsNull && comparisionOperator != ComparisionOperator.IsNotNull && value == null) { // if there is no meaningful value given, just skip adding this condition return(this); } this.AddCondition(new SqlCondition(propertyName, comparisionOperator, value, logicalOperator)); return(this); }
// Only equal is supported for strings. public static bool Compare(this ComparisionOperator oper, string leftSide, string rightSide) { switch (oper) { case ComparisionOperator.EqualTo: return(leftSide == rightSide); case ComparisionOperator.NotEqualTo: return(leftSide != rightSide); default: return(leftSide == rightSide); } }
/// <summary> /// Check for if defect is already exist with given summury value /// if exist return id of the first defect /// </summary> /// <param name="summary">string summary value</param> /// <returns></returns> string CheckIfDefectExist(string summary) { //Search for exist based on summary WhereDataList filterData = new WhereDataList(); filterData.Add(new WhereData() { Name = "summary", Values = new List <string>() { summary }, Operator = WhereOperator.And }); //and based on status, fetch statuses from JiraSettings.json DefectStatusColl jiraDefectStatuses = null; JiraRepository.Helpers.JiraHelper jiraHelper = new JiraRepository.Helpers.JiraHelper(); if (jiraHelper.TryGetJiraDefectStatuses(out jiraDefectStatuses)) { foreach (DefectStatus defectStatus in jiraDefectStatuses) { ComparisionOperator comparisionOperator = GetComparisionOperator(defectStatus.Operator.ToLower()); filterData.Add(new WhereData() { Name = "Status", Values = defectStatus.Status.ToList(), Operator = WhereOperator.And, ComparisionOperator = comparisionOperator }); } } var issues = jiraRepObj.GetJiraIssues(ALMCore.DefaultAlmConfig.ALMUserName, ALMCore.DefaultAlmConfig.ALMPassword, ALMCore.DefaultAlmConfig.ALMServerURL, ALMCore.DefaultAlmConfig.ALMProjectKey, ResourceType.DEFECT, filterData); if (issues.DataResult.Count > 0) { return(issues.DataResult.FirstOrDefault().key.ToString()); } else { return(""); } }
internal static extern void OnVelocityObserver_SetCompare(IntPtr ptr, ComparisionOperator op);
internal static extern void OnPositionObserver_SetComparePositionZ(IntPtr ptr, ComparisionOperator op);