示例#1
0
        ///<Summary>
        ///Addİnvoices
        ///This method persists a BOİnvoices object to the database collection
        ///</Summary>
        ///<returns>
        ///void
        ///</returns>
        ///<parameters>
        ///BOİnvoices
        ///</parameters>
        public virtual void Addİnvoices(IBOİnvoices boİnvoices)
        {
            Doing(this);
            IDAOİnvoices daoİnvoices = _iİnvoicesRepository.New();

            RegisterDataObject(_iİnvoicesRepository, _iİnvoicesRepository.BaseData(daoİnvoices));
            BeginTransaction(_iİnvoicesRepository, "addİnvoices");
            try
            {
                daoİnvoices.İd          = boİnvoices.İd;
                daoİnvoices.İnvoiceDate = boİnvoices.İnvoiceDate;
                daoİnvoices.DueDate     = boİnvoices.DueDate;
                daoİnvoices.Tax         = boİnvoices.Tax;
                daoİnvoices.Shipping    = boİnvoices.Shipping;
                daoİnvoices.AmountDue   = boİnvoices.AmountDue;
                daoİnvoices.Orderİd     = _id;
                _iİnvoicesRepository.Insert(daoİnvoices);
                CommitTransaction(_iİnvoicesRepository);
                Done(this);

                /*pick up any primary keys, computed values etc*/
                boİnvoices = new BOInvoices(daoİnvoices);
                if (_boİnvoicesCollection != null)
                {
                    _boİnvoicesCollection.Add(boİnvoices);
                }
            }
            catch (Exception ex)
            {
                Failed(this, ex);
                RollbackTransaction(_iİnvoicesRepository, "addİnvoices");
                Handle(this, ex);
            }
        }
示例#2
0
        ///<Summary>
        ///SaveNew
        ///This method persists a new İnvoices record to the store
        ///</Summary>
        ///<returns>
        ///void
        ///</returns>
        ///<parameters>
        ///
        ///</parameters>
        public virtual void SaveNew()
        {
            Doing(this);
            IDAOİnvoices daoİnvoices = _iİnvoicesRepository.New();

            RegisterDataObject(_iİnvoicesRepository, _iİnvoicesRepository.BaseData(daoİnvoices));
            BeginTransaction(_iİnvoicesRepository, "savenewBOİnvoices");
            try
            {
                daoİnvoices.Orderİd     = _orderİd;
                daoİnvoices.İnvoiceDate = _invoiceDate;
                daoİnvoices.DueDate     = _dueDate;
                daoİnvoices.Tax         = _tax;
                daoİnvoices.Shipping    = _shipping;
                daoİnvoices.AmountDue   = _amountDue;
                _iİnvoicesRepository.Insert(daoİnvoices);
                CommitTransaction(_iİnvoicesRepository);
                Done(this);

                _id          = daoİnvoices.İd;
                _orderİd     = daoİnvoices.Orderİd;
                _invoiceDate = daoİnvoices.İnvoiceDate;
                _dueDate     = daoİnvoices.DueDate;
                _tax         = daoİnvoices.Tax;
                _shipping    = daoİnvoices.Shipping;
                _amountDue   = daoİnvoices.AmountDue;
                _ctrVersion  = daoİnvoices.CtrVersion;
                _isDirty     = false;
            }
            catch (Exception ex)
            {
                Failed(this, ex);
                RollbackTransaction(_iİnvoicesRepository, "savenewBOİnvoices");
                Handle(this, ex);
            }
        }