Esempio n. 1
0
        //public Build(Controllers.BuildDetails bass)
        //{

        //    BuildName = bass.Name;
        //    BuildID = bass.BuildID;
        //    OwnerID = bass.OwnerID;
        //    CaseID = bass.Case.CaseID;
        //    MBID = bass.MB.MBID;
        //    CPUID = bass.CPU.CPUID;
        //    PSUID = bass.PSU.PSUID;
        //    GPUID = bass.GPU.GPUID;
        //    PSUID = bass.PSU.PSUID;
        //    GPUCount = bass.GPUCount;

        //}

        public Build(string name)
        {
            BuildName   = name;
            PCCase      = new PCCase();
            Motherboard = new Motherboard();
            CPU         = new CPU();
            PSU         = new PSU();
            GPU         = new GPU();
            GPUCount    = 0;
        }
Esempio n. 2
0
        public double GetPrice()
        {
            double _total = 0.0;

            _total += PCCase.GetPrice();
            _total += Motherboard.GetPrice();
            _total += CPU.GetPrice();
            _total += GPU.GetPrice() * (double)GPUCount;
            _total += PSU.GetPrice();
            foreach (RAM r in BuildsRAMs.Select(x => x.RAM).ToArray())
            {
                _total += r.GetPrice();
            }
            if (BuildDisks != null)
            {
                foreach (HardDrive d in BuildDisks.Select(x => x.HardDrive).ToArray())
                {
                    _total += d.GetPrice();
                }
            }
            if (BuildODs != null)
            {
                foreach (OpticalDriver o in BuildODs.Select(x => x.OpticalDriver).ToArray())
                {
                    _total += o.GetPrice();
                }
            }
            if (BuildMonitors != null)
            {
                foreach (Monitor m in BuildMonitors.Select(x => x.Monitor).ToArray())
                {
                    m.GetPrice();
                }
            }
            if (BuildPCIs != null)
            {
                foreach (PCICard c in BuildPCIs.Select(x => x.PCICard).ToArray())
                {
                    _total += c.GetPrice();
                }
            }
            if (BuildsPeripherals != null)
            {
                foreach (Peripheral p in BuildsPeripherals.Select(x => x.Peripheral).ToArray())
                {
                    _total += p.GetPrice();
                }
            }

            return(_total);
        }