Пример #1
0
 public void Update(OutRequest outRequest, IList <Stock> updateStocks, IList <Stock> removeStocks, IList <Detail> newDetails,
                    IList <Detail> removeDetails, IList <Detail> updateDetails)
 {
     _outRequestRepository.Update(outRequest);
     foreach (var detail in updateDetails)
     {
         detail.OutRequestId = outRequest.Id;
         _detailRepository.Update(detail);
     }
     foreach (var detail in newDetails)
     {
         detail.OutRequestId = outRequest.Id;
         _detailRepository.Insert(detail);
     }
     foreach (var detail in removeDetails)
     {
         detail.OutRequestId = outRequest.Id;
         _detailRepository.Update(detail);
     }
     foreach (var stock in updateStocks)
     {
         _stockRepository.Update(stock);
     }
     foreach (var stock in removeStocks)
     {
         _stockRepository.Update(stock);
     }
 }
        public static OutRequest Create(int requestNumber, string requestDocumentNumber, string description, string notes, Guid?projectId,
                                        Guid?cellarId, DateTime?dueDate, OutRequestStatus status, TypeOutRequest typeOutRequest,
                                        Guid personInCharge, string deliveredTo, Guid?contractorId,
                                        Guid creatorid, DateTime createDateTime, string companyName, string comment, string departa, string depreciableCost)
        {
            var @outRequest = new OutRequest
            {
                Id                    = Guid.NewGuid(),
                RequestNumber         = requestNumber,
                RequestDocumentNumber = requestDocumentNumber,
                Description           = description,
                Notes                 = notes,
                ProjectId             = projectId,
                CellarId              = cellarId,
                AssetsReturnDate      = dueDate,
                DeliverDate           = dueDate,
                Status                = status,
                TypeOutRequest        = typeOutRequest,
                CreationTime          = createDateTime,
                CreatorUserId         = creatorid,
                Comment               = comment,
                ResponsiblePersonId   = personInCharge,
                DeliveredTo           = deliveredTo,
                ContractorId          = contractorId,
                CompanyName           = companyName,
                IsDeleted             = false,
                IsDelayed             = false,
                Department            = departa,
                DepreciableCost       = depreciableCost
            };

            return(@outRequest);
        }
Пример #3
0
 public void Create(OutRequest outRequest, IList <Stock> stocks, IList <Detail> details)
 {
     _outRequestRepository.Insert(outRequest);
     foreach (var detail in details)
     {
         _detailRepository.Insert(detail);
     }
     foreach (var stock in stocks)
     {
         _stockRepository.Update(stock);
     }
 }
Пример #4
0
 public void Delete(OutRequest outRequest, IList <Stock> stocks, IList <Detail> details)
 {
     _outRequestRepository.Update(outRequest);
     foreach (var detail in details)
     {
         detail.OutRequestId = outRequest.Id;
         _detailRepository.Update(detail);
     }
     foreach (var stock in stocks)
     {
         _stockRepository.Update(stock);
     }
 }
Пример #5
0
 public void CloseRequest(OutRequest outRequest, IList <Stock> updateStocks, IList <Movement> movements, IList <Detail> updateDetails)
 {
     _outRequestRepository.Update(outRequest);
     foreach (var item in updateDetails)
     {
         _detailRepository.Update(item);
     }
     foreach (var item in movements)
     {
         _movementRepository.Insert(item);
     }
     foreach (var stock in updateStocks)
     {
         _stockRepository.Update(stock);
     }
 }
Пример #6
0
 public void CreateWithMovements(OutRequest outRequest, IList <Stock> stocks, IList <Detail> details, IList <Movement> movements)
 {
     _outRequestRepository.Insert(outRequest);
     foreach (var detail in details)
     {
         detail.OutRequestId = outRequest.Id;
         _detailRepository.Insert(detail);
     }
     foreach (var stock in stocks)
     {
         _stockRepository.Update(stock);
     }
     foreach (var item in movements)
     {
         _movementRepository.Insert(item);
     }
 }
Пример #7
0
 public void ChangeStatus(OutRequest outRequest, IList <Stock> updateStocks, IList <Stock> removeStocks, IList <Detail> updateDetails, IList <Movement> movements)
 {
     _outRequestRepository.Update(outRequest);
     foreach (var detail in updateDetails)
     {
         detail.OutRequestId = outRequest.Id;
         _detailRepository.Update(detail);
     }
     foreach (var item in movements)
     {
         item.OutRequestId = outRequest.Id;
         _movementRepository.Insert(item);
     }
     foreach (var stock in updateStocks)
     {
         _stockRepository.Update(stock);
     }
     foreach (var stock in removeStocks)
     {
         _stockRepository.Update(stock);
     }
 }