Exemplo 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();
     }
 }
Exemplo n.º 2
0
 internal static async Task CreateMakeAsync(Models.Make make)
 {
     using (ApplicationDbContext context = new ApplicationDbContext())
     {
         context.Make.Add(make);
         await context.SaveChangesAsync();
     }
 }
Exemplo 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));
        }
Exemplo 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));
        }
Exemplo 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));
        }
Exemplo n.º 6
0
 public async Task EditMake(Models.Make make)
 {
     await DomainLogic.Make.Make.EditMakeAsync(make);
 }
Exemplo n.º 7
0
 public async Task CreateMake(Models.Make make)
 {
     await DomainLogic.Make.Make.CreateMakeAsync(make);
 }