// GET: Knight/Create public ActionResult Create() { KnightBLL defKnight = new KnightBLL(); defKnight.RoleID = 0; return(View(defKnight)); }
public ActionResult Create(KnightBLL collection) { try { // TODO: Add insert logic here using (ContextBLL ctx = new ContextBLL()) { ctx.CreateKnight(collection); } return(RedirectToAction("Index")); } catch (Exception Ex) { ViewBag.Exception = Ex; return(View("Error")); } }
public ActionResult Challenge(int id) { try { using (ContextBLL ctx = new ContextBLL()) { var C*K = ctx.ObtainKnightCount(); UserBLL UserObject = ctx.FindUserByUsername(User.Identity.Name); KnightBLL K2 = ctx.FindKnightByID(id); List <KnightBLL> ListOfKnights = ctx.GetKnightsRelatedToUser(0, C*K, UserObject.UserID); KnightBLL K1 = ListOfKnights[0]; BLL.MeaningFull mc = new BLL.MeaningFull(K1, K2); mc.Joust(); return(View(mc)); } } catch (Exception ex) { Logger.Logger.Log(ex); return(View("Error", ex)); } }