Example #1
0
        public int PostGia(CHPCtemp CH)
        {
            GPU gpu = new GPU();

            gpu = new Controllers.GPUController().GetByID(CH.MaGPU);

            CPU cpu = new CPU();

            cpu = new Controllers.CPUController().GetByID(CH.MaCPU);

            Mainboard main = new Controllers.MainboardController().GetByID(CH.MaMain);

            RAM ram = new Controllers.RAMController().GetByID(CH.MaRam);

            RAM ram2 = new Controllers.RAMController().GetByID(CH.MaRam2);

            HDD hdd = new Controllers.HDDController().GetByID(CH.MaHDD);

            HDD hdd2 = new Controllers.HDDController().GetByID(CH.MaHDD2);

            Nguon nguon = new Controllers.NguonController().GetByID(CH.MaNguon);

            CasePC casepc = new Controllers.CasePCController().GetByID(CH.MaCase);

            int gia = 0;

            gia += gpu.Giaban + cpu.Giaban + main.Giaban + ram.Giaban + ram2.Giaban + hdd.Giaban + hdd2.Giaban + nguon.Giaban + casepc.Giaban;
            return(gia);
        }
Example #2
0
        public string PostName(CHPCtemp CH)
        {
            GPU gpu = new GPU();

            gpu = new Controllers.GPUController().GetByID(CH.MaGPU);

            CPU cpu = new CPU();

            cpu = new Controllers.CPUController().GetByID(CH.MaCPU);

            Mainboard main = new Controllers.MainboardController().GetByID(CH.MaMain);

            RAM ram = new Controllers.RAMController().GetByID(CH.MaRam);

            RAM ram2 = new Controllers.RAMController().GetByID(CH.MaRam2);

            HDD hdd = new Controllers.HDDController().GetByID(CH.MaHDD);

            HDD hdd2 = new Controllers.HDDController().GetByID(CH.MaHDD2);

            Nguon nguon = new Controllers.NguonController().GetByID(CH.MaNguon);

            CasePC casepc = new Controllers.CasePCController().GetByID(CH.MaCase);

            string Name = "";

            Name += gpu.Model + '|' + cpu.Model + '|' + main.Model + '|' + ram.Model + '|' + ram2.Model + '|' + hdd.Model + '|' + hdd2.Model + '|' + nguon.Model + '|' + casepc.Model + '|' + CH.Giaban;
            return(Name);
        }
Example #3
0
        public bool CheckRM(string MaRam, string MaMain)
        {
            RAM ram = new RAM();

            ram = new Controllers.RAMController().GetByID(MaRam);

            Mainboard main = new Mainboard();

            main = new Controllers.MainboardController().GetByID(MaMain);

            if (ram.LoaiRam == main.LoaiRamToiDa)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #4
0
        public bool CheckGM(string MaGPU, string MaMain)
        {
            GPU gpu = new GPU();

            gpu = new Controllers.GPUController().GetByID(MaGPU);

            Mainboard main = new Mainboard();

            main = new Controllers.MainboardController().GetByID(MaMain);

            if (gpu.PCI == main.PCI)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #5
0
        public bool CheckCM(string MaCPU, string MaMain)
        {
            Mainboard main = new Mainboard();

            main = new Controllers.MainboardController().GetByID(MaMain);

            CPU cpu = new CPU();

            cpu = new Controllers.CPUController().GetByID(MaCPU);

            if (cpu.Socket == main.Socket)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #6
0
        public IList <string> Update(CHPCtemp CH, string Giatien, string Nhucau)
        {
            GPU gpu = new GPU();

            gpu = new Controllers.GPUController().GetByID(CH.MaGPU);

            CPU cpu = new CPU();

            cpu = new Controllers.CPUController().GetByID(CH.MaCPU);

            Mainboard main = new Controllers.MainboardController().GetByID(CH.MaMain);

            RAM ram = new Controllers.RAMController().GetByID(CH.MaRam);

            int Tien = int.Parse(Giatien);

            if (Nhucau.Equals("CPU") == true)
            {
                IList <CPU>    lstCPU       = new List <CPU>();
                IList <string> lstCPUResult = new List <string>();
                lstCPU = new CPUController().GetListUpdate(cpu.Diem, gpu.Diem, Tien);
                for (int i = 0; i < lstCPU.Count(); i++)
                {
                    if (lstCPU[i].Socket == main.Socket)
                    {
                        lstCPUResult.Add(lstCPU[i].MaCPU);
                    }
                }
                return(lstCPUResult);
            }
            else
            {
                if (Nhucau.Equals("GPU") == true)
                {
                    IList <GPU>    lstGPU       = new List <GPU>();
                    IList <string> lstGPUResult = new List <string>();
                    lstGPU = new GPUController().GetListUpdate(gpu.Diem, Tien);
                    for (int i = 0; i < lstGPU.Count(); i++)
                    {
                        if (lstGPU[i].PCI == main.PCI)
                        {
                            lstGPUResult.Add(lstGPU[i].MaGPU);
                        }
                    }
                    return(lstGPUResult);
                }
                else
                {
                    IList <RAM>    lstRAM       = new List <RAM>();
                    IList <string> lstRAMResult = new List <string>();
                    lstRAM = new RAMController().GetListUpdate(Tien, ram.DungLuong, ram.LoaiRam);
                    for (int i = 0; i < lstRAM.Count(); i++)
                    {
                        if (lstRAM[i].LoaiRam == main.LoaiRamToiDa)
                        {
                            lstRAMResult.Add(lstRAM[i].MaRam);
                        }
                    }
                    return(lstRAMResult);
                }
            }
        }