Exemplo n.º 1
0
        public List <Motherboard> GetAllMB()
        {
            var        connection = new SqlConnection(connectionString);
            SqlCommand command    = new SqlCommand("Select * FROM MotherBoard");

            List <Motherboard> mbs = new List <Motherboard>();

            command.Connection = connection;
            connection.Open();
            using (connection)
                using (var reader = command.ExecuteReader())
                {
                    for (int i = 0; i < 1; i++)
                    {
                        reader.Read();
                        string     brand  = reader.GetString(1);
                        string     model  = reader.GetString(2);
                        string     socket = reader.GetString(3);
                        Formfactor size   = Formfactor.ATX;
                        switch (reader.GetString(4))
                        {
                        case "ATX":
                            size = Formfactor.ATX;
                            break;

                        case "E-ATX":
                            size = Formfactor.E_ATX;
                            break;

                        case "Mini-ATX":
                            size = Formfactor.Mini_ATX;
                            break;

                        case "Micro-ATX":
                            size = Formfactor.Micro_ATX;
                            break;

                        case "ITX":
                            size = Formfactor.ITX;
                            break;
                        }
                        int         memsup      = reader.GetInt32(5);
                        int         m2_support  = reader.GetInt32(6);
                        int         sataPorts   = reader.GetInt32(7);
                        string      lanModule   = reader.GetString(8);
                        string      soundModule = reader.GetString(9);
                        int         usb3        = reader.GetInt32(10);
                        int         usb2        = reader.GetInt32(11);
                        int         fanheader   = reader.GetInt32(12);
                        string      rgb         = reader.GetString(13);
                        double      price       = reader.GetDouble(14);
                        Motherboard mb          = new Motherboard(brand, model, socket, size, memsup, m2_support, sataPorts, lanModule, soundModule, usb3, usb2, fanheader, rgb, price);
                        mbs.Add(mb);
                    }
                }
            connection.Close();
            return(mbs);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Vreating a new entry for a PowerSupply
 /// </summary>
 /// <param name="brand">Manufacturer of PSU</param>
 /// <param name="model">Productname of PSU</param>
 /// <param name="wattage">Maximum Power output of PSU</param>
 /// <param name="size">Biggest compatible Pc Formfactor</param>
 /// <param name="efficiency">Standardized Efficiency Rating of PSU</param>
 /// <param name="modularity">Modularity of PSU</param>
 /// <param name="multiGPU">Multi GPU capable</param>
 /// <param name="maxsata">Maximum amount of Sata connectors</param>
 /// <param name="cabletype">Isolation of Cable(Sleved, Rubber,...)</param>
 /// <param name="price">MSRP of PSU</param>
 public PowerSupply(string brand, string model, int wattage, Formfactor size, string efficiency, bool modularity, bool multiGPU,
                    int maxsata, string cabletype, double price)
 {
     this.Brand         = brand;
     this.Model         = model;
     this.Wattage       = wattage;
     this.Size          = size;
     this.Efficiency    = efficiency;
     this.Modular       = modularity;
     this.MultiGPU      = multiGPU;
     this.SataConnector = maxsata;
     this.CableType     = cabletype;
     this.Price         = price;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Creating a new Case Entry
 /// </summary>
 /// <param name="brand">Manufacturer of Case</param>
 /// <param name="model">Biggest supported Meinbaord size</param>
 /// <param name="size">Biggest supported Meinbaord size</param>
 /// <param name="hdd">Maximum of supported 3.5inch drives</param>
 /// <param name="ssd">Maximum of supported 2.5inch drives</param>
 /// <param name="maxrad">Minimum needed PSU size</param>
 /// <param name="sideglas">Side Panel Material (If no window = "none")</param>
 /// <param name="fans">All preinstalled Fans</param>
 /// <param name="color">Color of Case</param>
 /// <param name="Price">MSRP of Case</param>
 public Case(string brand, string model, Formfactor size, int hdd, int ssd, int maxrad, string sideglas,
             List <Fan> fans, string color, double price)
 {
     this.Brand            = brand;
     this.Model            = model;
     this.Size             = size;
     this.HDDBays          = hdd;
     this.SSDBays          = ssd;
     this.MaxRad           = maxrad;
     this.SideGlas         = sideglas;
     this.PreinstalledFans = fans;
     this.Color            = color;
     this.Price            = price;
 }
Exemplo n.º 4
0
        public IComponent Constructor(OptionCollection options, dynamic modelParserResult)
        {
            Formfactor formfactor = Server.FindOrAdd(modelParserResult.Formfactor, options.Formfactors, new Formfactor());

            return(new HDD
            {
                Brand = Brand,
                Model = modelParserResult.Model,
                Benchmark = Benchmark,
                Price = Price,
                Url = Url,
                Formfactor = formfactor.Id,
                Capacity = modelParserResult.Capacity
            });
        }
Exemplo n.º 5
0
 /// <summary>
 /// Creating a new Motherboard entry
 /// </summary>
 /// <param name="brand">Name of Manufacturer of MB</param>
 /// <param name="model">product name of MB</param>
 /// <param name="socket">Compatible CPU Socket</param>
 /// <param name="size">standardized Size of MB (E_ATX, ATX, Mini_ATX, Micro_ATX, ITX)</param>
 /// <param name="memsup">Maximum of supported Memory</param>
 /// <param name="m_2Slots">Amount of M.2 Slots on MB</param>
 /// <param name="sataPorts">Amount of Sata POrts on MB</param>
 /// <param name="lanModule">Model of LAN Module</param>
 /// <param name="soundModule">Model of Sound Module</param>
 /// <param name="usb3">Amount of USB 3.1 Ports</param>
 /// <param name="usb2">Amount of USB 2.0 Ports</param>
 /// <param name="fanHeader">Amount of all Fan Headers</param>
 /// <param name="rgb">Supported Lightningcontoll Software</param>
 /// <param name="price">Price for Product</param>
 public Motherboard(string brand, string model, string socket, Formfactor size, string memsup, int m_2Slots, int sataPorts,
                    string lanModule, string soundModule, int usb3, int usb2, int fanHeader, string rgb, float price)
 {
     this.Brand            = brand;
     this.Model            = model;
     this.Socket           = socket;
     this.Size             = size;
     this.Memorysupport    = memsup;
     this.M_2Slots         = m_2Slots;
     this.SataPorts        = sataPorts;
     this.LanModule        = lanModule;
     this.SoundModule      = soundModule;
     this.Usb3_1Ports      = usb3;
     this.Usb2Ports        = usb2;
     this.FanHeader        = fanHeader;
     this.LightningSoution = rgb;
 }
Exemplo n.º 6
0
        public List <PowerSupply> GetAllPowerSupply()
        {
            var        connection = new SqlConnection(connectionString);
            SqlCommand command    = new SqlCommand("Select * FROM PowerSupply");

            List <PowerSupply> powersupplies = new List <PowerSupply>();

            command.Connection = connection;
            connection.Open();
            using (connection)
                using (var reader = command.ExecuteReader())
                {
                    for (int i = 0; i < 1; i++)
                    {
                        reader.Read();
                        string     brand   = reader.GetString(1);
                        string     model   = reader.GetString(2);
                        int        wattage = reader.GetInt32(3);
                        Formfactor size    = Formfactor.ATX;
                        switch (reader.GetString(4))
                        {
                        case "E-ATX":
                            size = Formfactor.E_ATX;
                            break;

                        case "Mini-ATX":
                            size = Formfactor.Mini_ATX;
                            break;

                        case "Micro-ATX":
                            size = Formfactor.Micro_ATX;
                            break;

                        case "ITX":
                            size = Formfactor.ITX;
                            break;
                        }
                        string effefficiency = reader.GetString(5);
                        bool   modularity    = false;
                        if (reader.GetSqlBoolean(6) == true)
                        {
                            modularity = true;
                        }
                        bool multigpu = false;
                        if (reader.GetSqlBoolean(7) == true)
                        {
                            multigpu = true;
                        }
                        int    maxsata   = reader.GetInt32(8);
                        string cabletype = reader.GetString(9);
                        double price     = reader.GetDouble(10);



                        PowerSupply powersupply = new PowerSupply(brand, model, wattage, size, effefficiency, modularity, multigpu, maxsata, cabletype, price);
                        powersupplies.Add(powersupply);
                    }
                }
            connection.Close();
            return(powersupplies);
        }
Exemplo n.º 7
0
        public List <Case> GetAllCase(List <Fan> fans)
        {
            var        connection = new SqlConnection(connectionString);
            SqlCommand command    = new SqlCommand("Select * FROM _CASE");

            List <Fan>  includedfans = new List <Fan>();
            List <Case> cases        = new List <Case>();

            command.Connection = connection;
            connection.Open();
            using (connection)
                using (var reader = command.ExecuteReader())
                {
                    for (int i = 0; i < 1; i++)
                    {
                        reader.Read();
                        string     brand = reader.GetString(1);
                        string     model = reader.GetString(2);
                        Formfactor size  = Formfactor.ATX;
                        switch (reader.GetString(3))
                        {
                        case "ATX":
                            size = Formfactor.ATX;
                            break;

                        case "E-ATX":
                            size = Formfactor.E_ATX;
                            break;

                        case "Mini-ATX":
                            size = Formfactor.Mini_ATX;
                            break;

                        case "Micro-ATX":
                            size = Formfactor.Micro_ATX;
                            break;

                        case "ITX":
                            size = Formfactor.ITX;
                            break;
                        }
                        int    hdd       = reader.GetInt32(4);
                        int    ssd       = reader.GetInt32(5);
                        int    maxrad    = reader.GetInt32(6);
                        string sideglass = reader.GetString(7);
                        foreach (var item in reader.GetString(8).Split(','))
                        {
                            foreach (var fan in fans)
                            {
                                if (fan.ID == int.Parse(item))
                                {
                                    includedfans.Add(fan);
                                }
                            }
                        }

                        string color = reader.GetString(9);
                        double price = reader.GetDouble(10);
                        Case   _case = new Case(brand, model, size, hdd, ssd, maxrad, sideglass, includedfans, color, price);
                        cases.Add(_case);
                    }
                }
            connection.Close();
            return(cases);
        }