Esempio n. 1
0
        double Max(double max, Classification classification)
        {
            var temp = 0D;

            foreach (var kv in API.Judge)
            {
                temp += kv.Value < 0 ? 0.085 : -0.085;
            }

            return(max * ((classification.Equals(Classification.Buy) ? 0.9 : 0.85) - Math.Abs(temp)));
        }
Esempio n. 2
0
 public override bool Equals(object obj)
 {
     try
     {
         Film filmToCompareTo = (Film)obj;
         return(IsReleased == filmToCompareTo.IsReleased &&
                Title.Equals(filmToCompareTo.Title) &&
                Id.Equals(filmToCompareTo.Id) &&
                Length.Equals(filmToCompareTo.Length) &&
                BriefDescription.Equals(filmToCompareTo.BriefDescription) &&
                DetailedDescription.Equals(filmToCompareTo.DetailedDescription) &&
                ImagePath.Equals(filmToCompareTo.ImagePath) &&
                Year.Equals(filmToCompareTo.Year) &&
                Classification.Equals(filmToCompareTo.Classification) &&
                compareStringArr(Directors, filmToCompareTo.Directors) &&
                compareStringArr(Actors, filmToCompareTo.Actors) &&
                compareStringArr(Genres, filmToCompareTo.Genres));
     }
     catch (Exception)
     {
         return(false);
     }
 }
Esempio n. 3
0
        /// <summary>
        ///     Returns true if StockInfo instances are equal
        /// </summary>
        /// <param name="other">Instance of StockInfo to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(StockInfo other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                     ) &&
                 (
                     Industry == other.Industry ||
                     Industry != null &&
                     Industry.Equals(other.Industry)
                 ) &&
                 (
                     Classification == other.Classification ||
                     Classification != null &&
                     Classification.Equals(other.Classification)
                 ) &&
                 (
                     ListedDate == other.ListedDate ||
                     ListedDate != null &&
                     ListedDate.Equals(other.ListedDate)
                 ) &&
                 (
                     DelistedDate == other.DelistedDate ||
                     DelistedDate != null &&
                     DelistedDate.Equals(other.DelistedDate)
                 ) &&
                 (
                     RegisteredCapital == other.RegisteredCapital ||
                     RegisteredCapital != null &&
                     RegisteredCapital.Equals(other.RegisteredCapital)
                 ) &&
                 (
                     LegalRepresentative == other.LegalRepresentative ||
                     LegalRepresentative != null &&
                     LegalRepresentative.Equals(other.LegalRepresentative)
                 ) &&
                 (
                     GeneralManager == other.GeneralManager ||
                     GeneralManager != null &&
                     GeneralManager.Equals(other.GeneralManager)
                 ) &&
                 (
                     Secretary == other.Secretary ||
                     Secretary != null &&
                     Secretary.Equals(other.Secretary)
                 ) &&
                 (
                     EmployeeCount == other.EmployeeCount ||
                     EmployeeCount != null &&
                     EmployeeCount.Equals(other.EmployeeCount)
                 ) &&
                 (
                     Province == other.Province ||
                     Province != null &&
                     Province.Equals(other.Province)
                 ) &&
                 (
                     City == other.City ||
                     City != null &&
                     City.Equals(other.City)
                 ) &&
                 (
                     Office == other.Office ||
                     Office != null &&
                     Office.Equals(other.Office)
                 ) &&
                 (
                     Email == other.Email ||
                     Email != null &&
                     Email.Equals(other.Email)
                 ) &&
                 (
                     Website == other.Website ||
                     Website != null &&
                     Website.Equals(other.Website)
                 ) &&
                 (
                     BusinessScope == other.BusinessScope ||
                     BusinessScope != null &&
                     BusinessScope.Equals(other.BusinessScope)
                 ) &&
                 (
                     MainBusiness == other.MainBusiness ||
                     MainBusiness != null &&
                     MainBusiness.Equals(other.MainBusiness)
                 ) &&
                 (
                     Introduction == other.Introduction ||
                     Introduction != null &&
                     Introduction.Equals(other.Introduction)
                 ));
        }