Example #1
0
        private bool SaveProductBulk(List <BatchProductLogDto> dtoList, long batchNo)
        {
            List <IOBalanceEntity.BatchProductLog> listBatchProductLog = new List <BatchProductLog>();

            if (dtoList.Count == 0)
            {
                return(false);
            }

            foreach (var item in dtoList)
            {
                this.batchProductLog = new BatchProductLog();
                item.BatchNo         = batchNo;
                item.UploadStatus    = Globals.Pending.ToUpper();
                this.batchProductLog = item.DtoToEntity();
                listBatchProductLog.Add(this.batchProductLog);
            }


            if (listBatchProductLog.Count == 0 || !_batchProductLog.BulkInsert(listBatchProductLog))
            {
                return(false);
            }
            return(true);
        }
        public static IOBalanceEntity.BatchProductLog DtoToEntity(this BatchProductLogDto dto)
        {
            IOBalanceEntity.BatchProductLog entity = null;

            if (!dto.IsNull())
            {
                entity = new IOBalanceEntity.BatchProductLog
                {
                    RecID          = dto.RecID,
                    BatchNo        = dto.BatchNo,
                    ProductID      = dto.ProductID,
                    BranchName     = dto.BranchName,
                    CategoryCode   = dto.CategoryCode,
                    CategoryName   = dto.CategoryName,
                    ProductCode    = dto.ProductCode,
                    ProductName    = dto.ProductName,
                    Extension      = dto.Extension,
                    Quantity       = dto.Quantity,
                    OriginalPrice  = dto.OriginalPrice,
                    Price          = dto.Price,
                    Size           = dto.Size,
                    BarCode        = dto.BarCode,
                    SupplierCode   = dto.SupplierCode,
                    SupplierName   = dto.SupplierName,
                    Description    = dto.Description,
                    Remarks        = dto.Remarks,
                    UploadStatus   = dto.UploadStatus,
                    UploadRemarks  = dto.UploadRemarks,
                    StartProcessed = System.DateTime.Now,
                    EndProcessed   = dto.EndProcessed
                };
            }

            return(entity);
        }
Example #3
0
        public InventoryService(IIOBalanceRepository <Product> product,
                                IIOBalanceRepository <BatchSummary> batchSummary,
                                IIOBalanceRepository <BatchProductLog> batchProductLog)
        {
            this._product         = product;
            this._batchSummary    = batchSummary;
            this._batchProductLog = batchProductLog;

            this.product             = new Product();
            this.purchaseOrder       = new PurchaseOrder();
            this.purchaseOrderDetail = new PurchaseOrderDetail();
            this.batchSummary        = new BatchSummary();
            this.batchProductLog     = new BatchProductLog();
        }