Example #1
0
        public IEnumerable <shGoodReceiptIsuue> DanhSachPhieuXuatNhap(string TuNgay, string DenNgay, string TuKhoa, int?TrangThai, int?NguoiTao)
        {
            IEnumerable <shGoodReceiptIsuue> ds = DanhSachPhieuXuatNhap();

            if (TrangThai.HasValue)
            {
                ds = ds.Where(x => x.TrangThai == TrangThai);
            }

            if (NguoiTao.HasValue)
            {
                ds = ds.Where(x => x.UserId == NguoiTao);
            }

            DateTime _tungay  = new DateTime(1970, 1, 1);
            DateTime _denngay = DateTime.Now;

            if (!string.IsNullOrEmpty(TuNgay) || !string.IsNullOrWhiteSpace(TuNgay))
            {
                _tungay = TypeHelper.ToDate(TuNgay);
            }

            if (!string.IsNullOrEmpty(TuNgay) || !string.IsNullOrWhiteSpace(TuNgay))
            {
                _denngay = TypeHelper.ToDate(DenNgay);
            }

            ds = ds.Where(x => (TypeHelper.CompareDate(x.CreateDate.Value, _tungay) ||
                                TypeHelper.CompareDate(_denngay, x.CreateDate.Value)));

            shGoodReceiptIsuueService _receiptissue = new shGoodReceiptIsuueService();

            return(_receiptissue.FindList().Where(x => x.Status == true));
        }
Example #2
0
        public shGoodReceiptIsuue Insert_Update(
            string ReceiptIsuueGuid,
            int?ReceiptIssueId,
            int?Phieu,
            string ReceiptIsuueName,
            string SKU,
            int?MaKho,
            string TenKho,
            int?LoaiPhieu,
            string MaDonHang,
            string GhiChu,
            int?UserId,
            int?TrangThai,
            bool?Status,
            DateTime?CreateDate
            )
        {
            shGoodReceiptIsuueService _receipt = new shGoodReceiptIsuueService();
            shGoodReceiptIsuue        receipt  = new shGoodReceiptIsuue();

            if (!string.IsNullOrEmpty(ReceiptIsuueGuid) || !string.IsNullOrWhiteSpace(ReceiptIsuueGuid))
            {
                receipt = _receipt.FindByKey(ReceiptIsuueGuid);
            }
            else
            {
                receipt.ReceiptIsuueGuid = GuidUnique.getInstance().GenerateUnique();


                qtUnitService _unit   = new qtUnitService();
                string        _TenKho = _unit.UnitName(MaKho);
                if (string.IsNullOrEmpty(receipt.ReceiptIsuueName) && string.IsNullOrWhiteSpace(receipt.ReceiptIsuueName))
                {
                    receipt.ReceiptIsuueName = StringHelper.ToUnsignString(_TenKho) + "-" + receipt.CreateDate.GetValueOrDefault(DateTime.Now).ToString("dd-MM-yyyy");
                }
                receipt.TenKho = _TenKho;
            }


            receipt.Phieu = Phieu;

            receipt.SKU   = SKU;
            receipt.MaKho = MaKho;

            receipt.LoaiPhieu  = LoaiPhieu;
            receipt.MaDonHang  = MaDonHang;
            receipt.GhiChu     = GhiChu;
            receipt.UserId     = UserId;
            receipt.TrangThai  = TrangThai;
            receipt.Status     = Status;
            receipt.CreateDate = CreateDate;

            if (receipt.ReceiptIssueId > 0)
            {
                _receipt.Update(receipt);
            }
            else
            {
                _receipt.Insert(receipt);
            }

            return(receipt);
        }
Example #3
0
        public IEnumerable <shGoodReceiptIsuue> DanhSachPhieuXuatNhap()
        {
            shGoodReceiptIsuueService _receiptissue = new shGoodReceiptIsuueService();

            return(_receiptissue.FindList().Where(x => x.Status == true));
        }