예제 #1
0
 public void UpdateGameType(GameType gameType)
 {
     context.Entry(gameType).State = EntityState.Modified;
 }
예제 #2
0
 public void CreateGameType(GameType gameType)
 {
     context.GameTypes.Add(gameType);
     context.SaveChanges();
 }
예제 #3
0
 public ActionResult NewGameType(GameType gameType, IEnumerable<HttpPostedFileBase> files)
 {
     db.CreateGameType(gameType);
     foreach (var file in files)
     {
         if (file.ContentLength > 0)
         {
             var fileName = Path.GetFileName(file.FileName);
             var path = Path.Combine(Server.MapPath("~/Games/" + gameType.gameTypeName), fileName);
             file.SaveAs(path);
         }
     }
     return RedirectToAction("Index");
 }