public void LayHDNhap()
        {
            try
            {
                Entities.HoaDonNhap[] HDN = new Entities.HoaDonNhap[0];
                HDN = new BizLogic.HoaDonNhap().Select();
                if (HDN == null)
                {
                    HoaDonNhap = new Entities.HoaDonNhap[0];
                    return;
                }
                int count = 0;
                for (int i = 0; i < HDN.Length; i++)
                {
                    DateTime ngaylap = HDN[i].NgayNhap;
                    if (ngaylap >= BatDau && ngaylap <= KetThuc)
                    {
                        count++;
                    }
                }
                Entities.HoaDonNhap[] HoaDonNhap1 = new Entities.HoaDonNhap[count];
                count = 0;
                for (int i = 0; i < HDN.Length; i++)
                {
                    DateTime ngaylap = HDN[i].NgayNhap;
                    if (ngaylap >= BatDau && ngaylap <= KetThuc)
                    {
                        HoaDonNhap1[count] = HDN[i];
                        count++;
                    }
                }
                if (HoaDonNhap1.Length == 0)
                {
                    HoaDonNhap = new Entities.HoaDonNhap[0];
                    return;
                }
                else
                    HoaDonNhap = HoaDonNhap1;

            }
            catch
            {
            }
        }
Example #2
0
 /// <summary>
 /// =======================================hoa don nhap=========================================================
 /// </summary>
 private void XuLy_HoaDonNhap(NetworkStream clientStream)
 {
     Entities.HoaDonNhap hdn = (Entities.HoaDonNhap)formatter.Deserialize(clientStream);
     switch (hdn.Hanhdong)
     {
         case "Insert":
             {
                 int i = new BizLogic.HoaDonNhap().sp_XuLy_HoaDonNhap(hdn);
                 if (i == 1)
                 {
                     new BizLogic.LogFile().GhiFile(new Entities.LogFile(hdn.Manhanvien, hdn.Tendangnhap, hdn.Hanhdong, DateTime.Now.ToString(), "Thêm hóa đơn nhập kho: " + hdn.MaHoaDonNhap));
                 }
                 formatter.Serialize(clientStream, i);
                 break;
             }
         case "Update":
             {
                 int i = new BizLogic.HoaDonNhap().sp_XuLy_HoaDonNhap(hdn);
                 if (i == 1)
                 {
                     new BizLogic.LogFile().GhiFile(new Entities.LogFile(hdn.Manhanvien, hdn.Tendangnhap, hdn.Hanhdong, DateTime.Now.ToString(), "Sửa hóa đơn nhập kho: " + hdn.MaHoaDonNhap));
                 }
                 formatter.Serialize(clientStream, i);
                 break;
             }
         case "Delete":
             {
                 int i = new BizLogic.HoaDonNhap().sp_Xoa_HoaDonNhap(hdn);
                 if (i == 1)
                 {
                     new BizLogic.LogFile().GhiFile(new Entities.LogFile(hdn.Manhanvien, hdn.Tendangnhap, hdn.Hanhdong, DateTime.Now.ToString(), "Xóa hóa đơn nhập kho: " + hdn.MaHoaDonNhap));
                 }
                 formatter.Serialize(clientStream, i);
                 break;
             }
         case "Select":
             {
                 Entities.HoaDonNhap[] select = (Entities.HoaDonNhap[])new BizLogic.HoaDonNhap().sp_LayBang_HoaDonNhap(hdn);
                 formatter.Serialize(clientStream, select);
                 break;
             }
         default:
             break;
     }
 }
Example #3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="clientStream"></param>
 private void UpdateDuNo(NetworkStream clientStream)
 {
     Entities.TruyenGiaTri truyen = (Entities.TruyenGiaTri)formatter.Deserialize(clientStream);
     switch (truyen.Hanhdong)
     {
         case "Update":
             {
                 int i = new BizLogic.HoaDonNhap().UpdateDuNo(truyen);
                 formatter.Serialize(clientStream, i);
                 break;
             }
         default:
             break;
     }
 }
Example #4
0
        /// <summary>
        /// Kho hàng
        /// </summary>
        /// <param name="clientStream"></param>
        /// 
        public void XuLy_HoaDonNhapMang(NetworkStream clientStream)
        {
            Entities.HoaDonNhap[] cthdbh = (Entities.HoaDonNhap[])formatter.Deserialize(clientStream);
            switch (cthdbh[0].Hanhdong)
            {
                case "Update":
                    {

                        bool kt = new BizLogic.HoaDonNhap().UpdateThanhToanNgay(cthdbh);
                        formatter.Serialize(clientStream, kt);
                        break;
                    }

                default:
                    break;
            }
        }
Example #5
0
        public void XuLy_HDN(NetworkStream clientStream)
        {
            Entities.HoaDonNhap cthdbh = (Entities.HoaDonNhap)formatter.Deserialize(clientStream);
            switch (cthdbh.Hanhdong)
            {
                case "Select":
                    {

                        Entities.HoaDonNhap[] hdn = new BizLogic.HoaDonNhap().Select();
                        formatter.Serialize(clientStream, hdn);
                        break;
                    }
                case "ThanhToanNgaySauLapPhieu":
                    {
                        bool msg = new BizLogic.PhieuTTNCC().InsertUpdateSauKhiLapPhieu(cthdbh);
                        formatter.Serialize(clientStream, msg);
                        break;
                    }
                default:
                    break;
            }
        }
Example #6
0
 public Entities.HoaDonNhap[] HoaDonNhap()
 {
     Entities.HoaDonNhap[] hdn = new BizLogic.HoaDonNhap().Select();
     if (hdn == null)
         hdn = new Entities.HoaDonNhap[0];
     return hdn;
 }