Exemplo n.º 1
0
        ///<Summary>
        ///SaveNew
        ///This method persists a new Orders record to the store
        ///</Summary>
        ///<returns>
        ///void
        ///</returns>
        ///<parameters>
        ///
        ///</parameters>
        public virtual void SaveNew()
        {
            Doing(this);
            IDAOOrders daoOrders = _iOrdersRepository.New();

            RegisterDataObject(_iOrdersRepository, _iOrdersRepository.BaseData(daoOrders));
            BeginTransaction(_iOrdersRepository, "savenewBOOrders");
            try
            {
                daoOrders.CustomerID     = _customerID;
                daoOrders.EmployeeID     = _employeeID;
                daoOrders.OrderDate      = _orderDate;
                daoOrders.RequiredDate   = _requiredDate;
                daoOrders.ShippedDate    = _shippedDate;
                daoOrders.ShipVia        = _shipVia;
                daoOrders.Freight        = _freight;
                daoOrders.ShipName       = _shipName;
                daoOrders.ShipAddress    = _shipAddress;
                daoOrders.ShipCity       = _shipCity;
                daoOrders.ShipRegion     = _shipRegion;
                daoOrders.ShipPostalCode = _shipPostalCode;
                daoOrders.ShipCountry    = _shipCountry;
                _iOrdersRepository.Insert(daoOrders);
                CommitTransaction(_iOrdersRepository);
                Done(this);

                _orderID        = daoOrders.OrderID;
                _customerID     = daoOrders.CustomerID;
                _employeeID     = daoOrders.EmployeeID;
                _orderDate      = daoOrders.OrderDate;
                _requiredDate   = daoOrders.RequiredDate;
                _shippedDate    = daoOrders.ShippedDate;
                _shipVia        = daoOrders.ShipVia;
                _freight        = daoOrders.Freight;
                _shipName       = daoOrders.ShipName;
                _shipAddress    = daoOrders.ShipAddress;
                _shipCity       = daoOrders.ShipCity;
                _shipRegion     = daoOrders.ShipRegion;
                _shipPostalCode = daoOrders.ShipPostalCode;
                _shipCountry    = daoOrders.ShipCountry;
                _ctrVersion     = daoOrders.CtrVersion;
                _isDirty        = false;
            }
            catch (Exception ex)
            {
                Failed(this, ex);
                RollbackTransaction(_iOrdersRepository, "savenewBOOrders");
                Handle(this, ex);
            }
        }
Exemplo n.º 2
0
        ///<Summary>
        ///AddOrders
        ///This method persists a BOOrders object to the database collection
        ///</Summary>
        ///<returns>
        ///void
        ///</returns>
        ///<parameters>
        ///BOOrders
        ///</parameters>
        public virtual void AddOrders(IBOOrders boOrders)
        {
            Doing(this);
            IDAOOrders daoOrders = _iOrdersRepository.New();

            RegisterDataObject(_iOrdersRepository, _iOrdersRepository.BaseData(daoOrders));
            BeginTransaction(_iOrdersRepository, "addOrders");
            try
            {
                daoOrders.İd                = boOrders.İd;
                daoOrders.Employeeİd        = boOrders.Employeeİd;
                daoOrders.OrderDate         = boOrders.OrderDate;
                daoOrders.ShippedDate       = boOrders.ShippedDate;
                daoOrders.Shipperİd         = boOrders.Shipperİd;
                daoOrders.ShipName          = boOrders.ShipName;
                daoOrders.ShipAddress       = boOrders.ShipAddress;
                daoOrders.ShipCity          = boOrders.ShipCity;
                daoOrders.ShipStateProvince = boOrders.ShipStateProvince;
                daoOrders.ShipZipPostalCode = boOrders.ShipZipPostalCode;
                daoOrders.ShipCountryRegion = boOrders.ShipCountryRegion;
                daoOrders.ShippingFee       = boOrders.ShippingFee;
                daoOrders.Taxes             = boOrders.Taxes;
                daoOrders.PaymentType       = boOrders.PaymentType;
                daoOrders.PaidDate          = boOrders.PaidDate;
                daoOrders.Notes             = boOrders.Notes;
                daoOrders.TaxRate           = boOrders.TaxRate;
                daoOrders.TaxStatusİd       = boOrders.TaxStatusİd;
                daoOrders.Statusİd          = boOrders.Statusİd;
                daoOrders.Customerİd        = _id;
                _iOrdersRepository.Insert(daoOrders);
                CommitTransaction(_iOrdersRepository);
                Done(this);

                /*pick up any primary keys, computed values etc*/
                boOrders = new BOOrders(daoOrders);
                if (_boOrdersCollection != null)
                {
                    _boOrdersCollection.Add(boOrders);
                }
            }
            catch (Exception ex)
            {
                Failed(this, ex);
                RollbackTransaction(_iOrdersRepository, "addOrders");
                Handle(this, ex);
            }
        }
Exemplo n.º 3
0
        ///<Summary>
        ///AddOrders
        ///This method persists a BOOrders object to the database collection
        ///</Summary>
        ///<returns>
        ///void
        ///</returns>
        ///<parameters>
        ///BOOrders
        ///</parameters>
        public virtual void AddOrders(IBOOrders boOrders)
        {
            Doing(this);
            IDAOOrders daoOrders = _iOrdersRepository.New();

            RegisterDataObject(_iOrdersRepository, _iOrdersRepository.BaseData(daoOrders));
            BeginTransaction(_iOrdersRepository, "addOrders");
            try
            {
                daoOrders.OrderID        = boOrders.OrderID;
                daoOrders.EmployeeID     = boOrders.EmployeeID;
                daoOrders.OrderDate      = boOrders.OrderDate;
                daoOrders.RequiredDate   = boOrders.RequiredDate;
                daoOrders.ShippedDate    = boOrders.ShippedDate;
                daoOrders.ShipVia        = boOrders.ShipVia;
                daoOrders.Freight        = boOrders.Freight;
                daoOrders.ShipName       = boOrders.ShipName;
                daoOrders.ShipAddress    = boOrders.ShipAddress;
                daoOrders.ShipCity       = boOrders.ShipCity;
                daoOrders.ShipRegion     = boOrders.ShipRegion;
                daoOrders.ShipPostalCode = boOrders.ShipPostalCode;
                daoOrders.ShipCountry    = boOrders.ShipCountry;
                daoOrders.CustomerID     = _customerID;
                _iOrdersRepository.Insert(daoOrders);
                CommitTransaction(_iOrdersRepository);
                Done(this);

                /*pick up any primary keys, computed values etc*/
                boOrders = new BOOrders(daoOrders);
                if (_boOrdersCollection != null)
                {
                    _boOrdersCollection.Add(boOrders);
                }
            }
            catch (Exception ex)
            {
                Failed(this, ex);
                RollbackTransaction(_iOrdersRepository, "addOrders");
                Handle(this, ex);
            }
        }
Exemplo n.º 4
0
        ///<Summary>
        ///SaveNew
        ///This method persists a new Orders record to the store
        ///</Summary>
        ///<returns>
        ///void
        ///</returns>
        ///<parameters>
        ///
        ///</parameters>
        public virtual void SaveNew()
        {
            Doing(this);
            IDAOOrders daoOrders = _iOrdersRepository.New();

            RegisterDataObject(_iOrdersRepository, _iOrdersRepository.BaseData(daoOrders));
            BeginTransaction(_iOrdersRepository, "savenewBOOrders");
            try
            {
                daoOrders.Employeeİd        = _employeeİd;
                daoOrders.Customerİd        = _customerİd;
                daoOrders.OrderDate         = _orderDate;
                daoOrders.ShippedDate       = _shippedDate;
                daoOrders.Shipperİd         = _shipperİd;
                daoOrders.ShipName          = _shipName;
                daoOrders.ShipAddress       = _shipAddress;
                daoOrders.ShipCity          = _shipCity;
                daoOrders.ShipStateProvince = _shipStateProvince;
                daoOrders.ShipZipPostalCode = _shipZipPostalCode;
                daoOrders.ShipCountryRegion = _shipCountryRegion;
                daoOrders.ShippingFee       = _shippingFee;
                daoOrders.Taxes             = _taxes;
                daoOrders.PaymentType       = _paymentType;
                daoOrders.PaidDate          = _paidDate;
                daoOrders.Notes             = _notes;
                daoOrders.TaxRate           = _taxRate;
                daoOrders.TaxStatusİd       = _taxStatusİd;
                daoOrders.Statusİd          = _statusİd;
                _iOrdersRepository.Insert(daoOrders);
                CommitTransaction(_iOrdersRepository);
                Done(this);

                _id                = daoOrders.İd;
                _employeeİd        = daoOrders.Employeeİd;
                _customerİd        = daoOrders.Customerİd;
                _orderDate         = daoOrders.OrderDate;
                _shippedDate       = daoOrders.ShippedDate;
                _shipperİd         = daoOrders.Shipperİd;
                _shipName          = daoOrders.ShipName;
                _shipAddress       = daoOrders.ShipAddress;
                _shipCity          = daoOrders.ShipCity;
                _shipStateProvince = daoOrders.ShipStateProvince;
                _shipZipPostalCode = daoOrders.ShipZipPostalCode;
                _shipCountryRegion = daoOrders.ShipCountryRegion;
                _shippingFee       = daoOrders.ShippingFee;
                _taxes             = daoOrders.Taxes;
                _paymentType       = daoOrders.PaymentType;
                _paidDate          = daoOrders.PaidDate;
                _notes             = daoOrders.Notes;
                _taxRate           = daoOrders.TaxRate;
                _taxStatusİd       = daoOrders.TaxStatusİd;
                _statusİd          = daoOrders.Statusİd;
                _ctrVersion        = daoOrders.CtrVersion;
                _isDirty           = false;
            }
            catch (Exception ex)
            {
                Failed(this, ex);
                RollbackTransaction(_iOrdersRepository, "savenewBOOrders");
                Handle(this, ex);
            }
        }