Warehouse.Depot.CanAddSoftware C# (CSharp) Method

CanAddSoftware() public method

public CanAddSoftware ( Software software ) : bool
software Software
return bool
        public bool CanAddSoftware(Software software) {

            if (software == null) {
                return false;
            }

            DepotSoftware existing = Db.SQL<DepotSoftware>("SELECT o FROM Warehouse.DepotSoftware o WHERE o.Depot=? AND o.Software=?", this, software).First;
            if (existing != null) {
                return false;
            }

            // If the software is from another organization it has to be "Public"
            if( !this.Organization.Equals(software.Organization)) {
                // Software from other organization
                if (software.Private) {
                    return false;
                }
            }

            return true;
        }