예제 #1
0
 public ActionResult Create(IceHockeyTeam bt)
 {
     if (bt.WebName != null)
     {
         bt.WebName = bt.WebName.Replace("\r\n", ",");
     }
     bt.Display = true;
     bt.CreateDate = DateTime.Now;
     int c = _IIceHockeyTeamService.CreateTeam(bt);
     if (c > 0)
     {
         // TODO: Add insert logic here
         return RedirectToAction("Index", new { gameType = bt.GameType });
     }
     else
     {
         return RedirectToAction("Create", new { gameType = bt.GameType, sMsg = c == -1 ? "存在重複的隊伍名稱!" : "新增失敗!" });
     }
 }
예제 #2
0
 public ActionResult Edit(IceHockeyTeam bt)
 {
     if (bt.WebName!=null)
     {
         bt.WebName = bt.WebName.Replace("\r\n", ",");
     }
     int c = _IIceHockeyTeamService.EditTeam(bt);
     if (c > 0)
     {
         // TODO: Add insert logic here
         return RedirectToAction("Index", new { gameType = bt.GameType });
     }
     else
     {
         return RedirectToAction("Edit", new { teamID = bt.TeamID, sMsg = c == -1 ? "存在重複的隊伍名稱!" : "修改失敗!" });
     }
 }