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); }
public int CheckCG(string MaCPU, string MaGPU) { GPU gpu = new GPU(); gpu = new Controllers.GPUController().GetByID(MaGPU); CPU cpu = new CPU(); cpu = new Controllers.CPUController().GetByID(MaCPU); if (cpu.Diem <= gpu.Diem + 1000 && cpu.Diem >= gpu.Diem - 500) { return(0); } else { if (cpu.Diem < gpu.Diem) { return(1); } else { return(2); } } }
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); }
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); } }
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); } } }