Пример #1
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);
            }
        }
Пример #2
0
 public OrdersVm(IBOOrders boOrders)
 {
     OrderID        = boOrders.OrderID;
     CustomerID     = boOrders.CustomerID;
     EmployeeID     = boOrders.EmployeeID;
     OrderDate      = boOrders.OrderDate;
     RequiredDate   = boOrders.RequiredDate;
     ShippedDate    = boOrders.ShippedDate;
     ShipVia        = boOrders.ShipVia;
     Freight        = boOrders.Freight;
     ShipName       = boOrders.ShipName;
     ShipAddress    = boOrders.ShipAddress;
     ShipCity       = boOrders.ShipCity;
     ShipRegion     = boOrders.ShipRegion;
     ShipPostalCode = boOrders.ShipPostalCode;
     ShipCountry    = boOrders.ShipCountry;
 }
Пример #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);
            }
        }
Пример #4
0
 public OrdersVm(IBOOrders boOrders)
 {
     İd                = boOrders.İd;
     Employeeİd        = boOrders.Employeeİd;
     Customerİd        = boOrders.Customerİd;
     OrderDate         = boOrders.OrderDate;
     ShippedDate       = boOrders.ShippedDate;
     Shipperİd         = boOrders.Shipperİd;
     ShipName          = boOrders.ShipName;
     ShipAddress       = boOrders.ShipAddress;
     ShipCity          = boOrders.ShipCity;
     ShipStateProvince = boOrders.ShipStateProvince;
     ShipZipPostalCode = boOrders.ShipZipPostalCode;
     ShipCountryRegion = boOrders.ShipCountryRegion;
     ShippingFee       = boOrders.ShippingFee;
     Taxes             = boOrders.Taxes;
     PaymentType       = boOrders.PaymentType;
     PaidDate          = boOrders.PaidDate;
     Notes             = boOrders.Notes;
     TaxRate           = boOrders.TaxRate;
     TaxStatusİd       = boOrders.TaxStatusİd;
     Statusİd          = boOrders.Statusİd;
 }