public void LayChiTiet_HangHoaXuat_TheoKho(string maKho, string tenKho)
        {
            try
            {
                int count = 0;
                for (int i = 0; i < ctHangHoaTheoKho.Length; i++)
                {
                    if (ctHangHoaTheoKho[i].Makho == maKho)
                    {
                        count++;
                    }
                }
                Entities.ChiTietKhoHangTheoHoaHonNhap[] ctkho = new Entities.ChiTietKhoHangTheoHoaHonNhap[count];
                count = 0;

                for (int i = 0; i < ctHangHoaTheoKho.Length; i++)
                {
                    if (ctHangHoaTheoKho[i].Makho == maKho)
                    {
                        ctkho[count] = ctHangHoaTheoKho[i];
                        count++;
                    }
                }

                ctBCXH = new Entities.CTBCNhapHangTheoKho[count];
                for (int i = 0; i < ctkho.Length; i++)
                {
                    ctBCXH[i]                 = new Entities.CTBCNhapHangTheoKho();
                    ctBCXH[i].MaKho           = ctkho[i].Makho;
                    ctBCXH[i].TenKho          = tenKho;
                    ctBCXH[i].MaHangHoa       = ctkho[i].Mahanghoa;
                    ctBCXH[i].TongSoLuongNhap = 0;
                    for (int j = 0; j < HangHoa.Length; j++)
                    {
                        if (HangHoa[j].MaHangHoa == ctBCXH[i].MaHangHoa)
                        {
                            ctBCXH[i].TenHangHoa = HangHoa[j].TenHangHoa;
                            break;
                        }
                    }
                }
            }
            catch { }
        }
        public void LayChiTiet_HangHoaXuat_TheoKho(string maKho, string tenKho)
        {
            try
            {
                int count = 0;
                for (int i = 0; i < ctHangHoaTheoKho.Length; i++)
                {
                    if (ctHangHoaTheoKho[i].Makho == maKho)
                    {
                        count++;
                    }
                }
                Entities.ChiTietKhoHangTheoHoaHonNhap[] ctkho = new Entities.ChiTietKhoHangTheoHoaHonNhap[count];
                count = 0;

                for (int i = 0; i < ctHangHoaTheoKho.Length; i++)
                {
                    if (ctHangHoaTheoKho[i].Makho == maKho)
                    {
                        ctkho[count] = ctHangHoaTheoKho[i];
                        count++;
                    }
                }

                ctBCXH = new Entities.CTBCNhapHangTheoKho[count];
                for (int i = 0; i < ctkho.Length; i++)
                {
                    ctBCXH[i] = new Entities.CTBCNhapHangTheoKho();
                    ctBCXH[i].MaKho = ctkho[i].Makho;
                    ctBCXH[i].TenKho = tenKho;
                    ctBCXH[i].MaHangHoa = ctkho[i].Mahanghoa;
                    ctBCXH[i].TongSoLuongNhap = 0;
                    for (int j = 0; j < HangHoa.Length; j++)
                    {
                        if (HangHoa[j].MaHangHoa == ctBCXH[i].MaHangHoa)
                        {
                            ctBCXH[i].TenHangHoa = HangHoa[j].TenHangHoa;
                            break;
                        }
                    }
                }
            }
            catch { }
        }