public async Task Create(KiemKhoViewModel O)
        {
            PhieuKiemKho order = new PhieuKiemKho
            {
                SoPhieuKiemKho = O.soPhieuKiemKho,
                NgayKiemKho    = DateTime.Now,
                MaNhanVien     = O.maNhanVien,
                TrangThai      = true,
                GhiChu         = O.ghiChu,
                NgayChinhSua   = DateTime.Now,
            };

            foreach (var i in O.chiTietPhieuKiemKho)
            {
                order.ChiTietPhieuKiemKhos.Add(i);
            }
            await _phieuKiemKhoRepo.InsertAsync(order);
        }
Beispiel #2
0
        public async Task <JsonResult> LuuPhieuKiemKho(KiemKhoViewModel phieuKiemKho)
        {
            bool status = false;

            if (ModelState.IsValid)
            {
                await _phieuKiemKhoBus.Create(phieuKiemKho);

                status = true;
                SetAlert("Đã Lưu Phiếu Kiểm Kho Thành Công!!!", "success");
            }
            else
            {
                status = false;
                SetAlert("Đã Xảy Ra Lỗi! Bạn Hãy Tạo Lại Phiếu Kiểm Kho", "error");
            }
            return(new JsonResult {
                Data = new { status = status }
            });
        }