Ejemplo n.º 1
0
        public InventoryService(IIOBalanceV2Repository <Product> product,
                                IIOBalanceV2Repository <BatchInventoryLog> batchInventoryLog)
        {
            this._product           = product;
            this._batchInventoryLog = batchInventoryLog;

            this.batchInventoryLog = new IOBalanceDBV2Entity.BatchInventoryLog();
            this.product           = new IOBalanceDBV2Entity.Product();
        }
Ejemplo n.º 2
0
        public long SaveBatchInvetoryLogs(BatchInventoryLogDto newDetails)
        {
            this.batchInventoryLog = newDetails.DtoToEntity();
            var insertedBatchInventoryLog = this._batchInventoryLog.Insert(this.batchInventoryLog);

            if (insertedBatchInventoryLog.IsNull())
            {
                return(0);
            }

            return(insertedBatchInventoryLog.BatchInventoryId);
        }
Ejemplo n.º 3
0
        public bool UpdateBatchInventoryLogs(long batchInventoryId, string resultMessage)
        {
            var oldDetails = GetAllBatchInventory().Where(b => b.BatchInventoryId == batchInventoryId).FirstOrDefault();

            oldDetails.ResultMessage = resultMessage;

            this.batchInventoryLog = new IOBalanceDBV2Entity.BatchInventoryLog();
            this.batchInventoryLog = oldDetails.DtoToEntity();
            if (this._batchInventoryLog.Update(this.batchInventoryLog, x => x.BatchInventoryId == batchInventoryId).IsNull())
            {
                return(false);
            }


            return(true);
        }
Ejemplo n.º 4
0
        public static IOBalanceDBV2Entity.BatchInventoryLog DtoToEntity(this BatchInventoryLogDto dto)
        {
            IOBalanceDBV2Entity.BatchInventoryLog entity = null;

            if (!dto.IsNull())
            {
                entity = new IOBalanceDBV2Entity.BatchInventoryLog
                {
                    BatchInventoryId = dto.BatchInventoryId,
                    CreatedBy        = dto.CreatedBy,
                    DateCreated      = dto.DateCreated,
                    FileName         = dto.FileName,
                    ResultMessage    = dto.ResultMessage
                };
            }

            return(entity);
        }