Supermarket Managemet System/main.cpp
bool CompareUsingExpirationDateAscending( Product FirstProduct, Product SecondProduct)
{
    if((FirstProduct.ExpireDate.Year < SecondProduct.ExpireDate.Year)||
            ((FirstProduct.ExpireDate.Year == SecondProduct.ExpireDate.Year)&&
             (FirstProduct.ExpireDate.Month < SecondProduct.ExpireDate.Month))||
            (((FirstProduct.ExpireDate.Year == SecondProduct.ExpireDate.Year)&&
              (FirstProduct.ExpireDate.Month == SecondProduct.ExpireDate.Month))&&
             (FirstProduct.ExpireDate.Day < SecondProduct.ExpireDate.Day)))
        return 1;
    else
        return 0;
}
//Used to Compare products using there expiration date in ascending order
Used to Compare products using there expiration date in ascending order
Used to Compare products using there expiration date in ascending order
bool CompareUsingExpirationDateAscending( Product FirstProduct, Product SecondProduct)
{
    if((FirstProduct.ExpireDate.Year < SecondProduct.ExpireDate.Year)||
            ((FirstProduct.ExpireDate.Year == SecondProduct.ExpireDate.Year)&&
             (FirstProduct.ExpireDate.Month < SecondProduct.ExpireDate.Month))||
            (((FirstProduct.ExpireDate.Year == SecondProduct.ExpireDate.Year)&&
              (FirstProduct.ExpireDate.Month == SecondProduct.ExpireDate.Month))&&
             (FirstProduct.ExpireDate.Day < SecondProduct.ExpireDate.Day)))
        return 1;
    else
        return 0;
}
bool CompareUsingExpirationDateAscending ( Product FirstProduct , Product SecondProduct ) { if ( ( FirstProduct . ExpireDate . Year < SecondProduct . ExpireDate . Year ) || ( ( FirstProduct . ExpireDate . Year == SecondProduct . ExpireDate . Year ) && ( FirstProduct . ExpireDate . Month < SecondProduct . ExpireDate . Month ) ) || ( ( ( FirstProduct . ExpireDate . Year == SecondProduct . ExpireDate . Year ) && ( FirstProduct . ExpireDate . Month == SecondProduct . ExpireDate . Month ) ) && ( FirstProduct . ExpireDate . Day < SecondProduct . ExpireDate . Day ) ) ) return 1 ; else return 0 ; }
Used to Compare products using there expiration date in ascending order
Used to Compare products using there expiration date in ascending order