//Compara todas as propriedades da consulta private bool Equals(MedicalAppointment other) { return(Date == other.Date && MedicalAppointmentType == other.MedicalAppointmentType && CustomerCode.Equals(other.CustomerCode) && DoctorCode.Equals(other.DoctorCode) && Customer.Equals(other.Customer) && Doctor.Equals(other.Doctor)); }
public object C_Details(int page, int rows, string QueryString, string Value) { string CustomerCode = ""; string CustomerName = ""; if (QueryString == "CustomerCode") { CustomerCode = Value; } else { CustomerName = Value; } IQueryable <Customer> customerQuery = CustomerRepository.GetQueryable(); var customer = customerQuery.Where(c => c.CustomerCode.Contains(CustomerCode) && c.CustomerName.Contains(CustomerName)) .OrderBy(c => c.CompanyCode) .Select(c => c); if (!CustomerCode.Equals(string.Empty)) { customer = customer.Where(p => p.CustomerCode == CustomerCode); } int total = customer.Count(); customer = customer.Skip((page - 1) * rows).Take(rows); var temp = customer.ToArray().Select(c => new { CustomerCode = c.CustomerCode, CustomCode = c.CustomCode, CustomerName = c.CustomerName, CompanyCode = c.CompanyCode, IsActive = c.IsActive == "1" ? "可用" : "不可用" }); return(new { total, rows = temp.ToArray() }); }
/// <summary> /// Returns true if StructureProvision instances are equal /// </summary> /// <param name="other">Instance of StructureProvision to be compared</param> /// <returns>Boolean</returns> public bool Equals(StructureProvision other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( CustomerCode == other.CustomerCode || CustomerCode != null && CustomerCode.Equals(other.CustomerCode) ) && ( Units == other.Units || Units != null && other.Units != null && Units.SequenceEqual(other.Units) )); }
/// <summary> /// Returns true if Customer instances are equal /// </summary> /// <param name="other">Instance of Customer to be compared</param> /// <returns>Boolean</returns> public bool Equals(Customer other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( CustomerId == other.CustomerId || CustomerId != null && CustomerId.Equals(other.CustomerId) ) && ( CustomerCode == other.CustomerCode || CustomerCode != null && CustomerCode.Equals(other.CustomerCode) ) && ( CustomerName == other.CustomerName || CustomerName != null && CustomerName.Equals(other.CustomerName) ) && ( Email == other.Email || Email != null && Email.Equals(other.Email) ) && ( CompanyName == other.CompanyName || CompanyName != null && CompanyName.Equals(other.CompanyName) ) && ( CustomerGroupId == other.CustomerGroupId || CustomerGroupId != null && CustomerGroupId.Equals(other.CustomerGroupId) ) && ( DebitMoney == other.DebitMoney || DebitMoney.Equals(other.DebitMoney) ) && ( Address == other.Address || Address != null && Address.Equals(other.Address) ) && ( PhoneNumber == other.PhoneNumber || PhoneNumber != null && PhoneNumber.Equals(other.PhoneNumber) ) && ( DateOfBirth == other.DateOfBirth || DateOfBirth != null && DateOfBirth.Equals(other.DateOfBirth) )); }