public Entities.ChiTietPhieuDieuChuyenKho[] LayChiTiet_PhieuDieuChuyenKho_TheoMaPhieu(string maPhieu)
        {
            int count = 0;

            for (int i = 0; i < ctPDCK.Length; i++)
            {
                if (ctPDCK[i].MaPhieuDieuChuyenKho == maPhieu)
                {
                    count++;
                }
            }
            Entities.ChiTietPhieuDieuChuyenKho[] ctPDCK1 = new Entities.ChiTietPhieuDieuChuyenKho[count];
            count = 0;
            for (int i = 0; i < ctPDCK.Length; i++)
            {
                if (ctPDCK[i].MaPhieuDieuChuyenKho == maPhieu)
                {
                    ctPDCK1[count] = ctPDCK[i];
                    count++;
                }
            }
            if (ctPDCK1 == null)
            {
                ctPDCK1 = new Entities.ChiTietPhieuDieuChuyenKho[0];
                return(ctPDCK1);
            }
            else
            {
                return(ctPDCK1);
            }
        }
 public void LayChiTiet_PhieuDieuChuyenKho()
 {
     cl           = new Server_Client.Client();
     this.client1 = cl.Connect(Luu.IP, Luu.Ports);
     Entities.ChiTietPhieuDieuChuyenKho ctxh = new Entities.ChiTietPhieuDieuChuyenKho("Select");
     clientstrem = cl.SerializeObj(this.client1, "ChiTietPhieuDieuCHuyenKhoNoiBo", ctxh);
     ctPDCK      = new Entities.ChiTietPhieuDieuChuyenKho[0];
     ctPDCK      = (Entities.ChiTietPhieuDieuChuyenKho[])cl.DeserializeHepper1(clientstrem, ctPDCK);
     if (ctPDCK == null)
     {
         ctPDCK = new Entities.ChiTietPhieuDieuChuyenKho[0];
         return;
     }
 }
예제 #3
0
        public DataGridView HienThiChiTietTheoPDCK(string Phieudieuchuyenkho)
        {
            cl           = new Server_Client.Client();
            this.client1 = cl.Connect(Luu.IP, Luu.Ports);

            Entities.ChiTietPhieuDieuChuyenKho kh = new Entities.ChiTietPhieuDieuChuyenKho("Select");
            clientstrem = cl.SerializeObj(this.client1, "ChiTietPhieuDieuCHuyenKhoNoiBo", kh);

            Entities.ChiTietPhieuDieuChuyenKho[] kh1 = new Entities.ChiTietPhieuDieuChuyenKho[1];
            kh1 = (Entities.ChiTietPhieuDieuChuyenKho[])cl.DeserializeHepper1(clientstrem, kh1);

            if (kh1 != null)
            {
                int ctcount = 0;

                for (int i = 0; i < kh1.Length; i++)
                {
                    if (kh1[i].MaPhieuDieuChuyenKho == Phieudieuchuyenkho)
                    {
                        ctcount++;
                    }
                }

                Entities.ChiTietPhieuDieuChuyenKho[] ctpdck1 = new Entities.ChiTietPhieuDieuChuyenKho[ctcount];
                ctcount = 0;
                for (int i = 0; i < kh1.Length; i++)
                {
                    if (kh1[i].MaPhieuDieuChuyenKho == Phieudieuchuyenkho)
                    {
                        ctpdck1[ctcount]                      = new ChiTietPhieuDieuChuyenKho();
                        ctpdck1[ctcount].HanhDong             = kh1[i].HanhDong;
                        ctpdck1[ctcount].MaHangHoa            = kh1[i].MaHangHoa;
                        ctpdck1[ctcount].MaPhieuDieuChuyenKho = kh1[i].MaPhieuDieuChuyenKho;
                        ctpdck1[ctcount].NgayHetHan           = kh1[i].NgayHetHan;
                        ctpdck1[ctcount].SoLuong              = kh1[i].SoLuong;
                        ctcount++;
                    }
                }

                dgv.DataSource = ctpdck1;
                return(dgv);
            }
            return(dgv);
        }
        public DataGridView HienThiChiTietTheoPDCK(string Phieudieuchuyenkho)
        {
            cl = new Server_Client.Client();
            this.client1 = cl.Connect(Luu.IP, Luu.Ports);

            Entities.ChiTietPhieuDieuChuyenKho kh = new Entities.ChiTietPhieuDieuChuyenKho("Select");
            clientstrem = cl.SerializeObj(this.client1, "ChiTietPhieuDieuCHuyenKhoNoiBo", kh);

            Entities.ChiTietPhieuDieuChuyenKho[] kh1 = new Entities.ChiTietPhieuDieuChuyenKho[1];
            kh1 = (Entities.ChiTietPhieuDieuChuyenKho[])cl.DeserializeHepper1(clientstrem, kh1);

            if (kh1 != null)
            {
                int ctcount = 0;

                for (int i = 0; i < kh1.Length; i++)
                {
                    if (kh1[i].MaPhieuDieuChuyenKho == Phieudieuchuyenkho)
                    {
                        ctcount++;
                    }
                }

                Entities.ChiTietPhieuDieuChuyenKho[] ctpdck1 = new Entities.ChiTietPhieuDieuChuyenKho[ctcount];
                ctcount = 0;
                for (int i = 0; i < kh1.Length; i++)
                {
                    if (kh1[i].MaPhieuDieuChuyenKho == Phieudieuchuyenkho)
                    {
                        ctpdck1[ctcount] = new ChiTietPhieuDieuChuyenKho();
                        ctpdck1[ctcount].HanhDong = kh1[i].HanhDong;
                        ctpdck1[ctcount].MaHangHoa = kh1[i].MaHangHoa;
                        ctpdck1[ctcount].MaPhieuDieuChuyenKho = kh1[i].MaPhieuDieuChuyenKho;
                        ctpdck1[ctcount].NgayHetHan = kh1[i].NgayHetHan;
                        ctpdck1[ctcount].SoLuong = kh1[i].SoLuong;
                        ctcount++;
                    }
                }

                dgv.DataSource = ctpdck1;
                return dgv;
            }
            return dgv;
        }
        public DataGridView HienThiChiTiet(string maHDNhap, string maPDCK, string makho)
        {
            cl = new Server_Client.Client();
            this.client1 = cl.Connect(Luu.IP, Luu.Ports);

            Entities.ChiTietHoaDonNhap[] kh = new Entities.ChiTietHoaDonNhap[1];
            kh[0] = new Entities.ChiTietHoaDonNhap("Select");
            clientstrem = cl.SerializeObj(this.client1, "ChiTietHoaDonNhap", kh);

            Entities.ChiTietHoaDonNhap[] kh1 = new Entities.ChiTietHoaDonNhap[1];
            kh1 = (Entities.ChiTietHoaDonNhap[])cl.DeserializeHepper1(clientstrem, kh1);
            if (kh1.Length > 0)
            {
                int ctcount = 0;
                foreach (Entities.ChiTietHoaDonNhap h in kh1)
                {
                    if (h.MaHoaDonNhap == maHDNhap)
                    {
                        ctcount++;
                    }
                }

                Entities.ChiTietHoaDonNhap[] hdn = new Entities.ChiTietHoaDonNhap[ctcount];
                ctcount = 0;
                foreach (Entities.ChiTietHoaDonNhap h in kh1)
                {
                    if (h.MaHoaDonNhap == maHDNhap)
                    {
                        hdn[ctcount] = new Entities.ChiTietHoaDonNhap();
                        hdn[ctcount].MaHangHoa = h.MaHangHoa;
                        hdn[ctcount].SoLuong = h.SoLuong;
                        ctcount++;
                    }
                }

                Server_Client.Client cl1 = new Server_Client.Client();
                this.client1 = cl1.Connect(Luu.IP, Luu.Ports);

                Entities.ChiTietKhoHangTheoHoaHonNhap[] ctkh = new Entities.ChiTietKhoHangTheoHoaHonNhap[1];
                ctkh[0] = new Entities.ChiTietKhoHangTheoHoaHonNhap("Select");
                clientstrem = cl1.SerializeObj(this.client1, "ChiTietKho", ctkh);

                Entities.ChiTietKhoHangTheoHoaHonNhap[] ctkh1 = new Entities.ChiTietKhoHangTheoHoaHonNhap[1];
                ctkh1 = (Entities.ChiTietKhoHangTheoHoaHonNhap[])cl1.DeserializeHepper1(clientstrem, kh1);

                Entities.ChiTietPhieuDieuChuyenKho[] ctdck = new Entities.ChiTietPhieuDieuChuyenKho[ctcount];
                for (int i = 0; i < ctdck.Length; i++)
                {
                    ctdck[i] = new Entities.ChiTietPhieuDieuChuyenKho();
                    ctdck[i].MaHangHoa = hdn[i].MaHangHoa;
                    ctdck[i].SoLuong = hdn[i].SoLuong;
                    ctdck[i].MaPhieuDieuChuyenKho = maPDCK;
                    if (ctkh1 != null)
                    {
                        for (int j = 0; j < ctkh1.Length; j++)
                        {
                            if (ctkh1[j].Makho == makho && hdn[i].MaHangHoa == ctkh1[j].Mahanghoa)
                            {
                                ctdck[i].NgayHetHan = ctkh1[i].Ngayhethan;
                            }
                        }
                    }

                }

                dgv.DataSource = ctdck;
                return dgv;
            }
            return dgv;
        }
        public Entities.ChiTietPhieuDieuChuyenKho[] LayChiTiet_PhieuDieuChuyenKho_TheoMaPhieu(string maPhieu)
        {
            int count = 0;

            for (int i = 0; i < ctPDCK.Length; i++)
            {
                if (ctPDCK[i].MaPhieuDieuChuyenKho == maPhieu)
                {
                    count++;
                }
            }
            Entities.ChiTietPhieuDieuChuyenKho[] ctPDCK1 = new Entities.ChiTietPhieuDieuChuyenKho[count];
            count = 0;
            for (int i = 0; i < ctPDCK.Length; i++)
            {
                if (ctPDCK[i].MaPhieuDieuChuyenKho == maPhieu)
                {
                    ctPDCK1[count] = ctPDCK[i];
                    count++;
                }
            }
            if (ctPDCK1 == null)
            {
                ctPDCK1 = new Entities.ChiTietPhieuDieuChuyenKho[0];
                return ctPDCK1;
            }
            else
            {
                return ctPDCK1;
            }
        }
 public void LayChiTiet_PhieuDieuChuyenKho()
 {
     cl = new Server_Client.Client();
     this.client1 = cl.Connect(Luu.IP, Luu.Ports);
     Entities.ChiTietPhieuDieuChuyenKho ctxh = new Entities.ChiTietPhieuDieuChuyenKho("Select");
     clientstrem = cl.SerializeObj(this.client1, "ChiTietPhieuDieuCHuyenKhoNoiBo", ctxh);
     ctPDCK = new Entities.ChiTietPhieuDieuChuyenKho[0];
     ctPDCK = (Entities.ChiTietPhieuDieuChuyenKho[])cl.DeserializeHepper1(clientstrem, ctPDCK);
     if (ctPDCK == null)
     {
         ctPDCK = new Entities.ChiTietPhieuDieuChuyenKho[0];
         return;
     }
 }
예제 #8
0
        public DataGridView HienThiChiTiet(string maHDNhap, string maPDCK, string makho)
        {
            cl           = new Server_Client.Client();
            this.client1 = cl.Connect(Luu.IP, Luu.Ports);

            Entities.ChiTietHoaDonNhap[] kh = new Entities.ChiTietHoaDonNhap[1];
            kh[0]       = new Entities.ChiTietHoaDonNhap("Select");
            clientstrem = cl.SerializeObj(this.client1, "ChiTietHoaDonNhap", kh);

            Entities.ChiTietHoaDonNhap[] kh1 = new Entities.ChiTietHoaDonNhap[1];
            kh1 = (Entities.ChiTietHoaDonNhap[])cl.DeserializeHepper1(clientstrem, kh1);
            if (kh1.Length > 0)
            {
                int ctcount = 0;
                foreach (Entities.ChiTietHoaDonNhap h in kh1)
                {
                    if (h.MaHoaDonNhap == maHDNhap)
                    {
                        ctcount++;
                    }
                }

                Entities.ChiTietHoaDonNhap[] hdn = new Entities.ChiTietHoaDonNhap[ctcount];
                ctcount = 0;
                foreach (Entities.ChiTietHoaDonNhap h in kh1)
                {
                    if (h.MaHoaDonNhap == maHDNhap)
                    {
                        hdn[ctcount]           = new Entities.ChiTietHoaDonNhap();
                        hdn[ctcount].MaHangHoa = h.MaHangHoa;
                        hdn[ctcount].SoLuong   = h.SoLuong;
                        ctcount++;
                    }
                }

                Server_Client.Client cl1 = new Server_Client.Client();
                this.client1 = cl1.Connect(Luu.IP, Luu.Ports);

                Entities.ChiTietKhoHangTheoHoaHonNhap[] ctkh = new Entities.ChiTietKhoHangTheoHoaHonNhap[1];
                ctkh[0]     = new Entities.ChiTietKhoHangTheoHoaHonNhap("Select");
                clientstrem = cl1.SerializeObj(this.client1, "ChiTietKho", ctkh);

                Entities.ChiTietKhoHangTheoHoaHonNhap[] ctkh1 = new Entities.ChiTietKhoHangTheoHoaHonNhap[1];
                ctkh1 = (Entities.ChiTietKhoHangTheoHoaHonNhap[])cl1.DeserializeHepper1(clientstrem, kh1);



                Entities.ChiTietPhieuDieuChuyenKho[] ctdck = new Entities.ChiTietPhieuDieuChuyenKho[ctcount];
                for (int i = 0; i < ctdck.Length; i++)
                {
                    ctdck[i]                      = new Entities.ChiTietPhieuDieuChuyenKho();
                    ctdck[i].MaHangHoa            = hdn[i].MaHangHoa;
                    ctdck[i].SoLuong              = hdn[i].SoLuong;
                    ctdck[i].MaPhieuDieuChuyenKho = maPDCK;
                    if (ctkh1 != null)
                    {
                        for (int j = 0; j < ctkh1.Length; j++)
                        {
                            if (ctkh1[j].Makho == makho && hdn[i].MaHangHoa == ctkh1[j].Mahanghoa)
                            {
                                ctdck[i].NgayHetHan = ctkh1[i].Ngayhethan;
                            }
                        }
                    }
                }

                dgv.DataSource = ctdck;
                return(dgv);
            }
            return(dgv);
        }