/// <summary> /// Gets SupplierAddress based on SupplierAddressID. /// </summary> /// <param name="searchSupplierAddressID">Represents SupplierAddressID to search.</param> /// <returns>Returns SupplierAddress object.</returns> public override SupplierAddress GetSupplierAddressBySupplierAddressIDDAL(Guid searchSupplierAddressID) { SupplierAddress matchingSupplierAddress = null; try { //Find SupplierAddress based on searchSupplierAddressID matchingSupplierAddress = SupplierAddressList.Find( (item) => { return(item.SupplierAddressID == searchSupplierAddressID); } ); } catch (Exception) { throw; } return(matchingSupplierAddress); }
/// <summary> /// Gets SupplierAddress based on Email and Password. /// </summary> /// <param name="email">Represents SupplierAddress's Email Address.</param> /// <param name="password">Represents SupplierAddress's Password.</param> /// <returns>Returns SupplierAddress object.</returns> public override SupplierAddress GetSupplierAddressByEmailAndPasswordDAL(string email, string password) { SupplierAddress matchingSupplierAddress = null; try { //Find SupplierAddress based on Email and Password matchingSupplierAddress = SupplierAddressList.Find( (item) => { return(item.Email.Equals(email) && item.Password.Equals(password)); } ); } catch (Exception) { throw; } return(matchingSupplierAddress); }
/// <summary> /// Deletes SupplierAddress based on SupplierAddressID. /// </summary> /// <param name="deleteSupplierAddressID">Represents SupplierAddressID to delete.</param> /// <returns>Determinates whether the existing SupplierAddress is updated.</returns> public override bool DeleteSupplierAddressDAL(Guid deleteSupplierAddressID) { bool SupplierAddressDeleted = false; try { //Find SupplierAddress based on searchSupplierAddressID SupplierAddress matchingSupplierAddress = SupplierAddressList.Find( (item) => { return(item.SupplierAddressID == deleteSupplierAddressID); } ); if (matchingSupplierAddress != null) { //Delete SupplierAddress from the collection SupplierAddressList.Remove(matchingSupplierAddress); SupplierAddressDeleted = true; } } catch (Exception) { throw; } return(SupplierAddressDeleted); }