Supermarket Managemet System/main.cpp
bool CompareUsingProductionDateDescending( Product FirstProduct, Product SecondProduct)
{
    if((FirstProduct.ProductionDate.Year > SecondProduct.ProductionDate.Year)||((FirstProduct.ProductionDate.Year == SecondProduct.ProductionDate.Year)&&(FirstProduct.ProductionDate.Month > SecondProduct.ProductionDate.Month))||(((FirstProduct.ProductionDate.Year == SecondProduct.ProductionDate.Year)&&(FirstProduct.ProductionDate.Month == SecondProduct.ProductionDate.Month))&&(FirstProduct.ProductionDate.Day > SecondProduct.ProductionDate.Day)))
        return 1;
    else
        return 0;
}
//Used to Compare products using there production date in descending order
Used to Compare products using there production date in descending order
Used to Compare products using there production date in descending order
bool CompareUsingProductionDateDescending( Product FirstProduct, Product SecondProduct)
{
    if((FirstProduct.ProductionDate.Year > SecondProduct.ProductionDate.Year)||((FirstProduct.ProductionDate.Year == SecondProduct.ProductionDate.Year)&&(FirstProduct.ProductionDate.Month > SecondProduct.ProductionDate.Month))||(((FirstProduct.ProductionDate.Year == SecondProduct.ProductionDate.Year)&&(FirstProduct.ProductionDate.Month == SecondProduct.ProductionDate.Month))&&(FirstProduct.ProductionDate.Day > SecondProduct.ProductionDate.Day)))
        return 1;
    else
        return 0;
}
bool CompareUsingProductionDateDescending ( Product FirstProduct , Product SecondProduct ) { if ( ( FirstProduct . ProductionDate . Year > SecondProduct . ProductionDate . Year ) || ( ( FirstProduct . ProductionDate . Year == SecondProduct . ProductionDate . Year ) && ( FirstProduct . ProductionDate . Month > SecondProduct . ProductionDate . Month ) ) || ( ( ( FirstProduct . ProductionDate . Year == SecondProduct . ProductionDate . Year ) && ( FirstProduct . ProductionDate . Month == SecondProduct . ProductionDate . Month ) ) && ( FirstProduct . ProductionDate . Day > SecondProduct . ProductionDate . Day ) ) ) return 1 ; else return 0 ; }
Used to Compare products using there production date in descending order
Used to Compare products using there production date in descending order