예제 #1
0
        public async Task <IActionResult> Create(StaffViewModel StaffViewModel)
        {
            if (ModelState.IsValid)
            {
                await context.Staff.AddAsync(StaffViewModel.Staff);

                await context.SaveChangesAsync();

                cache.Clean();
                return(RedirectToAction("Index", "Staff"));
            }

            return(View(StaffViewModel));
        }
예제 #2
0
        public async Task <IActionResult> Create(CostsViewModel costsViewModel)
        {
            if (ModelState.IsValid)
            {
                await context.Costs.AddAsync(costsViewModel.Cost);

                await context.SaveChangesAsync();

                cache.Clean();
                return(RedirectToAction("Index", "Costs"));
            }

            return(View(costsViewModel));
        }
예제 #3
0
        public async Task <IActionResult> Create(GsmViewModel gsmViewModel)
        {
            if (ModelState.IsValid)
            {
                await context.Gsm.AddAsync(gsmViewModel.Gsm);

                await context.SaveChangesAsync();

                cache.Clean();
                return(RedirectToAction("Index", "Gsm"));
            }

            return(View(gsmViewModel));
        }