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 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); }