Beispiel #1
0
        ///<Summary>
        ///SaveNew
        ///This method persists a new PurchaseOrders record to the store
        ///</Summary>
        ///<returns>
        ///void
        ///</returns>
        ///<parameters>
        ///
        ///</parameters>
        public virtual void SaveNew()
        {
            Doing(this);
            IDAOPurchaseOrders daoPurchaseOrders = _iPurchaseOrdersRepository.New();

            RegisterDataObject(_iPurchaseOrdersRepository, _iPurchaseOrdersRepository.BaseData(daoPurchaseOrders));
            BeginTransaction(_iPurchaseOrdersRepository, "savenewBOPurchaseOrders");
            try
            {
                daoPurchaseOrders.Supplierİd    = _supplierİd;
                daoPurchaseOrders.CreatedBy     = _createdBy;
                daoPurchaseOrders.SubmittedDate = _submittedDate;
                daoPurchaseOrders.CreationDate  = _creationDate;
                daoPurchaseOrders.Statusİd      = _statusİd;
                daoPurchaseOrders.ExpectedDate  = _expectedDate;
                daoPurchaseOrders.ShippingFee   = _shippingFee;
                daoPurchaseOrders.Taxes         = _taxes;
                daoPurchaseOrders.PaymentDate   = _paymentDate;
                daoPurchaseOrders.PaymentAmount = _paymentAmount;
                daoPurchaseOrders.PaymentMethod = _paymentMethod;
                daoPurchaseOrders.Notes         = _notes;
                daoPurchaseOrders.ApprovedBy    = _approvedBy;
                daoPurchaseOrders.ApprovedDate  = _approvedDate;
                daoPurchaseOrders.SubmittedBy   = _submittedBy;
                _iPurchaseOrdersRepository.Insert(daoPurchaseOrders);
                CommitTransaction(_iPurchaseOrdersRepository);
                Done(this);

                _id            = daoPurchaseOrders.İd;
                _supplierİd    = daoPurchaseOrders.Supplierİd;
                _createdBy     = daoPurchaseOrders.CreatedBy;
                _submittedDate = daoPurchaseOrders.SubmittedDate;
                _creationDate  = daoPurchaseOrders.CreationDate;
                _statusİd      = daoPurchaseOrders.Statusİd;
                _expectedDate  = daoPurchaseOrders.ExpectedDate;
                _shippingFee   = daoPurchaseOrders.ShippingFee;
                _taxes         = daoPurchaseOrders.Taxes;
                _paymentDate   = daoPurchaseOrders.PaymentDate;
                _paymentAmount = daoPurchaseOrders.PaymentAmount;
                _paymentMethod = daoPurchaseOrders.PaymentMethod;
                _notes         = daoPurchaseOrders.Notes;
                _approvedBy    = daoPurchaseOrders.ApprovedBy;
                _approvedDate  = daoPurchaseOrders.ApprovedDate;
                _submittedBy   = daoPurchaseOrders.SubmittedBy;
                _ctrVersion    = daoPurchaseOrders.CtrVersion;
                _isDirty       = false;
            }
            catch (Exception ex)
            {
                Failed(this, ex);
                RollbackTransaction(_iPurchaseOrdersRepository, "savenewBOPurchaseOrders");
                Handle(this, ex);
            }
        }
Beispiel #2
0
        ///<Summary>
        ///AddPurchaseOrders
        ///This method persists a BOPurchaseOrders object to the database collection
        ///</Summary>
        ///<returns>
        ///void
        ///</returns>
        ///<parameters>
        ///BOPurchaseOrders
        ///</parameters>
        public virtual void AddPurchaseOrders(IBOPurchaseOrders boPurchaseOrders)
        {
            Doing(this);
            IDAOPurchaseOrders daoPurchaseOrders = _iPurchaseOrdersRepository.New();

            RegisterDataObject(_iPurchaseOrdersRepository, _iPurchaseOrdersRepository.BaseData(daoPurchaseOrders));
            BeginTransaction(_iPurchaseOrdersRepository, "addPurchaseOrders");
            try
            {
                daoPurchaseOrders.İd            = boPurchaseOrders.İd;
                daoPurchaseOrders.CreatedBy     = boPurchaseOrders.CreatedBy;
                daoPurchaseOrders.SubmittedDate = boPurchaseOrders.SubmittedDate;
                daoPurchaseOrders.CreationDate  = boPurchaseOrders.CreationDate;
                daoPurchaseOrders.Statusİd      = boPurchaseOrders.Statusİd;
                daoPurchaseOrders.ExpectedDate  = boPurchaseOrders.ExpectedDate;
                daoPurchaseOrders.ShippingFee   = boPurchaseOrders.ShippingFee;
                daoPurchaseOrders.Taxes         = boPurchaseOrders.Taxes;
                daoPurchaseOrders.PaymentDate   = boPurchaseOrders.PaymentDate;
                daoPurchaseOrders.PaymentAmount = boPurchaseOrders.PaymentAmount;
                daoPurchaseOrders.PaymentMethod = boPurchaseOrders.PaymentMethod;
                daoPurchaseOrders.Notes         = boPurchaseOrders.Notes;
                daoPurchaseOrders.ApprovedBy    = boPurchaseOrders.ApprovedBy;
                daoPurchaseOrders.ApprovedDate  = boPurchaseOrders.ApprovedDate;
                daoPurchaseOrders.SubmittedBy   = boPurchaseOrders.SubmittedBy;
                daoPurchaseOrders.Supplierİd    = _id;
                _iPurchaseOrdersRepository.Insert(daoPurchaseOrders);
                CommitTransaction(_iPurchaseOrdersRepository);
                Done(this);

                /*pick up any primary keys, computed values etc*/
                boPurchaseOrders = new BOPurchaseOrders(daoPurchaseOrders);
                if (_boPurchaseOrdersCollection != null)
                {
                    _boPurchaseOrdersCollection.Add(boPurchaseOrders);
                }
            }
            catch (Exception ex)
            {
                Failed(this, ex);
                RollbackTransaction(_iPurchaseOrdersRepository, "addPurchaseOrders");
                Handle(this, ex);
            }
        }