예제 #1
0
        /// <summary>
        /// load RAM từ csdl lên form
        /// </summary>
        /// <returns>true: thanh cong - false: that bai.</returns>

        public bool LoadRAM()
        {
            MyChiTietDongRamBUS        chiTietDongRam = new MyChiTietDongRamBUS();
            List <myChiTietDongRamDTO> dsDongRam      = new List <myChiTietDongRamDTO>();

            try
            {
                dsDongRam = chiTietDongRam.LayChiTietDongRam();
            }
            catch
            {
                MessageBox.Show("Lỗi khi lấy chi tiết dòng ram", "Thông báo");
                return(false);
            }

            foreach (myChiTietDongRamDTO ram in dsDongRam)
            {
                comboBox_Ram.Items.Add(ram);
            }
            comboBox_Ram.DisplayMember = "STenDongRAM";
            comboBox_Ram.SelectedItem  = comboBox_Ram.Items[0];
            return(true);
        }
예제 #2
0
        /// <summary>
        /// Load các thông tin ban đầu cho combobox và textbox
        /// </summary>
        public void LoadInfor()
        {
            // Load Ram
            MyChiTietDongRamBUS        chiTietDongRam = new MyChiTietDongRamBUS();
            List <myChiTietDongRamDTO> dsDongRam      = new List <myChiTietDongRamDTO>();

            try
            {
                dsDongRam = chiTietDongRam.LayChiTietDongRam();
            }
            catch
            {
                dsDongRam = null;
            }
            if (dsDongRam != null)
            {
                foreach (myChiTietDongRamDTO ram in dsDongRam)
                {
                    cbb_ram.Items.Add(ram);
                }
                cbb_ram.DisplayMember = "STenDongRAM";
                cbb_ram.SelectedItem  = cbb_ram.Items[0];
            }

            // Load CPUs
            MyChiTietDongCPUBUS        chiTietDongCPU = new MyChiTietDongCPUBUS();
            List <myChiTietDongCPUDTO> dsDongCPU      = new List <myChiTietDongCPUDTO>();

            try
            {
                dsDongCPU = chiTietDongCPU.LayChiTietDongCPU();
            }
            catch
            {
                dsDongCPU = null;
            }
            if (dsDongCPU != null)
            {
                foreach (myChiTietDongCPUDTO cpu in dsDongCPU)
                {
                    cbb_cpu.Items.Add(cpu);
                }
                cbb_cpu.DisplayMember = "STenDongCPU";
                cbb_cpu.SelectedItem  = cbb_cpu.Items[0];
            }
            // Load O Cung
            MyChiTietDongOCungBUS        chiTietDongOCung = new MyChiTietDongOCungBUS();
            List <myChiTietDongOCungDTO> dsDongOCung      = new List <myChiTietDongOCungDTO>();

            try
            {
                dsDongOCung = chiTietDongOCung.LayChiTietDongOCung();
            }
            catch
            {
                dsDongOCung = null;
            }
            if (dsDongOCung != null)
            {
                foreach (myChiTietDongOCungDTO ocung in dsDongOCung)
                {
                    cbb_ocung.Items.Add(ocung);
                }
                cbb_ocung.DisplayMember = "STenDongOCung";
                cbb_ocung.SelectedItem  = cbb_ocung.Items[0];
            }

            // Load Man Hinh
            MyChiTietDongManHinhBUS        chiTietManHinh = new MyChiTietDongManHinhBUS();
            List <myChiTietDongManHinhDTO> dsManHinh      = new List <myChiTietDongManHinhDTO>();

            try
            {
                dsManHinh = chiTietManHinh.LayChiTietDongManHinh();
            }
            catch
            {
                dsManHinh = null;
            }
            if (dsManHinh != null)
            {
                foreach (myChiTietDongManHinhDTO manhinh in dsManHinh)
                {
                    cbb_manhinh.Items.Add(manhinh);
                }
                cbb_manhinh.DisplayMember = "STenDongManHinh";
                cbb_manhinh.SelectedItem  = cbb_manhinh.Items[0];
            }

            // Load Card Mang Hinh
            MyChiTietDongCardDoHoaBUS        chiTietCardDoHoa = new MyChiTietDongCardDoHoaBUS();
            List <myChiTietDongCardDoHoaDTO> dsCardDoHoa      = new List <myChiTietDongCardDoHoaDTO>();

            try
            {
                dsCardDoHoa = chiTietCardDoHoa.LayChiTietDongCardDoHoa();
            }
            catch
            {
                dsCardDoHoa = null;
            }
            if (dsCardDoHoa != null)
            {
                foreach (myChiTietDongCardDoHoaDTO carddohoa in dsCardDoHoa)
                {
                    cbb_cardmanhinh.Items.Add(carddohoa);
                }
                cbb_cardmanhinh.DisplayMember = "STenDongCardDoHoa";
                cbb_cardmanhinh.SelectedItem  = cbb_cardmanhinh.Items[0];
            }

            // Load Dong Loa
            MyChiTietDongLoaBUS        chiTietDongLoa = new MyChiTietDongLoaBUS();
            List <myChiTietDongLoaDTO> dsLoa          = new List <myChiTietDongLoaDTO>();

            try
            {
                dsLoa = chiTietDongLoa.LayChiTietDongLoa();
            }
            catch
            {
                dsLoa = null;
            }
            if (dsLoa != null)
            {
                foreach (myChiTietDongLoaDTO loa in dsLoa)
                {
                    cbb_loa.Items.Add(loa);
                }
                cbb_loa.DisplayMember = "STenDongLoa";
                cbb_loa.SelectedItem  = cbb_loa.Items[0];
            }
            // Load O Quang
            MyChiTietDongODiaQuangBUS        chiTietDongDQ = new MyChiTietDongODiaQuangBUS();
            List <myChiTietDongODiaQuangDTO> dsDiaQuang    = new List <myChiTietDongODiaQuangDTO>();

            try
            {
                dsDiaQuang = chiTietDongDQ.LayChiTietDongODiaQuang();
            }
            catch
            {
                dsDiaQuang = null;
            }
            if (dsDongRam != null)
            {
                foreach (myChiTietDongODiaQuangDTO diaquang in dsDiaQuang)
                {
                    cbb_oquang.Items.Add(diaquang);
                }
                cbb_oquang.DisplayMember = "STenDongODiaQuang";
                cbb_oquang.SelectedItem  = cbb_oquang.Items[0];
            }

            //Load HDH
            MyChiTietHeDieuHanhBUS        chiTietHDH = new MyChiTietHeDieuHanhBUS();
            List <myChiTietHeDieuHanhDTO> dsHDH      = new List <myChiTietHeDieuHanhDTO>();

            try
            {
                dsHDH = chiTietHDH.LayChiTietHeDieuHanh();
            }
            catch
            {
                dsHDH = null;
            }
            if (dsHDH != null)
            {
                foreach (myChiTietHeDieuHanhDTO hdh in dsHDH)
                {
                    cbb_hdh.Items.Add(hdh);
                }
                cbb_hdh.DisplayMember = "STenHeDieuHanh";
                cbb_hdh.SelectedItem  = cbb_hdh.Items[0];
            }

            //Load Trong Luong
            MyChiTietTrongLuongBUS        chiTietTL    = new MyChiTietTrongLuongBUS();
            List <myChiTietTrongLuongDTO> dsTrongLuong = new List <myChiTietTrongLuongDTO>();

            try
            {
                dsTrongLuong = chiTietTL.LayChiTietTrongLuong();
            }
            catch
            {
                dsTrongLuong = null;
            }
            if (dsTrongLuong != null)
            {
                foreach (myChiTietTrongLuongDTO trongluong in dsTrongLuong)
                {
                    cbb_trongluong.Items.Add(trongluong);
                }
                cbb_trongluong.DisplayMember = "FGiaTriTrongLuong";
                cbb_trongluong.SelectedItem  = cbb_trongluong.Items[0];
            }

            //Load Ten Dong LapTop & Mau Sac & Thoi Gian Bao Hanh & Gia Ban

            List <myChiTietDongLaptopDTO> dsLapTop = new List <myChiTietDongLaptopDTO>();

            try
            {
                dsLapTop = MyChiTietDongLaptopBUS.LayDanhSachChiTietDongLaptop();
            }
            catch
            {
                dsLapTop = null;
            }
            // - Mau Sac-
            if (dsLapTop != null)
            {
                foreach (myChiTietDongLaptopDTO laptop in dsLapTop)
                {
                    bool trace = true;
                    for (int index = 0; index < cbb_mausac.Items.Count; index++)
                    {
                        if (string.Compare(cbb_mausac.Items[index].ToString().Trim(), laptop.SMauSac.Trim(), true) == 0)
                        {
                            trace = false;
                        }
                    }
                    if (trace == true)
                    {
                        cbb_mausac.Items.Add(laptop.SMauSac);
                    }
                }

                cbb_mausac.SelectedItem = cbb_mausac.Items[0];
                // - Thoi Gian Bao Hanh
                foreach (myChiTietDongLaptopDTO laptop in dsLapTop)
                {
                    bool trace = true;
                    for (int index = 0; index < cbb_thoigian_bh.Items.Count; index++)
                    {
                        if (string.Compare(cbb_thoigian_bh.Items[index].ToString().Trim(), laptop.IThoiGianBaoHanh.ToString().Trim(), true) == 0)
                        {
                            trace = false;
                        }
                    }
                    if (trace == true)
                    {
                        cbb_thoigian_bh.Items.Add(laptop.IThoiGianBaoHanh);
                    }
                }
                cbb_thoigian_bh.SelectedItem = cbb_thoigian_bh.Items[0];
            }

            //Load Card Mạng
            MyChiTietDongCardMangBUS        chiTietCardMang = new MyChiTietDongCardMangBUS();
            List <myChiTietDongCardMangDTO> dsCardMang      = new List <myChiTietDongCardMangDTO>();

            try
            {
                dsCardMang = chiTietCardMang.LayChiTietDongCardMang();
            }
            catch
            {
                dsCardMang = null;
            }
            if (dsCardMang != null)
            {
                foreach (myChiTietDongCardMangDTO cardmang in dsCardMang)
                {
                    cbb_cardmang.Items.Add(cardmang);
                }
                cbb_cardmang.DisplayMember = "STenDongCardMang";
                cbb_cardmang.SelectedItem  = cbb_cardmang.Items[0];
            }

            //Load CardReader
            MyChiTietDongCardReaderBUS        chiTietCardReader = new MyChiTietDongCardReaderBUS();
            List <myChiTietDongCardReaderDTO> dsCardReader      = new List <myChiTietDongCardReaderDTO>();

            try
            {
                dsCardReader = chiTietCardReader.LayChiTietDongCardReader();
            }
            catch
            {
                dsCardReader = null;
            }
            if (dsCardReader != null)
            {
                foreach (myChiTietDongCardReaderDTO cardreader in dsCardReader)
                {
                    cbb_cardreader.Items.Add(cardreader);
                }
                cbb_cardreader.DisplayMember = "STenDongCardReader";
                cbb_cardreader.SelectedItem  = cbb_cardreader.Items[0];
            }

            //Load WebCam
            MyChiTietDongWebcamBUS        chiTietWebCam = new MyChiTietDongWebcamBUS();
            List <myChiTietDongWebcamDTO> dsWebcam      = new List <myChiTietDongWebcamDTO>();

            try
            {
                dsWebcam = chiTietWebCam.LayChiTietDongWebcam();
            }
            catch
            {
                dsWebcam = null;
            }
            if (dsWebcam != null)
            {
                foreach (myChiTietDongWebcamDTO webcam in dsWebcam)
                {
                    cbb_webcam.Items.Add(webcam);
                }
                cbb_webcam.DisplayMember = "STenDongWebcam";
                cbb_webcam.SelectedItem  = cbb_webcam.Items[0];
            }

            //Load Pin
            MyChiTietDongPinBUS        chiTietPin = new MyChiTietDongPinBUS();
            List <myChiTietDongPinDTO> dsPin      = new List <myChiTietDongPinDTO>();

            try
            {
                dsPin = chiTietPin.LayChiTietDongPin();
            }
            catch
            {
                dsPin = null;
            }

            if (dsPin != null)
            {
                foreach (myChiTietDongPinDTO pin in dsPin)
                {
                    cbb_pin.Items.Add(pin);
                }
                cbb_pin.DisplayMember = "FTenDongPin";
                cbb_pin.SelectedItem  = cbb_pin.Items[0];
            }

            //Load Kha Nang Nhan Dang Van Tay
            cbb_vantay.Items.Add("Có");
            cbb_vantay.Items.Add("Không");
            cbb_vantay.SelectedItem = cbb_vantay.Items[0];

            //Load Cong HDMI
            cbb_hdmi.Items.Add("Có");
            cbb_hdmi.Items.Add("Không");
            cbb_hdmi.SelectedItem = cbb_hdmi.Items[0];

            // Load So Cong USB
            cbb_usb.Items.Add("1");
            cbb_usb.Items.Add("2");
            cbb_usb.Items.Add("3");
            cbb_usb.Items.Add("4");
            cbb_usb.SelectedItem = cbb_usb.Items[0];

            // Load Nha SX
            MyNhaSanXuatBUS        nhaSX   = new MyNhaSanXuatBUS();
            List <myNhaSanXuatDTO> dsNhaSX = new List <myNhaSanXuatDTO>();

            try
            {
                dsNhaSX = nhaSX.LayNhaSanXuat();
            }
            catch
            {
                dsNhaSX = null;
            }
            if (dsNhaSX != null)
            {
                foreach (myNhaSanXuatDTO nhasx in dsNhaSX)
                {
                    cbb_nhasx.Items.Add(nhasx);
                }
                cbb_nhasx.DisplayMember = "STenNhaSanXuat";
                cbb_nhasx.SelectedItem  = cbb_nhasx.Items[0];
            }
        }
예제 #3
0
        /// <summary>
        /// Khởi tạo danh sách các sản phẩm ban đầu cho từng combobox
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void TRACUUSANPHAM_Load(object sender, EventArgs e)
        {
            // Load Ram
            MyChiTietDongRamBUS        chiTietDongRam = new MyChiTietDongRamBUS();
            List <myChiTietDongRamDTO> dsDongRam      = new List <myChiTietDongRamDTO>();

            try
            {
                dsDongRam = chiTietDongRam.LayChiTietDongRam();
            }
            catch
            {
                dsDongRam = null;
            }
            comboBox_Ram.Items.Add("--Không quan tâm--");
            if (dsDongRam != null)
            {
                foreach (myChiTietDongRamDTO ram in dsDongRam)
                {
                    comboBox_Ram.Items.Add(ram.STenDongRAM);
                }
                comboBox_Ram.SelectedItem = comboBox_Ram.Items[0];
            }

            // Load CPU
            MyChiTietDongCPUBUS        chiTietDongCPU = new MyChiTietDongCPUBUS();
            List <myChiTietDongCPUDTO> dsDongCPU      = new List <myChiTietDongCPUDTO>();

            try
            {
                dsDongCPU = chiTietDongCPU.LayChiTietDongCPU();
            }
            catch
            {
                dsDongCPU = null;
            }
            comboBox_CPU.Items.Add("--Không quan tâm--");
            if (dsDongCPU != null)
            {
                foreach (myChiTietDongCPUDTO cpu in dsDongCPU)
                {
                    comboBox_CPU.Items.Add(cpu.STenDongCPU);
                }
                comboBox_CPU.SelectedItem = comboBox_CPU.Items[0];
            }

            // Load O Cung
            MyChiTietDongOCungBUS        chiTietDongOCung = new MyChiTietDongOCungBUS();
            List <myChiTietDongOCungDTO> dsDongOCung      = new List <myChiTietDongOCungDTO>();

            try
            {
                dsDongOCung = chiTietDongOCung.LayChiTietDongOCung();
            }
            catch
            {
                dsDongOCung = null;
            }
            comboBox_HardDisk.Items.Add("--Không quan tâm--");
            if (dsDongOCung != null)
            {
                foreach (myChiTietDongOCungDTO ocung in dsDongOCung)
                {
                    bool trace = true;
                    for (int index = 0; index < comboBox_HardDisk.Items.Count; index++)
                    {
                        if (string.Compare(comboBox_HardDisk.Items[index].ToString().Trim(), ocung.STenDongOCung.Trim(), true) == 0)
                        {
                            trace = false;
                        }
                    }
                    if (trace == true)
                    {
                        comboBox_HardDisk.Items.Add(ocung.STenDongOCung);
                    }
                    comboBox_HardDisk.SelectedItem = comboBox_HardDisk.Items[0];
                }
            }

            // Load Man Hinh
            MyChiTietDongManHinhBUS        chiTietManHinh = new MyChiTietDongManHinhBUS();
            List <myChiTietDongManHinhDTO> dsManHinh      = new List <myChiTietDongManHinhDTO>();

            try
            {
                dsManHinh = chiTietManHinh.LayChiTietDongManHinh();
            }
            catch
            {
                dsManHinh = null;
            }
            comboBox_ManHinh.Items.Add("--Không quan tâm--");
            if (dsManHinh != null)
            {
                foreach (myChiTietDongManHinhDTO manhinh in dsManHinh)
                {
                    comboBox_ManHinh.Items.Add(manhinh.STenDongManHinh);
                }
                comboBox_ManHinh.SelectedItem = comboBox_ManHinh.Items[0];
            }

            // Load Card Mang Hinh
            MyChiTietDongCardDoHoaBUS        chiTietCardDoHoa = new MyChiTietDongCardDoHoaBUS();
            List <myChiTietDongCardDoHoaDTO> dsCardDoHoa      = new List <myChiTietDongCardDoHoaDTO>();

            try
            {
                dsCardDoHoa = chiTietCardDoHoa.LayChiTietDongCardDoHoa();
            }
            catch
            {
                dsCardDoHoa = null;
            }
            comboBox_CardManHinh.Items.Add("--Không quan tâm--");
            if (dsCardDoHoa != null)
            {
                foreach (myChiTietDongCardDoHoaDTO carddohoa in dsCardDoHoa)
                {
                    comboBox_CardManHinh.Items.Add(carddohoa.STenDongCardDoHoa);
                }
                comboBox_CardManHinh.SelectedItem = comboBox_CardManHinh.Items[0];
            }

            // Load Dong Loa
            MyChiTietDongLoaBUS        chiTietDongLoa = new MyChiTietDongLoaBUS();
            List <myChiTietDongLoaDTO> dsLoa          = new List <myChiTietDongLoaDTO>();

            try
            {
                dsLoa = chiTietDongLoa.LayChiTietDongLoa();
            }
            catch
            {
                dsLoa = null;
            }
            comboBox_Loa.Items.Add("--Không quan tâm--");
            if (dsLoa != null)
            {
                foreach (myChiTietDongLoaDTO loa in dsLoa)
                {
                    comboBox_Loa.Items.Add(loa.STenDongLoa);
                }
                comboBox_Loa.SelectedItem = comboBox_Loa.Items[0];
            }

            // Load O Quang
            MyChiTietDongODiaQuangBUS        chiTietDongDQ = new MyChiTietDongODiaQuangBUS();
            List <myChiTietDongODiaQuangDTO> dsDiaQuang    = new List <myChiTietDongODiaQuangDTO>();

            try
            {
                dsDiaQuang = chiTietDongDQ.LayChiTietDongODiaQuang();
            }
            catch
            {
                dsDiaQuang = null;
            }
            comboBox_ODiaQuang.Items.Add("--Không quan tâm--");
            if (dsDiaQuang != null)
            {
                foreach (myChiTietDongODiaQuangDTO diaquang in dsDiaQuang)
                {
                    bool trace = true;
                    for (int index = 0; index < comboBox_ODiaQuang.Items.Count; index++)
                    {
                        if (string.Compare(comboBox_ODiaQuang.Items[index].ToString().Trim(), diaquang.STenDongODiaQuang.Trim(), true) == 0)
                        {
                            trace = false;
                        }
                    }
                    if (trace == true)
                    {
                        comboBox_ODiaQuang.Items.Add(diaquang.STenDongODiaQuang);
                    }
                }
                comboBox_ODiaQuang.SelectedItem = comboBox_ODiaQuang.Items[0];
            }

            //Load HDH
            MyChiTietHeDieuHanhBUS        chiTietHDH = new MyChiTietHeDieuHanhBUS();
            List <myChiTietHeDieuHanhDTO> dsHDH      = new List <myChiTietHeDieuHanhDTO>();

            try
            {
                dsHDH = chiTietHDH.LayChiTietHeDieuHanh();
            }
            catch
            {
                dsHDH = null;
            }
            comboBox_HeDieuHanh.Items.Add("--Không quan tâm--");
            if (dsHDH != null)
            {
                foreach (myChiTietHeDieuHanhDTO hdh in dsHDH)
                {
                    comboBox_HeDieuHanh.Items.Add(hdh.STenHeDieuHanh);
                }
                comboBox_HeDieuHanh.SelectedItem = comboBox_HeDieuHanh.Items[0];
            }

            //Load Trong Luong
            MyChiTietTrongLuongBUS        chiTietTL    = new MyChiTietTrongLuongBUS();
            List <myChiTietTrongLuongDTO> dsTrongLuong = new List <myChiTietTrongLuongDTO>();

            try
            {
                dsTrongLuong = chiTietTL.LayChiTietTrongLuong();
            }
            catch
            {
                dsTrongLuong = null;
            }
            comboBox_TrongLuong.Items.Add("--Không quan tâm--");
            if (dsTrongLuong != null)
            {
                foreach (myChiTietTrongLuongDTO tl in dsTrongLuong)
                {
                    comboBox_TrongLuong.Items.Add(tl.FGiaTriTrongLuong);
                }
                comboBox_TrongLuong.SelectedItem = comboBox_TrongLuong.Items[0];
            }

            //Load Ten Dong LapTop & Mau Sac & Thoi Gian Bao Hanh & Gia Ban

            List <myChiTietDongLaptopDTO> dsLapTop = new List <myChiTietDongLaptopDTO>();

            try
            {
                dsLapTop = MyChiTietDongLaptopBUS.LayDanhSachChiTietDongLaptop();
            }
            catch
            {
                dsLapTop = null;
            }
            // - Ten Dong LapTop
            Combobox_TenDongLapTop.Items.Add("--Không quan tâm--");
            if (dsLapTop != null)
            {
                foreach (myChiTietDongLaptopDTO laptop in dsLapTop)
                {
                    bool trace = true;
                    for (int index = 0; index < Combobox_TenDongLapTop.Items.Count; index++)
                    {
                        if (string.Compare(Combobox_TenDongLapTop.Items[index].ToString().Trim(), laptop.STenChiTietDongLapTop.Trim(), true) == 0)
                        {
                            trace = false;
                        }
                    }
                    if (trace == true)
                    {
                        Combobox_TenDongLapTop.Items.Add(laptop.STenChiTietDongLapTop);
                    }
                }
                Combobox_TenDongLapTop.SelectedItem = Combobox_TenDongLapTop.Items[0];

                // - Mau Sac-
                comboBox_MauSac.Items.Add("--Không quan tâm--");
                foreach (myChiTietDongLaptopDTO laptop in dsLapTop)
                {
                    bool trace = true;
                    for (int index = 0; index < comboBox_MauSac.Items.Count; index++)
                    {
                        if (string.Compare(comboBox_MauSac.Items[index].ToString().Trim(), laptop.SMauSac.Trim(), true) == 0)
                        {
                            trace = false;
                        }
                    }
                    if (trace == true)
                    {
                        comboBox_MauSac.Items.Add(laptop.SMauSac);
                    }
                }

                comboBox_MauSac.SelectedItem = comboBox_MauSac.Items[0];
                // - Thoi Gian Bao Hanh
                comboBox_ThoiGianBaoHanh.Items.Add("--Không quan tâm--");
                foreach (myChiTietDongLaptopDTO laptop in dsLapTop)
                {
                    bool trace = true;
                    for (int index = 0; index < comboBox_ThoiGianBaoHanh.Items.Count; index++)
                    {
                        if (string.Compare(comboBox_ThoiGianBaoHanh.Items[index].ToString().Trim(), laptop.IThoiGianBaoHanh.ToString().Trim(), true) == 0)
                        {
                            trace = false;
                        }
                    }
                    if (trace == true)
                    {
                        comboBox_ThoiGianBaoHanh.Items.Add(laptop.IThoiGianBaoHanh);
                    }
                }
                comboBox_ThoiGianBaoHanh.SelectedItem = comboBox_ThoiGianBaoHanh.Items[0];
                // - Gia Ban Hien Hanh
                comboBox_GiaBan.Items.Add("--Không quan tâm--");
                foreach (myChiTietDongLaptopDTO laptop in dsLapTop)
                {
                    bool trace = true;
                    for (int index = 0; index < comboBox_GiaBan.Items.Count; index++)
                    {
                        if (string.Compare(comboBox_GiaBan.Items[index].ToString().Trim(), laptop.FGiaBanHienHanh.ToString().Trim(), true) == 0)
                        {
                            trace = false;
                        }
                    }
                    if (trace == true)
                    {
                        comboBox_GiaBan.Items.Add(laptop.FGiaBanHienHanh + " triệu đồng");
                    }
                }
                comboBox_GiaBan.SelectedItem = comboBox_GiaBan.Items[0];
            }
            //Load Card Mạng
            MyChiTietDongCardMangBUS        chiTietCardMang = new MyChiTietDongCardMangBUS();
            List <myChiTietDongCardMangDTO> dsCardMang      = new List <myChiTietDongCardMangDTO>();

            try
            {
                dsCardMang = chiTietCardMang.LayChiTietDongCardMang();
            }
            catch
            {
                dsCardMang = null;
            }
            comboBox_CardMang.Items.Add("--Không quan tâm--");
            if (dsCardMang != null)
            {
                foreach (myChiTietDongCardMangDTO cardmang in dsCardMang)
                {
                    comboBox_CardMang.Items.Add(cardmang.STenDongCardMang);
                }
                comboBox_CardMang.SelectedItem = comboBox_CardMang.Items[0];
            }

            //Load CardReader
            MyChiTietDongCardReaderBUS        chiTietCardReader = new MyChiTietDongCardReaderBUS();
            List <myChiTietDongCardReaderDTO> dsCardReader      = new List <myChiTietDongCardReaderDTO>();

            try
            {
                dsCardReader = chiTietCardReader.LayChiTietDongCardReader();
            }
            catch
            {
                dsCardReader = null;
            }
            comboBox_CardReader.Items.Add("--Không quan tâm--");
            if (dsCardReader != null)
            {
                foreach (myChiTietDongCardReaderDTO cardreader in dsCardReader)
                {
                    comboBox_CardReader.Items.Add(cardreader.STenDongCardReader);
                }
                comboBox_CardReader.SelectedItem = comboBox_CardReader.Items[0];
            }

            //Load WebCam
            MyChiTietDongWebcamBUS        chiTietWebCam = new MyChiTietDongWebcamBUS();
            List <myChiTietDongWebcamDTO> dsWebcam      = new List <myChiTietDongWebcamDTO>();

            try
            {
                dsWebcam = chiTietWebCam.LayChiTietDongWebcam();
            }
            catch
            {
                dsWebcam = null;
            }
            comboBox_Webcam.Items.Add("--Không quan tâm--");
            if (dsWebcam != null)
            {
                foreach (myChiTietDongWebcamDTO webcam in dsWebcam)
                {
                    comboBox_Webcam.Items.Add(webcam.STenDongWebCam);
                }
                comboBox_Webcam.SelectedItem = comboBox_Webcam.Items[0];
            }

            //Load Pin
            MyChiTietDongPinBUS        chiTietPin = new MyChiTietDongPinBUS();
            List <myChiTietDongPinDTO> dsPin      = new List <myChiTietDongPinDTO>();

            try
            {
                dsPin = chiTietPin.LayChiTietDongPin();
            }
            catch
            {
                dsPin = null;
            }

            comboBox_Pin.Items.Add("--Không quan tâm--");
            if (dsPin != null)
            {
                foreach (myChiTietDongPinDTO pin in dsPin)
                {
                    bool trace = true;
                    for (int index = 0; index < comboBox_Pin.Items.Count; index++)
                    {
                        if (string.Compare(comboBox_Pin.Items[index].ToString().Trim(), pin.FTenDongPin.Trim(), true) == 0)
                        {
                            trace = false;
                        }
                    }
                    if (trace == true)
                    {
                        comboBox_Pin.Items.Add(pin.FTenDongPin);
                    }
                }

                comboBox_Pin.SelectedItem = comboBox_Pin.Items[0];
            }

            //Load Kha Nang Nhan Dang Van Tay
            comboBox_NhanDangVanTay.Items.Add("--Không quan tâm--");
            comboBox_NhanDangVanTay.Items.Add("Có");
            comboBox_NhanDangVanTay.Items.Add("Không");
            comboBox_NhanDangVanTay.SelectedItem = comboBox_NhanDangVanTay.Items[0];

            //Load Cong HDMI
            comboBox_HDMI.Items.Add("--Không quan tâm--");
            comboBox_HDMI.Items.Add("Có");
            comboBox_HDMI.Items.Add("Không");
            comboBox_HDMI.SelectedItem = comboBox_HDMI.Items[0];

            // Load So Cong USB
            comboBox_SoCongUSB.Items.Add("--Không quan tâm--");
            comboBox_SoCongUSB.Items.Add("1");
            comboBox_SoCongUSB.Items.Add("2");
            comboBox_SoCongUSB.Items.Add("3");
            comboBox_SoCongUSB.SelectedItem = comboBox_SoCongUSB.Items[0];

            // Load Nha SX
            MyNhaSanXuatBUS        nhaSX   = new MyNhaSanXuatBUS();
            List <myNhaSanXuatDTO> dsNhaSX = new List <myNhaSanXuatDTO>();

            try
            {
                dsNhaSX = nhaSX.LayNhaSanXuat();
            }
            catch
            {
                dsNhaSX = null;
            }
            comboBox_NhaSanXuat.Items.Add("--Không quan tâm--");
            if (dsNhaSX != null)
            {
                foreach (myNhaSanXuatDTO nhasx in dsNhaSX)
                {
                    comboBox_NhaSanXuat.Items.Add(nhasx.STenNhaSanXuat);
                }
                comboBox_NhaSanXuat.SelectedItem = comboBox_NhaSanXuat.Items[0];
            }
        }