Ejemplo n.º 1
0
        public async Task <ActionResult> WorkerAdd(TestModel testModel)
        {
            if (testModel == null)
            {
                return(RedirectToAction("WorkerAdd", "TestView"));
            }


            using (DenemeDb db = new DenemeDb())
            {
                Worker worker = (Worker)testModel;

                db.Workers.Add(worker);
                await db.SaveChangesAsync();
            }

            return(RedirectToAction("Index", "TestView"));
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> MarketAdd(MarketAdded marketAdded)
        {
            if (marketAdded == null)
            {
                return(RedirectToAction("MarketAdd", "Market"));
            }


            using (DenemeDb db = new DenemeDb())
            {
                Market market = (Market)marketAdded;

                db.Markets.Add(market);
                await db.SaveChangesAsync();
            }

            return(RedirectToAction("Index", "Market"));
        }