예제 #1
0
        public IBOPurchaseOrders BOPurchaseOrders(IPurchaseOrdersRepository repo)
        {
            BOPurchaseOrders boPurchaseOrders = (BOPurchaseOrders)BOPurchaseOrders();

            boPurchaseOrders.Repository = repo;
            return(boPurchaseOrders);
        }
        public async Task <IHttpActionResult> DeletePurchaseOrders(string id)
        {
            var result = Task.Factory.StartNew(() =>
            {
                IUnitOfWork uow = new UnitOfWorkImp(new IRepositoryConnection[] { PurchaseOrdersRepository });
                var bo          = new BOPurchaseOrders();
                bo.Repository   = PurchaseOrdersRepository;
                bo.Init(id);

                uow.Delete(bo);

                string err;
                if (!uow.Commit(out err))
                {
                    var resp = new HttpResponseMessage(HttpStatusCode.BadRequest)
                    {
                        Content = new StringContent(err)
                    };
                    throw new HttpResponseException(resp);
                }
                return(true);
            });
            await result;

            if (!result.Result)
            {
                return(NotFound());
            }

            return(Ok(result.Result));
        }
예제 #3
0
        public IBOPurchaseOrders BOPurchaseOrders()
        {
            var boPurchaseOrders = new BOPurchaseOrders()
            {
                İd            = this.İd,
                Supplierİd    = this.Supplierİd,
                CreatedBy     = this.CreatedBy,
                SubmittedDate = this.SubmittedDate,
                CreationDate  = this.CreationDate,
                Statusİd      = this.Statusİd,
                ExpectedDate  = this.ExpectedDate,
                ShippingFee   = this.ShippingFee,
                Taxes         = this.Taxes,
                PaymentDate   = this.PaymentDate,
                PaymentAmount = this.PaymentAmount,
                PaymentMethod = this.PaymentMethod,
                Notes         = this.Notes,
                ApprovedBy    = this.ApprovedBy,
                ApprovedDate  = this.ApprovedDate,
                SubmittedBy   = this.SubmittedBy
            };

            return(boPurchaseOrders);
        }