Ejemplo n.º 1
0
 private Specialization GetRosteredSpecialization(RaidSignup signup)
 {
     var character = Character.Store.ReadOneOrDefault(c => c.Name == signup.Character);
     var specId = 1 == signup.RosteredSpecialization ? character.PrimarySpecialization : character.SecondarySpecialization;
     return Specialization.Store.ReadOneOrDefault(s => s.ID == specId);
 }
Ejemplo n.º 2
0
        public ActionResult NewSignup(int RaidInstanceID, string Character, string Comment)
        {
            if (!Manager.IsReallyAuthenticated(Request))
                return RedirectToAction("LogOn", "Account");

            var newSignup = new RaidSignup()
            {
                RaidInstanceID = RaidInstanceID,
                Character = Character,
                Comment = Comment,
                IsRostered = false,
                IsCancelled = false,
                RosteredSpecialization = 1,
                SignupDate = DateTime.Now
            };

            string errorMsg;

            if (!RaidSignup.Store.TryCreate(newSignup, out errorMsg))
                return new JsonResult() { Data = new RaidResponse(false, errorMsg) };

            return new JsonResult() { Data = new RaidResponse(true, "") };
        }