Exemplo n.º 1
0
        /// <summary>
        /// Lay tat ca hang hoa trong chi tiet kho hang thoa man batDau<= HanSuDung <=KetThuc.
        /// </summary>
        /// <param name="batDau"></param>
        /// <param name="ketThuc"></param>
        /// <param name="now"></param>
        /// <returns></returns>
        public Entities.ChiTietKhoHang[] GetData(DateTime batDau, DateTime ketThuc, DateTime now)
        {
            List <Entities.ChiTietKhoHang> ctkhList = new List <Entities.ChiTietKhoHang>();

            try
            {
                cl           = new Server_Client.Client();
                this.client1 = cl.Connect(Luu.IP, Luu.Ports);
                Entities.ChiTietKhoHang ct = new Entities.ChiTietKhoHang();
                clientstrem = cl.SerializeObj(this.client1, "ChiTietKhoAll", ct);
                Entities.ChiTietKhoHang[] ctArr = new Entities.ChiTietKhoHang[1];
                ctArr = (Entities.ChiTietKhoHang[])cl.DeserializeHepper(clientstrem, ctArr);
                if (ctArr != null && ctArr.Count() > 0)
                {
                    foreach (Entities.ChiTietKhoHang item in ctArr)
                    {
                        if (batDau <= item.HanSuDung && item.HanSuDung <= ketThuc && item.HanSuDung > now && item.SoLuong > 0)
                        {
                            ctkhList.Add(item);
                        }
                    }
                }
            }
            catch (Exception)
            {
            }
            return(ctkhList.ToArray());
        }
Exemplo n.º 2
0
        /// <summary>
        /// Lay tat ca hang hoa trong chi tiet kho hang thoa man batDau<= HanSuDung <=KetThuc.
        /// </summary>
        /// <param name="batDau"></param>
        /// <param name="ketThuc"></param>
        /// <param name="now"></param>
        /// <returns></returns>
        public Entities.ChiTietKhoHang[] GetData(DateTime batDau, DateTime ketThuc, DateTime now)
        {
            List<Entities.ChiTietKhoHang> ctkhList = new List<Entities.ChiTietKhoHang>();
            try
            {
                cl = new Server_Client.Client();
                this.client1 = cl.Connect(Luu.IP, Luu.Ports);
                Entities.ChiTietKhoHang ct = new Entities.ChiTietKhoHang();
                clientstrem = cl.SerializeObj(this.client1, "ChiTietKhoAll", ct);
                Entities.ChiTietKhoHang[] ctArr = new Entities.ChiTietKhoHang[1];
                ctArr = (Entities.ChiTietKhoHang[])cl.DeserializeHepper(clientstrem, ctArr);
                if (ctArr != null && ctArr.Count() > 0)
                {
                    foreach (Entities.ChiTietKhoHang item in ctArr)
                    {
                        if (batDau <= item.HanSuDung && item.HanSuDung <= ketThuc && item.HanSuDung > now && item.SoLuong > 0)
                        {
                            ctkhList.Add(item);
                        }
                    }
                }

            }
            catch (Exception)
            {
            }
            return ctkhList.ToArray();
        }