Esempio n. 1
0
 internal async static Task EditMakeAsync(Models.Make make)
 {
     using (ApplicationDbContext context = new ApplicationDbContext())
     {
         context.Entry(make).State = System.Data.Entity.EntityState.Modified;
         await context.SaveChangesAsync();
     }
 }
Esempio n. 2
0
 internal static async Task CreateMakeAsync(Models.Make make)
 {
     using (ApplicationDbContext context = new ApplicationDbContext())
     {
         context.Make.Add(make);
         await context.SaveChangesAsync();
     }
 }
Esempio n. 3
0
        public async Task <ActionResult> Edit(Guid?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Models.Make make = await _make.GetMake((Guid)id);

            if (make == null)
            {
                return(HttpNotFound());
            }
            return(View(make));
        }
Esempio n. 4
0
        public async Task <ActionResult> Edit(Models.Make make)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    await _make.EditMake(make);

                    return(RedirectToAction("Index"));
                }
                catch (Exception)
                {
                    throw;
                }
            }
            return(View(make));
        }
Esempio n. 5
0
        public async Task <ActionResult> Create(Models.Make make)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    make.Id = Guid.NewGuid();
                    await _make.CreateMake(make);

                    return(RedirectToAction("Index"));
                }
                catch (Exception)
                {
                    throw;
                }
            }

            return(View(make));
        }
Esempio n. 6
0
 public async Task EditMake(Models.Make make)
 {
     await DomainLogic.Make.Make.EditMakeAsync(make);
 }
Esempio n. 7
0
 public async Task CreateMake(Models.Make make)
 {
     await DomainLogic.Make.Make.CreateMakeAsync(make);
 }