Beispiel #1
0
        public Boolean IsValidAddress(DeliveryAddress objDeliveryAddress)
        {
            if ((string.IsNullOrEmpty(objDeliveryAddress.name)) || (string.IsNullOrEmpty(objDeliveryAddress.city)) || (string.IsNullOrEmpty(objDeliveryAddress.street)) || (string.IsNullOrEmpty(objDeliveryAddress.province)) || (string.IsNullOrEmpty(objDeliveryAddress.postalcode)))
            {
                return(false);
            }

            return(true);
        }
Beispiel #2
0
 //Validates the input part details and send the reponse after performing checks
 public PartResponse SubmitPartForManufactureAndDelivery(string partnumber, string quantity, DeliveryAddress deliveryaddress)
 {
     foreach (PartManager part in lstPartManager)
     {
         if (Convert.ToInt32(partnumber) != Convert.ToInt32(part.partnumber))
         {
             return(PartResponse.NO_LONGER_MANUFACTURED);
         }
         else if ((Convert.ToInt32(partnumber) == Convert.ToInt32(part.partnumber)) && (Convert.ToInt32(quantity) <= Convert.ToInt32(part.quantity)))
         {
             return(PartResponse.SUCCESS);
         }
         else if (Convert.ToInt32(quantity) >= Convert.ToInt32(part.quantity))
         {
             return(PartResponse.OUT_OF_STOCK);
         }
     }
     return(PartResponse.OUT_OF_STOCK);
 }