public void SetMinYearValues(IEnumerable <LookupValue> yearMin) { foreach (var ym in yearMin) { YearMin.Add(new SelectListItem() { Value = ym.Description.ToString(), Text = ym.Description.ToString() }); } }
//public override bool Equals(object obj) //{ // CellQuery snd = obj as CellQuery; // return Equals2(snd); //} //public bool Equals2(CellQuery other) //{ // if (other == null) // return false; // if (hash != other.hash) // return false; // bool b = (other.latmax != latmax) || // (other.latmin != latmin) || // (other.lonmax != lonmax) || // (other.lonmin != lonmin) || // (other.DayMax != DayMax) || // (other.DayMin != DayMin) || // (other.HourMax != HourMax) || // (other.HourMin != HourMin) || // (other.YearMax != YearMax) || // (other.YearMin != YearMin) || // (other.parameter != parameter); // return !b; //} public override int GetHashCode() { //TODO save hashing results int r = (int)parameter << 2 ^ base.GetHashCode() ^ YearMin.GetHashCode() ^ YearMax.GetHashCode() << 1 ^ DayMin.GetHashCode() ^ DayMax.GetHashCode() << 2 ^ HourMin.GetHashCode() ^ HourMax.GetHashCode() >> 2 ^ (int)landOceanCoverage << 3; return(r); }
public bool IsYearIsInThisWeight(double year) { bool isYearIsInThisWeight = false; DateTime minimumYear = DateTime.Now.AddYears(-YearMin); DateTime maximumYear = DateTime.Now.AddYears(-YearMax); if (YearMin.Equals(YearMax)) { isYearIsInThisWeight = year > YearMax; } else if (year >= maximumYear.Year && year <= minimumYear.Year) { isYearIsInThisWeight = true; } return(isYearIsInThisWeight); }