コード例 #1
0
        public IBOTerritories BOTerritories(ITerritoriesRepository repo)
        {
            BOTerritories boTerritories = (BOTerritories)BOTerritories();

            boTerritories.Repository = repo;
            return(boTerritories);
        }
コード例 #2
0
        public async Task <IHttpActionResult> DeleteTerritories(string id)
        {
            var result = Task.Factory.StartNew(() =>
            {
                IUnitOfWork uow = new UnitOfWorkImp(new IRepositoryConnection[] { TerritoriesRepository });
                var bo          = new BOTerritories();
                bo.Repository   = TerritoriesRepository;
                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 IBOTerritories BOTerritories()
        {
            var boTerritories = new BOTerritories()
            {
                TerritoryID          = this.TerritoryID,
                TerritoryDescription = this.TerritoryDescription,
                RegionID             = this.RegionID
            };

            return(boTerritories);
        }