private SourcingDocument Map(tblSourcingDocument tbldoc)
        {
            SourcingDocument doc = null;
            doc = new CommodityStorageNote(tbldoc.Id);
            _Map(tbldoc, doc);
            CommodityStorageNote storageNote = doc as CommodityStorageNote;
            storageNote._SetLineItems(tbldoc.tblSourcingLineItem.Select(MapCommodityStorageLineItem).ToList());
            doc = storageNote;
            return doc;

        }
 private ReceivedDeliveryNote MapPendingStorage(tblSourcingDocument tbldoc)
 {
     ReceivedDeliveryNote doc = null;
     doc = PrivateConstruct<ReceivedDeliveryNote>(tbldoc.Id);
     doc.DisableAddCommands();
     var receivedDeliveryNote = doc as ReceivedDeliveryNote;
     tbldoc.tblSourcingLineItem.Where(x => x.LineItemStatusId != (int)SourcingLineItemStatus.Stored).Select(MapLineItem).ToList().ForEach(s => receivedDeliveryNote.AddLineItem(s));
     doc = receivedDeliveryNote;
     _Map(tbldoc, doc);
     doc.EnableAddCommands();
     return doc;
 }
 private SourcingDocument Map(tblSourcingDocument tbldoc)
 {
     SourcingDocument doc = null;
     doc = PrivateConstruct<ReceivedDeliveryNote>(tbldoc.Id);
     doc.DisableAddCommands();
     var receivedDeliveryNote = doc as ReceivedDeliveryNote;
     tbldoc.tblSourcingLineItem.Select(MapLineItem).ToList().ForEach(s => receivedDeliveryNote.AddLineItem(s));
     doc = receivedDeliveryNote;
     _Map(tbldoc, doc);
     doc.EnableAddCommands();
     return doc;
 }
        private SourcingDocument Map(tblSourcingDocument tbldoc)
        {
            SourcingDocument doc = null;
            doc = new CommodityReceptionNote(tbldoc.Id);
            doc.DisableAddCommands();
            CommodityReceptionNote receptionNote = doc as CommodityReceptionNote;
            receptionNote._SetLineItems(tbldoc.tblSourcingLineItem.Select(MapCommodityReceptionLineItem).ToList());
            doc = receptionNote;
            _Map(tbldoc, doc);
            doc.EnableAddCommands();
            return doc;

        }
        private SourcingDocument Map(tblSourcingDocument tbldoc)
        {
            SourcingDocument doc = null;
            doc = new CommodityTransferNote(tbldoc.Id);
            _Map(tbldoc, doc);
            var transferNote = doc as CommodityTransferNote;
            if (tbldoc.DocumentTypeId2 != null )
                transferNote.TransferNoteTypeId = (CommodityTransferNote.CommodityTransferNoteTypeId) tbldoc.DocumentTypeId2;
            transferNote.WareHouseToStore = tbldoc.DocumentOnBehalfOfCostCentreId.HasValue ? _storeRepository.GetById(tbldoc.DocumentOnBehalfOfCostCentreId.Value) : null;
            transferNote._SetLineItems(tbldoc.tblSourcingLineItem.Select(MapCommodityStorageLineItem).ToList());
            doc = transferNote;
            return doc;

        }
        private SourcingDocument Map(tblSourcingDocument tbldoc)
        {
            SourcingDocument doc = null;
            doc = PrivateConstruct<CommodityReleaseNote>(tbldoc.Id);
            doc.DisableAddCommands();

            CommodityReleaseNote releaseNote = doc as CommodityReleaseNote;
            tbldoc.tblSourcingLineItem.Select(MapCommodityReleaseLineItem).ToList().ForEach(s => releaseNote.AddLineItem(s));
            doc = releaseNote;
            _Map(tbldoc, doc);
            doc.EnableAddCommands();
            return doc;

        }
        private SourcingDocument Map(tblSourcingDocument tbldoc)
        {
            SourcingDocument doc = null;
            doc = new CommodityPurchaseNote(tbldoc.Id);
            _Map(tbldoc, doc);
            CommodityPurchaseNote purchaseNote = doc as CommodityPurchaseNote;
            purchaseNote.CommodityOwner = _commodityOwnerRepository.GetById(tbldoc.CommodityOwnerId);
            if (tbldoc.CommodityProducerId != null)
                purchaseNote.CommodityProducer = _commodityProducerRepository.GetById(tbldoc.CommodityProducerId.Value);
            if (tbldoc.DocumentOnBehalfOfCostCentreId != null)
                purchaseNote.CommoditySupplier =
                    _costCentreRepository.GetById(tbldoc.DocumentOnBehalfOfCostCentreId.Value) as CommoditySupplier;
            purchaseNote.DeliveredBy = tbldoc.DeliveredBy;
            purchaseNote._SetLineItems(tbldoc.tblSourcingLineItem.Select(MapCommodityPurchaseLineItem).ToList());
            doc = purchaseNote;
            return doc;

        }
       /* public List<SourcingDocument> Query(string query)
        {
           // DateTime dfrom = new DateTime(startDate.Year, startDate.Month, startDate.Day, 00, 00, 00, 000);
           // DateTime dto = new DateTime(endDate.Year, endDate.Month, endDate.Day, 23, 59, 59, 999);
            return documents.Where(s => s.IM_DateCreated >= dfrom && s.IM_DateCreated <= dto).OrderByDescending(n => n.DocumentDate).Select(Map).ToList();
        }*/

        private SourcingDocument Map(tblSourcingDocument tbldoc)
        {
            SourcingDocument doc = null;
            doc = PrivateConstruct<CommodityDeliveryNote>(tbldoc.Id);
            doc.DisableAddCommands();
           
            
            CommodityDeliveryNote deliveryNote = doc as CommodityDeliveryNote;
            deliveryNote.DriverName = tbldoc.DriverName;
            deliveryNote.VehiclRegNo = tbldoc.VehicleRegNo;
            if (tbldoc.RouteId != null) deliveryNote.RouteId = tbldoc.RouteId.Value;
            if (tbldoc.CentreId != null) deliveryNote.CentreId = tbldoc.CentreId.Value;
            tbldoc.tblSourcingLineItem.Select(MapLineItem).ToList().ForEach(s=>deliveryNote.AddLineItem(s));
            doc = deliveryNote;
            _Map(tbldoc, doc);
            doc.EnableAddCommands();
            return doc;

        }
示例#9
0
        private tblSourcingDocument _NewDocument(Guid documentId,
            DocumentType documentType,
            Guid documentIssuerCostCentreId,
            Guid documentIssuerUserId,
            Guid documentIssuerCostCentreApplicationId,
            DateTime documentDateIssued,
            DocumentStatus documentStatus,
            string documentReference,
            DateTime sendDateTime,
            Guid documentRecipientCostCentreId,
             Guid documentparentId

           
            )
        {
            var doc = new tblSourcingDocument
                {
                    Id = documentId,
                    DocumentIssuerCostCentreId = documentIssuerCostCentreId,
                    DocumentIssuerUserId = documentIssuerUserId,
                    DocumentRecipientCostCentreId = documentRecipientCostCentreId,
                    DocumentTypeId = (int) documentType,
                    DocumentDate = documentDateIssued,
                    DocumentStatusId = (int) documentStatus,
                    DocumentReference = documentReference,
                    IM_DateCreated = DateTime.Now,
                    DocumentIssuerCostCentreApplicationId = documentIssuerCostCentreApplicationId,
                    DateIssued = DateTime.Now,
                    DocumentParentId = documentparentId,
                    DateSent = sendDateTime.Equals(new DateTime()) ? DateTime.Now : sendDateTime,
                  
                };
            if (sendDateTime.ToString("dd/MM/yyyy") == "01/01/0001")
            {
                doc.DateSent = DateTime.Now;
            }
            doc.IM_DateLastUpdated = DateTime.Now;
            
            return doc;
        }
        private SourcingDocument Map(tblSourcingDocument tbldoc)
        {
            SourcingDocument doc = null;
            doc = PrivateConstruct<CommodityWarehouseStorageNote>(tbldoc.Id);
            doc.DisableAddCommands();


            CommodityWarehouseStorageNote commodityWarehouseStorageNote = doc as CommodityWarehouseStorageNote;
            if (commodityWarehouseStorageNote != null)
            {
                commodityWarehouseStorageNote.DriverName = tbldoc.DriverName;
                commodityWarehouseStorageNote.VehiclRegNo = tbldoc.VehicleRegNo;
                commodityWarehouseStorageNote.CommodityOwnerId = tbldoc.CommodityOwnerId;
                if (tbldoc.RouteId != null) commodityWarehouseStorageNote.RouteId = tbldoc.RouteId.Value;
                if (tbldoc.CentreId != null) commodityWarehouseStorageNote.CentreId = tbldoc.CentreId.Value;
                tbldoc.tblSourcingLineItem.Select(MapLineItem).ToList().ForEach(s => commodityWarehouseStorageNote.AddLineItem(s));
                doc = commodityWarehouseStorageNote;
            }
            _Map(tbldoc, doc);
            doc.EnableAddCommands();
            return doc;

        }
示例#11
0
 /// <summary>
 /// Create a new tblSourcingDocument object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="documentTypeId">Initial value of the DocumentTypeId property.</param>
 /// <param name="documentStatusId">Initial value of the DocumentStatusId property.</param>
 /// <param name="documentIssuerCostCentreId">Initial value of the DocumentIssuerCostCentreId property.</param>
 /// <param name="documentIssuerUserId">Initial value of the DocumentIssuerUserId property.</param>
 /// <param name="documentRecipientCostCentreId">Initial value of the DocumentRecipientCostCentreId property.</param>
 /// <param name="commodityOwnerId">Initial value of the CommodityOwnerId property.</param>
 /// <param name="dateIssued">Initial value of the DateIssued property.</param>
 /// <param name="documentDate">Initial value of the DocumentDate property.</param>
 /// <param name="dateSent">Initial value of the DateSent property.</param>
 /// <param name="iM_DateCreated">Initial value of the IM_DateCreated property.</param>
 /// <param name="iM_DateLastUpdated">Initial value of the IM_DateLastUpdated property.</param>
 /// <param name="iM_Status">Initial value of the IM_Status property.</param>
 public static tblSourcingDocument CreatetblSourcingDocument(global::System.Guid id, global::System.Int32 documentTypeId, global::System.Int32 documentStatusId, global::System.Guid documentIssuerCostCentreId, global::System.Guid documentIssuerUserId, global::System.Guid documentRecipientCostCentreId, global::System.Guid commodityOwnerId, global::System.DateTime dateIssued, global::System.DateTime documentDate, global::System.DateTime dateSent, global::System.DateTime iM_DateCreated, global::System.DateTime iM_DateLastUpdated, global::System.Int32 iM_Status)
 {
     tblSourcingDocument tblSourcingDocument = new tblSourcingDocument();
     tblSourcingDocument.Id = id;
     tblSourcingDocument.DocumentTypeId = documentTypeId;
     tblSourcingDocument.DocumentStatusId = documentStatusId;
     tblSourcingDocument.DocumentIssuerCostCentreId = documentIssuerCostCentreId;
     tblSourcingDocument.DocumentIssuerUserId = documentIssuerUserId;
     tblSourcingDocument.DocumentRecipientCostCentreId = documentRecipientCostCentreId;
     tblSourcingDocument.CommodityOwnerId = commodityOwnerId;
     tblSourcingDocument.DateIssued = dateIssued;
     tblSourcingDocument.DocumentDate = documentDate;
     tblSourcingDocument.DateSent = dateSent;
     tblSourcingDocument.IM_DateCreated = iM_DateCreated;
     tblSourcingDocument.IM_DateLastUpdated = iM_DateLastUpdated;
     tblSourcingDocument.IM_Status = iM_Status;
     return tblSourcingDocument;
 }
示例#12
0
 /// <summary>
 /// Deprecated Method for adding a new object to the tblSourcingDocument EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTotblSourcingDocument(tblSourcingDocument tblSourcingDocument)
 {
     base.AddObject("tblSourcingDocument", tblSourcingDocument);
 }