public override string ToString() { string fullData = string.Format( @"Owner name: {0} Owner Cellphone number: {1} Vehicle state: {2} {3}", m_OwnerName, m_OwnerCellphone, m_VehicleState.ToString(), m_Vehicle.ToString()); return(fullData); }
private List <CustomerCard> getVehiclesByStateFromDB(eVehicleState i_State) { FilterDefinition <BsonDocument> DBFilter; List <CustomerCard> vehiclesByState = new List <CustomerCard>(); if (i_State == eVehicleState.All) { DBFilter = Builders <BsonDocument> .Filter.Empty; } else { DBFilter = Builders <BsonDocument> .Filter.Eq("VehicleState", i_State.ToString()); } List <BsonDocument> vehiclesByStateDocument = r_DBCollection.Find <BsonDocument>(DBFilter).ToList(); foreach (BsonDocument currVehicle in vehiclesByStateDocument) { vehiclesByState.Add(BsonSerializer.Deserialize <CustomerCard>(currVehicle)); } return(vehiclesByState); }
public override string ToString() { string vehicleState = (m_VehicleState == eVehicleState.InRepair) ? "In Repair" : m_VehicleState.ToString(); string retVal = string.Format(@"Customer Name: {0} Customer Phone Number: {1} Vehicle state: {2}", m_CustomerName, m_CustomerPhoneNum, vehicleState); return(retVal); }
public void ChangeCustomerVehicleState(CustomerCard i_Customer, eVehicleState i_VehicleState) { i_Customer.VehicleState = i_VehicleState; if (r_ConnectedToDB == true) { UpdateDefinition <BsonDocument> updateToDo = Builders <BsonDocument> .Update.Set("VehicleState", i_VehicleState.ToString()); UpdateCustomerInDB(i_Customer.Vehicle.LicesncePlate, updateToDo); } }