public ActionResult DeleteC(long Cid) { var model = new GameCategoryModel(); model.CID = Cid; model.CStatus = false; if (Cid > 0) { wgcR.Update(model); } return(Success("操作成功")); }
public ActionResult SaveCModify(GameCategoryModel model) { model.Createtime = DateTime.Now; if (model.CID > 0) { wgcR.Update(model); } else { wgcR.Insert(model); } return(Success("操作成功")); }
public async Task AddCategoryToGameByDescription(int gameId, string categoryDescription) { if (gameId != 0 && !string.IsNullOrEmpty(categoryDescription)) { var categoryId = await AddCategory(categoryDescription); var categoryGame = new GameCategoryModel { GameId = gameId, CategoryId = categoryId }; var categoryGameDB = await _tagDbAccess.GetGameCategory(categoryGame); if (categoryGameDB == null) { _tagDbAccess.AddCategoryToGame(categoryGame); } } else { throw new Exception("String cannot be null or empty"); } }
private async Task OpenCategoryGames(GameCategoryModel model) { await ShowViewModel <GamesCategoryViewModel, GameCategoryModel>(model); }
public async void AddCategoryToGame(GameCategoryModel gameAddCategoryModel) { string query = $@"INSERT INTO GameCategory (GameId, CategoryId) VALUES(@GameId, @CategoryId)"; await SaveDataAsync(query, gameAddCategoryModel); }
public async Task <GameCategoryModel> GetGameCategory(GameCategoryModel gameCategory) { string query = @"SELECT * FROM GameCategory gc WHERE gc.GameId=@GameId AND gc.CategoryId=@CategoryId"; return(await GetSingleDataAsync <GameCategoryModel>(query, gameCategory)); }