public Receiver( string firstNameArg, string lastNameArg, DateTime dateOfBirthArg, BloodType bloodTypeArg ) : base(firstNameArg, lastNameArg, dateOfBirthArg) { _bloodType = bloodTypeArg; }
public Donor( string firstNameArg, string lastNameArg, DateTime dateOfBirthArg, BloodType bloodTypeArg ) : base(firstNameArg, lastNameArg, dateOfBirthArg) { _bloodType = bloodTypeArg; _numTimesDonated = 0; }
public bool CanDonateTo(BloodType receiverType) { // Console.WriteLine("Donating type:"); // PrintDetails(); //donor1 bloodType // Console.WriteLine("Receiving type:"); // receiverType.PrintDetails(); /*** O ***/ if (_abo == "O" && _sign == '-') { return(true); } if (_abo == "O" && _sign == '+') { if (receiverType._sign == '+') { return(true); } else { return(false); } } /*** B ***/ if (_abo == "B" && _sign == '-') { if (receiverType._abo == "B" || receiverType._abo == "AB") { return(true); } } if (_abo == "B" && _sign == '+') { if (receiverType._abo == "B" || receiverType._abo == "AB") { if (receiverType._sign == '+') { return(true); } else { return(false); } } } /*** A ***/ if (_abo == "A" && _sign == '-') { if (receiverType._abo == "A" || receiverType._abo == "AB") { return(true); } } if (_abo == "A" && _sign == '+') { if (receiverType._abo == "A" || receiverType._abo == "AB") { if (receiverType._sign == '+') { return(true); } else { return(false); } } } /*** AB ***/ if (_abo == "AB" && _sign == '-') { if (receiverType._abo == "AB") { return(true); } } if (_abo == "AB" && _sign == '+') { if (receiverType._abo == "AB" && receiverType._sign == '+') { return(true); } else { return(false); } } return(false); }