예제 #1
0
 public ActionResult Edit([Bind(Include = "Id,Name,Description")] Company company)
 {
     if (ModelState.IsValid)
     {
         db.Entry(company).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(company));
 }
예제 #2
0
 public ActionResult Edit([Bind(Include = "AppId,AppName")] App app)
 {
     if (ModelState.IsValid)
     {
         db.Entry(app).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(app));
 }
예제 #3
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,Name,Price")] Job job)
        {
            if (ModelState.IsValid)
            {
                db.Entry(job).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(job));
        }
예제 #4
0
 public ActionResult Edit([Bind(Include = "JobId,Time,Day,Success,Files_DwUp,Files_Sorted,AppId")] Job job)
 {
     if (ModelState.IsValid)
     {
         db.Entry(job).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AppId = new SelectList(db.Apps, "AppId", "AppName", job.AppId);
     return(View(job));
 }