public DateTime LayHSD(string maPhieuDieuChuyen, string maHangHoa) { Entities.PhieuDieuChuyenKhoNoiBo[] pdck = new BizLogic.PhieuDieuChuyenKhoNoiBo().Select(); string makho = ""; if (pdck != null) { for (int i = 0; i < pdck.Length; i++) { if (pdck[i].MaPhieuDieuChuyenKho == maPhieuDieuChuyen) { makho = pdck[i].TuKho; break; } } } Entities.ChiTietKhoHangTheoHoaHonNhap[] khohang = new BizLogic.ChiTietKhoHangTheoHoaHonNhap().Select(); for (int i = 0; i < khohang.Length; i++) { if (khohang[i].Makho == makho && khohang[i].Mahanghoa == maHangHoa) { return(khohang[i].Ngayhethan); } } return(new DateTime(2001, 01, 01)); }
public void LayPhieuDieuChuyenKhoNoiBo() { try { Entities.PhieuDieuChuyenKhoNoiBo[] PDieuChuyen1 = new Entities.PhieuDieuChuyenKhoNoiBo[0]; PDieuChuyen1 = new BizLogic.PhieuDieuChuyenKhoNoiBo().Select(); if (PDieuChuyen1 == null) { PDieuChuyen1 = new Entities.PhieuDieuChuyenKhoNoiBo[0]; PDieuChuyen = PDieuChuyen1; return; } int count = 0; for (int i = 0; i < PDieuChuyen1.Length; i++) { DateTime ngaydieuchuyen = PDieuChuyen1[i].NgayDieuChuyen; if (ngaydieuchuyen >= BatDau && ngaydieuchuyen <= KetThuc) { count++; } } PDieuChuyen = new Entities.PhieuDieuChuyenKhoNoiBo[count]; count = 0; for (int i = 0; i < PDieuChuyen1.Length; i++) { DateTime ngaydieuchuyen = PDieuChuyen1[i].NgayDieuChuyen; if (ngaydieuchuyen >= BatDau && ngaydieuchuyen <= KetThuc) { PDieuChuyen[count] = PDieuChuyen1[i]; count++; } } } catch { } }
public void LayPhieuDieuChuyenKhoNoiBo() { try { Entities.PhieuDieuChuyenKhoNoiBo[] PDieuChuyen1 = new Entities.PhieuDieuChuyenKhoNoiBo[0]; PDieuChuyen1 = new BizLogic.PhieuDieuChuyenKhoNoiBo().Select(); if (PDieuChuyen1 == null) { PDieuChuyen1 = new Entities.PhieuDieuChuyenKhoNoiBo[0]; PDieuChuyen = PDieuChuyen1; return; } int count = 0; for (int i = 0; i < PDieuChuyen1.Length; i++) { DateTime ngaydieuchuyen = PDieuChuyen1[i].NgayDieuChuyen; if (ngaydieuchuyen >= BatDau && ngaydieuchuyen <= KetThuc) { count++; } } PDieuChuyen = new Entities.PhieuDieuChuyenKhoNoiBo[count]; count = 0; for (int i = 0; i < PDieuChuyen1.Length; i++) { DateTime ngaydieuchuyen = PDieuChuyen1[i].NgayDieuChuyen; if (ngaydieuchuyen >= BatDau && ngaydieuchuyen <= KetThuc) { PDieuChuyen[count] = PDieuChuyen1[i]; count++; } } } catch { } }
public DateTime LayHSD(string maPhieuDieuChuyen, string maHangHoa) { Entities.PhieuDieuChuyenKhoNoiBo[] pdck=new BizLogic.PhieuDieuChuyenKhoNoiBo().Select(); string makho=""; if (pdck!=null) { for (int i = 0; i < pdck.Length; i++) { if (pdck[i].MaPhieuDieuChuyenKho ==maPhieuDieuChuyen) { makho = pdck[i].TuKho; break; } } } Entities.ChiTietKhoHangTheoHoaHonNhap[] khohang = new BizLogic.ChiTietKhoHangTheoHoaHonNhap().Select(); for (int i = 0; i < khohang.Length; i++) { if (khohang[i].Makho==makho && khohang[i].Mahanghoa==maHangHoa) { return khohang[i].Ngayhethan; } } return new DateTime(2001,01,01); }
public void Xuly_PhieuDieuChuyenKho(NetworkStream clientStream) { Entities.PhieuDieuChuyenKhoNoiBo pdck = (Entities.PhieuDieuChuyenKhoNoiBo)formatter.Deserialize(clientStream); // kiểm tra hành động được gửi đến switch (pdck.HanhDong) { case "Insert": { int msg = new BizLogic.PhieuDieuChuyenKhoNoiBo().InsertUpdate(pdck); formatter.Serialize(clientStream, msg); break; } case "Update": { int msg = new BizLogic.PhieuDieuChuyenKhoNoiBo().InsertUpdate(pdck); formatter.Serialize(clientStream, msg); break; } case "Delete": { new BizLogic.PhieuDieuChuyenKhoNoiBo().Delete(pdck); break; } case "Select": { Entities.PhieuDieuChuyenKhoNoiBo[] tt1 = new BizLogic.PhieuDieuChuyenKhoNoiBo().Select(); formatter.Serialize(clientStream, tt1); break; } case "SelectTheoMaKho": { Entities.PhieuDieuChuyenKhoNoiBo[] tt1 = new BizLogic.PhieuDieuChuyenKhoNoiBo().SelectTheoMaKho(pdck.TuKho); formatter.Serialize(clientStream, tt1); break; } default: break; } }