public override int GetHashCode() { int hashCode = -765894953; if (AccrualType != null) { hashCode += AccrualType.GetHashCode(); } if (Points != null) { hashCode += Points.GetHashCode(); } if (VisitMinimumAmountMoney != null) { hashCode += VisitMinimumAmountMoney.GetHashCode(); } if (SpendAmountMoney != null) { hashCode += SpendAmountMoney.GetHashCode(); } if (CatalogObjectId != null) { hashCode += CatalogObjectId.GetHashCode(); } return(hashCode); }
protected void ToString(List <string> toStringOutput) { toStringOutput.Add($"AccrualType = {(AccrualType == null ? "null" : AccrualType.ToString())}"); toStringOutput.Add($"Points = {(Points == null ? "null" : Points.ToString())}"); toStringOutput.Add($"VisitMinimumAmountMoney = {(VisitMinimumAmountMoney == null ? "null" : VisitMinimumAmountMoney.ToString())}"); toStringOutput.Add($"SpendAmountMoney = {(SpendAmountMoney == null ? "null" : SpendAmountMoney.ToString())}"); toStringOutput.Add($"CatalogObjectId = {(CatalogObjectId == null ? "null" : CatalogObjectId == string.Empty ? "" : CatalogObjectId)}"); }
public async Task <ActionResult> Edit(AccrualType accrualType) { if (!ModelState.IsValid) { return(View(accrualType)); } try { await _repository.UpdateAsync(accrualType); return(RedirectToAction(nameof(Index))); } catch { return(View(accrualType)); } }
public override bool Equals(object obj) { if (obj == null) { return(false); } if (obj == this) { return(true); } return(obj is LoyaltyProgramAccrualRule other && ((AccrualType == null && other.AccrualType == null) || (AccrualType?.Equals(other.AccrualType) == true)) && ((Points == null && other.Points == null) || (Points?.Equals(other.Points) == true)) && ((VisitMinimumAmountMoney == null && other.VisitMinimumAmountMoney == null) || (VisitMinimumAmountMoney?.Equals(other.VisitMinimumAmountMoney) == true)) && ((SpendAmountMoney == null && other.SpendAmountMoney == null) || (SpendAmountMoney?.Equals(other.SpendAmountMoney) == true)) && ((CatalogObjectId == null && other.CatalogObjectId == null) || (CatalogObjectId?.Equals(other.CatalogObjectId) == true))); }
public async Task <ActionResult> Create(AccrualType accrualType) { accrualType.Id = System.Guid.NewGuid().ToString(); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { await _repository.AddAsync(accrualType); return(RedirectToAction(nameof(Index))); } catch { return(View(accrualType)); } }
public static AccrualTypeViewModel FromAccrualType(AccrualType accrualType) => new AccrualTypeViewModel { Id = accrualType.Id, Name = accrualType.Name };