/// <summary> /// Creates a new move and saves it to the database /// </summary> /// <param name="characterId"></param> /// <param name="startUp"></param> /// <param name="active"></param> /// <param name="recovery"></param> /// <param name="onBlock"></param> /// <param name="onHit"></param> /// <param name="damage"></param> /// <param name="stun"></param> /// <param name="movePicture"></param> public void CreateMove(int characterId, string moveName, int startUp, int active, int recovery, int onBlock, int onHit, int damage, int stun, string movePicture) { var newMove = new Move() { CharacterId = characterId, MoveName = moveName, StartUp = startUp, Active = active, Recovery = recovery, OnBlock = onBlock, OnHit = onHit, Damage = damage, Stun = stun, MovePicture = movePicture, }; using var db = new FrameDataContext(); db.Add(newMove); db.SaveChanges(); }
/// <summary> /// Retrieves a Character's Move List /// </summary> /// <param name="characterId"></param> /// <returns></returns> public List <Move> RetrieveACharactersMoveList(int characterId) { using var db = new FrameDataContext(); var moveList = db.Moves.Where(m => m.CharacterId == characterId).ToList(); return(moveList); }
public FrameDataController( ICharacterService characterService, FrameDataContext frameDataContext, IMapper mapper) : base(mapper) { _characterService = characterService; _frameDataContext = frameDataContext; }
public BaseMainFrame() { InitializeComponent(); System.Timers.Timer timer = new System.Timers.Timer(); timer.Interval = 1000; timer.Elapsed += Timer_Elapsed; FrameContext = new FrameDataContext(); this.DataContext = FrameContext; FrameContext.ProductName = "点餐管理系统 Jaylosy版权所有"; timer.Enabled = true; ShowWelcome(); }
/// <summary> /// Creates a new character and saves it to the database. /// </summary> /// <param name="characterName"></param> /// <param name="quote"></param> /// <param name="health"></param> /// <param name="stun"></param> /// <param name="forwardDash"></param> /// <param name="backDash"></param> /// <param name="characterPicture"></param> public void CreateCharacter(string characterName, string quote, int health, int stun, int forwardDash, int backDash, string characterPicture) { var newCharacter = new Character() { CharacterName = characterName, Quote = quote, Health = health, Stun = stun, ForwardDash = forwardDash, BackDash = backDash, CharacterPicture = characterPicture }; using var db = new FrameDataContext(); db.Characters.Add(newCharacter); db.SaveChanges(); }
/// <summary> /// Retrieves all the Characters in the database /// </summary> /// <returns> /// List of Characters /// </returns> public List <Character> RetrieveAllCharacters() { using var db = new FrameDataContext(); return(db.Characters.ToList()); }