/// <summary> /// 数据绑定 /// </summary> private void BindData() { if (IntParam > 0) { GamePackageGoods config = FacadeManage.aidePlatformFacade.GetGamePackageGoods(IntParam); if (config != null) { if (config.TypeID == 0) { CtrlHelper.SetText(txtGoodsNum, (config.GoodsNum / 1000).ToString()); } else { CtrlHelper.SetText(txtGoodsNum, config.GoodsNum.ToString()); } ddlPropertyID.SelectedValue = config.PropertyID.ToString(); ddlTypeID.SelectedValue = config.TypeID.ToString(); ddlPackageID.SelectedValue = config.PackageID.ToString(); if (!string.IsNullOrEmpty(config.ResourceURL)) { upImage.FilePath = "/Upload" + config.ResourceURL; } } } }
/// <summary> /// 数据保存 /// </summary> protected void btnSave_Click(object sender, EventArgs e) { GamePackageGoods config = new GamePackageGoods(); if (IntParam > 0) { if (!AuthUserOperationPermission(Permission.Edit)) { return; } config = FacadeManage.aidePlatformFacade.GetGamePackageGoods(IntParam); } config.PackageID = Convert.ToInt32(ddlPackageID.SelectedValue); config.TypeID = Convert.ToByte(ddlTypeID.SelectedValue); config.PropertyID = Convert.ToInt32(ddlPropertyID.SelectedValue); if (config.TypeID == 0) { config.GoodsNum = CtrlHelper.GetInt(txtGoodsNum, 0) * 1000; } else { config.GoodsNum = CtrlHelper.GetInt(txtGoodsNum, 0); } string filepath = upImage.FilePath; if (string.IsNullOrEmpty(filepath)) { ShowError("广告图片未上传"); return; } config.ResourceURL = filepath.Substring(7, filepath.Length - 7); int result = IntParam > 0 ? FacadeManage.aidePlatformFacade.UpdateGamePackageGoods(config) : FacadeManage.aidePlatformFacade.InsertGamePackageGoods(config); if (result > 0) { ShowInfo("操作成功", "GamePackageGoodsList.aspx", 1200); } else { ShowError("操作失败"); } }
/// <summary> /// 修改签到礼包配置 /// </summary> /// <param name="config"></param> /// <returns></returns> public int UpdateGamePackageGoods(GamePackageGoods config) { return(_aidePlatformData.UpdateGamePackageGoods(config)); }
/// <summary> /// 新增签到礼包物品配置 /// </summary> /// <param name="config"></param> /// <returns></returns> public int InsertGamePackageGoods(GamePackageGoods config) { return(_aidePlatformData.InsertGamePackageGoods(config)); }