public ActionResult ManitoFunPlay() { User user = new User() { UserId = new OperatorProvider <FrontCurrentUser>().GetCurrent().UserId, HomePage_Img = Request["homeImg"], Sex = int.Parse(Request["sex"]), CurrentCity = Request["city"], PersonalPhoto = Request["photo"], PersonalAudio = Request["audio"], }; R_Game_User_Play game = new R_Game_User_Play() { Games_GameId = int.Parse(Request["gameId"]), GameAreaId = int.Parse(Request["areaId"]), GameRatingId = int.Parse(Request["ratingId"]), GameRating_CutImg = Request["ratingImg"], OnlinePrice = int.Parse(Request["onPrice"]), OfflinePrice = int.Parse(Request["offPrice"]), TagName = Request["tagName"], ServiceNote = Request["serviceNote"], GameScore_CutImg = Request["scoreImg"], Type = (int)ProjectType.FunPlay }; if (IocUtils.Resolve <IR_Game_User_PlayService>().InsertFunPlay(game, user)) { return(Content("ok,恭喜:信息提交成功!")); } else { return(Content("no,提示:游戏信息认证失败了!")); } }
/// <summary> /// 大神申请>大神上分 /// </summary> /// <param name="entity"></param> /// <returns></returns> public int Insert(R_Game_User_Play entity) { string sql = "insert into R_Game_User_Play(GameRating_CutImg,Type,User_UserId,Games_GameId,GameRatingId,GameAreaId) values(@GameRating_CutImg,@Type,@User_UserId,@Games_GameId,@GameRatingId,@GameAreaId) "; using (var conn = ConnectionFactory.Connection()) { return(conn.Execute(sql, entity)); } }
/// <summary> /// 大神申请-游戏初步认证 /// </summary> /// <returns></returns> public ActionResult MainToGameApply(int gameId, int ratingId, int areaId, string ratingImg) { R_Game_User_Play game = new R_Game_User_Play() { GameRating_CutImg = ratingImg, Type = (int)ProjectType.Manito, User_UserId = new OperatorProvider <FrontCurrentUser>().GetCurrent().UserId, Games_GameId = gameId, GameAreaId = areaId, GameRatingId = ratingId }; if (IocUtils.Resolve <IR_Game_User_PlayService>().Insert(game) > 0) { return(Content("ok")); } else { return(Content("no")); } }
public int InsertFunPlay(R_Game_User_Play entity, User user) { using (var conn = ConnectionFactory.Connection()) { const string sql = " insert into R_Game_User_Play(GameRating_CutImg,Type,User_UserId,Games_GameId,GameRatingId,GameAreaId,OnlinePrice,OfflinePrice,TagName,ServiceNote,GameScore_CutImg) values(@GameRating_CutImg, @Type, @User_UserId, @Games_GameId, @GameRatingId, @GameAreaId, @OnlinePrice, @OfflinePrice, @TagName, @ServiceNote, @GameScore_CutImg) "; const string sql2 = " update [dbo].[User] set HomePage_Img=@HomePage_Img,Sex=@Sex,CurrentCity=@CurrentCity,PersonalPhoto=@PersonalPhoto,PersonalAudio=@PersonalAudio where UserId=@UserId"; IDbTransaction tran = conn.BeginTransaction(); try { int i = conn.Execute(sql, entity, tran); i += conn.Execute(sql2, new { UserId = user.UserId, HomePage_Img = user.HomePage_Img, Sex = user.Sex, CurrentCity = user.CurrentCity, PersonalPhoto = user.PersonalPhoto, PersonalAudio = user.PersonalAudio }, tran); tran.Commit(); return(i); } catch (Exception) { tran.Rollback(); throw; } } }
public bool Update(R_Game_User_Play entity) { throw new NotImplementedException(); }
public bool InsertFunPlay(R_Game_User_Play entity, User user) { return(IocUtils.Resolve <IR_Game_User_PlayRepository>().InsertFunPlay(entity, user) > 0?true:false); }
public int Insert(R_Game_User_Play entity) { return(IocUtils.Resolve <IR_Game_User_PlayRepository>().Insert(entity)); }