Example #1
0
        public ActionResult Create([FromBody] StoreQueueViewModel vm)
        {
            var sq  = vm.ToStoreQueue();
            var res = _bo.Create(sq);

            return(res.Success ? Ok() : InternalServerError());
        }
        public void TestCreateAndReadStoreQueues()
        {
            ContextSeeder.Seed();
            var ebo       = new EstablishmentBusinessObject();
            var sbo       = new StoreQueueBusinessObject();
            var est       = ebo.List().Result.First();
            var reg       = new StoreQueue(2, est.Id);
            var resCreate = sbo.Create(reg);
            var resGet    = sbo.Read(reg.Id);

            Assert.IsTrue(resCreate.Success && resGet.Success && resGet.Result != null);
        }
        public void TestCreateAndReadStoreQueue()
        {
            ContextSeeder.Seed();
            var regBo = new RegionBusinessObject();
            var reg   = new Region("Algordos");

            regBo.Create(reg);
            var compBo = new CompanyBusinessObject();
            var comp   = new Company("", 1234567890);

            compBo.Create(comp);
            var estBo = new EstablishmentBusinessObject();
            var est   = new Establishment("anywhere", "sempre", "nunca", "8ยบ dia da semana", reg.Id, comp.Id);

            estBo.Create(est);
            var bo         = new StoreQueueBusinessObject();
            var stoQ       = new StoreQueue(32, est.Id);
            var stoQCreate = bo.Create(stoQ);
            var stoQGet    = bo.Read(stoQ.Id);

            Assert.IsTrue(stoQCreate.Success && stoQGet.Success && stoQGet.Result != null);
        }
Example #4
0
 public ActionResult Create([FromBody]StoreQueueViewModel vm)
 {
     var storeQueue = vm.ToStoreQueue();
     var res = _bo.Create(storeQueue);
     return StatusCode(res.Success ? (int)HttpStatusCode.OK : (int)HttpStatusCode.InternalServerError);
 }