/// <summary> /// 获取规则实体 /// </summary> /// <param name="kindID"></param> /// <returns></returns> public GameRulesInfo GetGameRulesInfo(int kindID) { string sqlQuery = string.Format("(NOLOCK) WHERE KindID= {0}", kindID); GameRulesInfo gameRules = aideGameRulesProvider.GetObject <GameRulesInfo>(sqlQuery); return(gameRules); }
/// <summary> /// 更新规则 /// </summary> /// <param name="gameRules">规则实体</param> /// <param name="kindID">需要更新规则的游戏ID</param> public void UpdateGameRules(GameRulesInfo gameRules, int kindID) { StringBuilder sqlQuery = new StringBuilder( ); sqlQuery.Append("UPDATE GameRulesInfo SET ") .Append("KindID = @KindID ,") .Append("KindName = @KindName ,") .Append("ImgRuleUrl = @ImgRuleUrl,") .Append("HelpIntro = @HelpIntro ,") .Append("HelpRule = @HelpRule,") .Append("HelpGrade = @HelpGrade,") .Append("JoinIntro = @JoinIntro,") .Append("Nullity = @Nullity,") .Append("ModifyDate = @ModifyDate ") .Append("WHERE KindID = @OldKindID"); var prams = new List <DbParameter>( ); prams.Add(Database.MakeInParam("KindID", gameRules.KindID)); prams.Add(Database.MakeInParam("KindName", gameRules.KindName)); prams.Add(Database.MakeInParam("ImgRuleUrl", gameRules.ImgRuleUrl)); prams.Add(Database.MakeInParam("HelpIntro", gameRules.HelpIntro)); prams.Add(Database.MakeInParam("HelpRule", gameRules.HelpRule)); prams.Add(Database.MakeInParam("HelpGrade", gameRules.HelpGrade)); prams.Add(Database.MakeInParam("JoinIntro", gameRules.JoinIntro)); prams.Add(Database.MakeInParam("Nullity", gameRules.Nullity)); prams.Add(Database.MakeInParam("ModifyDate", gameRules.ModifyDate)); prams.Add(Database.MakeInParam("OldKindID", kindID)); Database.ExecuteNonQuery(CommandType.Text, sqlQuery.ToString( ), prams.ToArray( )); }
private void GameFeedbackDataBind() { if (StrCmd == "add") { litInfo.Text = "新增"; } else { litInfo.Text = "更新"; } if (IntParam <= 0) { return; } //获取规则信息 GameRulesInfo gameRules = FacadeManage.aideNativeWebFacade.GetGameRulesInfo(IntParam); if (gameRules == null) { ShowError("规则信息不存在"); Redirect("RulesList.aspx"); return; } ddlKind.SelectedValue = gameRules.KindID.ToString().Trim(); txtHelpIntro.Text = gameRules.HelpIntro; txtHelpRule.Text = gameRules.HelpRule; txtHelpGrade.Text = gameRules.HelpGrade; txtMobileIntro.Text = gameRules.MobileIntro; txtRoomCardIntro.Text = gameRules.RoomCardIntro; rbtnNullity.SelectedValue = gameRules.Nullity.ToString().Trim(); rbtnIsJoin.SelectedValue = gameRules.JoinIntro.ToString().Trim(); CtrlHelper.SetText(lblCollectDate, gameRules.CollectDate.ToString()); CtrlHelper.SetText(lblModifyDate, gameRules.ModifyDate.ToString()); upThumbnail.FilePath = gameRules.ThumbnailUrl; upShowPicture.FilePath = gameRules.ImgRuleUrl; upMobilePicture.FilePath = gameRules.MobileImgUrl; foreach (ListItem lt in cblMoblieGameType.Items) { if ((Convert.ToInt32(lt.Value) & gameRules.MobileGameType) == Convert.ToInt32(lt.Value)) { lt.Selected = true; } } //CtrlHelper.SetText(txtAndroidDownloadUrl, gameRules.AndroidDownloadUrl); //CtrlHelper.SetText(txtIOSDownloadUrl, gameRules.IOSDownloadUrl); //CtrlHelper.SetText(txtMoileSize, gameRules.MobileSize); //CtrlHelper.SetText(txtMobileDate, gameRules.MobileDate); //CtrlHelper.SetText(txtMobileVersion, gameRules.MobileVersion); StringBuffer bufferFileView = new StringBuffer(); }
public bool JudgeRulesIsExistence(int kindID) { string where = string.Format("(NOLOCK) WHERE KindID= {0}", kindID); GameRulesInfo @object = aideGameRulesProvider.GetObject <GameRulesInfo>(where); if (@object == null) { return(false); } return(true); }
private void GameFeedbackDataBind( ) { if (StrCmd == "add") { litInfo.Text = "新增"; } else { litInfo.Text = "更新"; } if (IntParam <= 0) { return; } //获取规则信息 GameRulesInfo gameRules = aideNativeWebFacade.GetGameRulesInfo(IntParam); if (gameRules == null) { ShowError("规则信息不存在"); Redirect("RulesList.aspx"); return; } ddlKind.SelectedValue = gameRules.KindID.ToString( ).Trim( ); CtrlHelper.SetText(inImgRuleUrl, gameRules.ImgRuleUrl); CtrlHelper.SetText(txtHelpIntro, gameRules.HelpIntro); CtrlHelper.SetText(txtHelpRule, gameRules.HelpRule); CtrlHelper.SetText(txtHelpGrade, gameRules.HelpGrade); rbtnNullity.SelectedValue = gameRules.Nullity.ToString( ).Trim( ); rbtnIsJoin.SelectedValue = gameRules.JoinIntro.ToString( ).Trim( ); CtrlHelper.SetText(lblCollectDate, gameRules.CollectDate.ToString( )); CtrlHelper.SetText(lblModifyDate, gameRules.ModifyDate.ToString( )); StringBuffer bufferFileView = new StringBuffer( ); //游戏截图 if (!TextUtility.EmptyTrimOrNull(gameRules.ImgRuleUrl)) { bufferFileView.InnerBuilder.AppendFormat("setImgFilePath(\"frImgRuleUrl\",\"{0}\");", gameRules.ImgRuleUrl); imgGame.ImageUrl = gameRules.ImgRuleUrl; trGameImage.Visible = true; } if (bufferFileView.Length > 0) { bufferFileView.Replace("'", "\\'"); bufferFileView.Replace("\r\n", ""); ClientScript.RegisterStartupScript(this.GetType( ), "", "window.onload=function(){" + bufferFileView.ToString( ) + "}", true); } }
///<summary> ///判断游戏规则是否存在 ///</summary> ///<paraparam name="kindID">游戏ID</paraparam> ///<returns>存在返回true,不存在返回false</returns> public bool JudgeRulesIsExistence(int kindID) { string sqlQuery = string.Format("(NOLOCK) WHERE KindID= {0}", kindID); GameRulesInfo gameRules = aideGameRulesProvider.GetObject <GameRulesInfo>(sqlQuery); if (gameRules == null) { return(false); } else { return(true); } }
protected void Page_Load(object sender, System.EventArgs e) { int queryInt = GameRequest.GetQueryInt("id", 0); if (queryInt == 0) { base.Response.Redirect("/404.html"); } this.model = FacadeManage.aideNativeWebFacade.GetGameHelp(queryInt); if (this.model == null) { base.Response.Redirect("/404.html"); } this.model.HelpIntro = Utility.HtmlDecode(this.model.HelpIntro); this.terminalType = Fetch.GetTerminalType(this.Page.Request); this.BindMoblieGame(queryInt); }
/// <summary> /// 新增规则 /// </summary> /// <param name="gameRules"></param> public void InsertGameRules(GameRulesInfo gameRules) { DataRow dr = aideGameRulesProvider.NewRow( ); dr[GameRulesInfo._KindID] = gameRules.KindID; dr[GameRulesInfo._KindName] = gameRules.KindName; dr[GameRulesInfo._ImgRuleUrl] = gameRules.ImgRuleUrl; dr[GameRulesInfo._HelpIntro] = gameRules.HelpIntro; dr[GameRulesInfo._HelpRule] = gameRules.HelpRule; dr[GameRulesInfo._HelpGrade] = gameRules.HelpGrade; dr[GameRulesInfo._JoinIntro] = gameRules.JoinIntro; dr[GameRulesInfo._Nullity] = gameRules.Nullity; dr[GameRulesInfo._CollectDate] = gameRules.CollectDate; dr[GameRulesInfo._ModifyDate] = gameRules.ModifyDate; aideGameRulesProvider.Insert(dr); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int KindID = GameRequest.GetQueryInt("KindID", -1); downloadURL = string.Format("http://" + Request.Url.Authority.ToString() + "/DownLoadMB.aspx?KindID={0}", KindID); //获取游戏信息 GameRulesInfo Info = FacadeManage.aideNativeWebFacade.GetGameHelp(KindID); if (Info != null) { gameIcoURL = Info.ThumbnailUrl; gameName = Info.KindName + " 手机版" + Info.MobileVersion; gameSize = Info.MobileSize; gameDate = Info.MobileDate; } } }
public ActionResult RulesInfo() { string a = TypeUtil.ObjectToString(base.Request["cmd"]); if (a == "add") { base.ViewBag.Info = "新增"; } else { base.ViewBag.Info = "更新"; } int num = TypeUtil.ObjectToInt(base.Request["param"]); base.ViewBag.ID = num; GameRulesInfo gameRulesInfo = FacadeManage.aideNativeWebFacade.GetGameRulesInfo(num); base.ViewData["data"] = gameRulesInfo; return(View()); }
protected void Page_Load(object sender, EventArgs e) { int id = GameRequest.GetQueryInt("id", 0); if (id == 0) { Response.Redirect("/404.html"); } model = FacadeManage.aideNativeWebFacade.GetGameHelp(id); if (model == null) { Response.Redirect("/404.html"); } model.HelpIntro = Game.Utils.Utility.HtmlDecode(model.HelpIntro); terminalType = Fetch.GetTerminalType(Page.Request); BindMoblieGame(id); }
public void UpdateGameRules(GameRulesInfo gameRules, int kindID) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("UPDATE GameRulesInfo SET ").Append("ImgRuleUrl = @ImgRuleUrl,").Append("ThumbnailUrl = @ThumbnailUrl,") .Append("MobileImgUrl = @MobileImgUrl,") .Append("MobileSize = @MobileSize,") .Append("MobileDate = @MobileDate,") .Append("MobileVersion = @MobileVersion,") .Append("MobileGameType = @MobileGameType ,") .Append("AndroidDownloadUrl = @AndroidDownloadUrl,") .Append("IOSDownloadUrl = @IOSDownloadUrl,") .Append("HelpIntro = @HelpIntro ,") .Append("HelpRule = @HelpRule,") .Append("HelpGrade = @HelpGrade,") .Append("JoinIntro = @JoinIntro,") .Append("Nullity = @Nullity,") .Append("ModifyDate = @ModifyDate ") .Append("WHERE KindID = @OldKindID"); List <DbParameter> list = new List <DbParameter>(); list.Add(base.Database.MakeInParam("ImgRuleUrl", gameRules.ImgRuleUrl)); list.Add(base.Database.MakeInParam("ThumbnailUrl", gameRules.ThumbnailUrl)); list.Add(base.Database.MakeInParam("MobileImgUrl", gameRules.MobileImgUrl)); list.Add(base.Database.MakeInParam("MobileSize", gameRules.MobileSize)); list.Add(base.Database.MakeInParam("MobileDate", gameRules.MobileDate)); list.Add(base.Database.MakeInParam("MobileVersion", gameRules.MobileVersion)); list.Add(base.Database.MakeInParam("MobileGameType", gameRules.MobileGameType)); list.Add(base.Database.MakeInParam("AndroidDownloadUrl", gameRules.AndroidDownloadUrl)); list.Add(base.Database.MakeInParam("IOSDownloadUrl", gameRules.IOSDownloadUrl)); list.Add(base.Database.MakeInParam("HelpIntro", gameRules.HelpIntro)); list.Add(base.Database.MakeInParam("HelpRule", gameRules.HelpRule)); list.Add(base.Database.MakeInParam("HelpGrade", gameRules.HelpGrade)); list.Add(base.Database.MakeInParam("JoinIntro", gameRules.JoinIntro)); list.Add(base.Database.MakeInParam("Nullity", gameRules.Nullity)); list.Add(base.Database.MakeInParam("ModifyDate", gameRules.ModifyDate)); list.Add(base.Database.MakeInParam("OldKindID", kindID)); base.Database.ExecuteNonQuery(CommandType.Text, stringBuilder.ToString(), list.ToArray()); }
public void InsertGameRules(GameRulesInfo gameRules) { System.Data.DataRow dataRow = this.aideGameRulesProvider.NewRow(); dataRow["KindID"] = gameRules.KindID; dataRow["KindName"] = gameRules.KindName; dataRow["ImgRuleUrl"] = gameRules.ImgRuleUrl; dataRow["ThumbnailUrl"] = gameRules.ThumbnailUrl; dataRow["MobileImgUrl"] = gameRules.MobileImgUrl; dataRow["MobileSize"] = gameRules.MobileSize; dataRow["MobileDate"] = gameRules.MobileDate; dataRow["MobileVersion"] = gameRules.MobileVersion; dataRow["MobileGameType"] = gameRules.MobileGameType; dataRow["AndroidDownloadUrl"] = gameRules.AndroidDownloadUrl; dataRow["IOSDownloadUrl"] = gameRules.IOSDownloadUrl; dataRow["HelpIntro"] = gameRules.HelpIntro; dataRow["HelpRule"] = gameRules.HelpRule; dataRow["HelpGrade"] = gameRules.HelpGrade; dataRow["JoinIntro"] = gameRules.JoinIntro; dataRow["Nullity"] = gameRules.Nullity; dataRow["CollectDate"] = gameRules.CollectDate; dataRow["ModifyDate"] = gameRules.ModifyDate; this.aideGameRulesProvider.Insert(dataRow); }
public JsonResult DoRulesInfo(GameRulesInfo entity) { string a = TypeUtil.ObjectToString(base.Request["OP"]); int num = TypeUtil.ObjectToInt(base.Request["ID"]); if (entity == null) { return(Json(new { IsOk = false, Msg = "没有数据" })); } if (string.IsNullOrEmpty(entity.ImgRuleUrl)) { return(Json(new { IsOk = false, Msg = "请选择一张PC网站效果图!" })); } if (string.IsNullOrEmpty(entity.HelpIntro)) { return(Json(new { IsOk = false, Msg = "请输入游戏介绍" })); } if (string.IsNullOrEmpty(entity.HelpRule)) { return(Json(new { IsOk = false, Msg = "请输入游戏规则介绍" })); } if (string.IsNullOrEmpty(entity.HelpGrade)) { return(Json(new { IsOk = false, Msg = "请输入游戏等级介绍" })); } Message message = new Message(); if (a == "新增") { if (entity.KindID < 1) { return(Json(new { IsOk = false, Msg = "请选择游戏" })); } if (user != null) { AdminPermission adminPermission = new AdminPermission(user, user.MoudleID); if (!adminPermission.GetPermission(2L)) { return(Json(new { IsOk = false, Msg = "没有权限", Url = "/NoPower/Index" })); } } if (FacadeManage.aideNativeWebFacade.JudgeRulesIsExistence(entity.KindID)) { return(Json(new { IsOk = false, Msg = "该游戏规则已存在" })); } message = FacadeManage.aideNativeWebFacade.InsertGameRules(entity); } else { if (user != null) { AdminPermission adminPermission2 = new AdminPermission(user, user.MoudleID); if (!adminPermission2.GetPermission(4L)) { return(Json(new { IsOk = false, Msg = "没有权限", Url = "/NoPower/Index" })); } } if (FacadeManage.aideNativeWebFacade.JudgeRulesIsExistence(entity.KindID) && entity.KindID != num) { return(Json(new { IsOk = false, Msg = "该游戏规则已存在" })); } message = FacadeManage.aideNativeWebFacade.UpdateGameRules(entity, num); } if (message.Success) { return(Json(new { IsOk = true, Msg = "操作成功" })); } return(Json(new { IsOk = false, Msg = message.Content })); }
/// <summary> /// 更新规则 /// </summary> /// <param name="gameRules"></param> public Message UpdateGameRules(GameRulesInfo gameRules, int kindID) { aideNativeWebData.UpdateGameRules(gameRules, kindID); return(new Message(true)); }
/// <summary> /// 新增规则 /// </summary> /// <param name="gameRules"></param> public Message InsertGameRules(GameRulesInfo gameRules) { aideNativeWebData.InsertGameRules(gameRules); return(new Message(true)); }
private void ProcessData( ) { GameRulesInfo gameRules = new GameRulesInfo( ); gameRules.KindID = Convert.ToInt32(ddlKind.SelectedValue.Trim( )); gameRules.KindName = ddlKind.SelectedItem.Text; string imgUrl = CtrlHelper.GetText(inImgRuleUrl); if (string.IsNullOrEmpty(imgUrl)) { ShowError("请上传游戏截图"); return; } if (imgUrl.Contains("http://")) { gameRules.ImgRuleUrl = imgUrl; } else { gameRules.ImgRuleUrl = "http://" + GameRequest.GetCurrentFullHost( ) + imgUrl; } gameRules.HelpIntro = CtrlHelper.GetText(txtHelpIntro); gameRules.HelpRule = CtrlHelper.GetText(txtHelpRule); gameRules.HelpGrade = CtrlHelper.GetText(txtHelpGrade); gameRules.JoinIntro = Convert.ToByte(rbtnIsJoin.SelectedValue.Trim( )); gameRules.Nullity = Convert.ToByte(rbtnNullity.SelectedValue.Trim( )); Message msg = new Message( ); if (StrCmd == "add") { //判断权限 AuthUserOperationPermission(Permission.Delete); if (aideNativeWebFacade.JudgeRulesIsExistence(gameRules.KindID)) { ShowError("该游戏规则已存在"); return; } msg = aideNativeWebFacade.InsertGameRules(gameRules); } else { //判断权限 AuthUserOperationPermission(Permission.Edit); if (aideNativeWebFacade.JudgeRulesIsExistence(gameRules.KindID) && gameRules.KindID != IntParam) { ShowError("该游戏规则已存在"); return; } msg = aideNativeWebFacade.UpdateGameRules(gameRules, IntParam); } if (msg.Success) { if (StrCmd == "add") { ShowInfo("规则增加成功", "RulesList.aspx", 1200); } else { ShowInfo("规则修改成功", "RulesList.aspx", 1200); } } else { ShowError(msg.Content); } }
private void ProcessData() { GameRulesInfo gameRules = new GameRulesInfo(); gameRules.KindID = Convert.ToInt32(ddlKind.SelectedValue.Trim()); gameRules.KindID = Convert.ToInt32(ddlKind.SelectedValue.Trim()); if (gameRules.KindID == 0) { ShowError("请选择游戏"); return; } gameRules.KindName = ddlKind.SelectedItem.Text; gameRules.HelpIntro = CtrlHelper.GetText(txtHelpIntro); gameRules.HelpRule = CtrlHelper.GetText(txtHelpRule); gameRules.HelpGrade = CtrlHelper.GetText(txtHelpGrade); gameRules.JoinIntro = Convert.ToByte(rbtnIsJoin.SelectedValue.Trim()); gameRules.Nullity = Convert.ToByte(rbtnNullity.SelectedValue.Trim()); gameRules.AndroidDownloadUrl = CtrlHelper.GetText(txtAndroidDownloadUrl); gameRules.IOSDownloadUrl = CtrlHelper.GetText(txtIOSDownloadUrl); gameRules.MobileSize = CtrlHelper.GetText(txtMoileSize); gameRules.MobileDate = CtrlHelper.GetText(txtMobileDate); gameRules.MobileVersion = CtrlHelper.GetText(txtMobileVersion); int type = 0; foreach (ListItem lt in cblMoblieGameType.Items) { if (lt.Selected) { type = type | Convert.ToInt32(lt.Value); } } gameRules.MobileGameType = Convert.ToByte(type); //缩率图上传 try { gameRules.ThumbnailUrl = upThumbnail.FilePath; if (string.IsNullOrEmpty(gameRules.ThumbnailUrl)) { ShowError("请选择一个游戏ICO图标!"); return; } } catch (Exception ex) { ShowError("缩略图上传失败:" + ex.Message); return; } //展示图上传 try { gameRules.ImgRuleUrl = upShowPicture.FilePath; if (string.IsNullOrEmpty(gameRules.ImgRuleUrl)) { ShowError("请选择一张PC网站效果图!"); return; } } catch (Exception ex) { ShowError("游戏截图上传失败:" + ex.Message); return; } //移动端效果图上传 try { gameRules.MobileImgUrl = upMobilePicture.FilePath; } catch (Exception ex) { ShowError("游戏截图上传失败:" + ex.Message); return; } if (string.IsNullOrEmpty(gameRules.HelpIntro)) { ShowError("请输入游戏介绍"); return; } if (string.IsNullOrEmpty(gameRules.HelpRule)) { ShowError("请输入游戏规则介绍"); return; } if (string.IsNullOrEmpty(gameRules.HelpGrade)) { ShowError("请输入游戏等级介绍"); return; } Message msg = new Message(); if (StrCmd == "add") { //判断权限 AuthUserOperationPermission(Permission.Delete); if (FacadeManage.aideNativeWebFacade.JudgeRulesIsExistence(gameRules.KindID)) { ShowError("该游戏规则已存在"); return; } msg = FacadeManage.aideNativeWebFacade.InsertGameRules(gameRules); } else { //判断权限 AuthUserOperationPermission(Permission.Edit); if (FacadeManage.aideNativeWebFacade.JudgeRulesIsExistence(gameRules.KindID) && gameRules.KindID != IntParam) { ShowError("该游戏规则已存在"); return; } msg = FacadeManage.aideNativeWebFacade.UpdateGameRules(gameRules, IntParam); } if (msg.Success) { if (StrCmd == "add") { ShowInfo("规则增加成功", "RulesList.aspx", 1200); } else { ShowInfo("规则修改成功", "RulesList.aspx", 1200); } } else { ShowError(msg.Content); } }