/// <summary> /// 数据保存 /// </summary> protected void btnSave_Click(object sender, EventArgs e) { if (!AuthUserOperationPermission(Permission.Edit)) { return; } GameSignIn config = new GameSignIn(); if (IntParam > 0) { config = FacadeManage.aidePlatformFacade.GetGameSignIn(IntParam); } config.PackageID = Convert.ToInt32(ddlPackageID.SelectedValue); config.TypeID = Convert.ToByte(ddlTypeID.SelectedValue); config.Probability = CtrlHelper.GetInt(txtProbability, 0); config.NeedDay = CtrlHelper.GetInt(txtNeedDay, 0); config.SortID = CtrlHelper.GetInt(txtSortID, 0); config.Nullity = Convert.ToByte(rblNullity.SelectedValue); //string filepath = upImage.FilePath; //if (string.IsNullOrEmpty(filepath)) //{ // ShowError("广告图片未上传"); // return; //} //config.ResourceURL = filepath.Substring(7, filepath.Length - 7); int result = IntParam > 0 ? FacadeManage.aidePlatformFacade.UpdateGameSignIn(config) : FacadeManage.aidePlatformFacade.InsertGameSignIn(config); if (result > 0) { ShowInfo("操作成功", "GameSignInList.aspx", 1200); } else { ShowError("操作失败"); } }
/// <summary> /// 数据绑定 /// </summary> private void BindData() { if (IntParam > 0) { GameSignIn config = FacadeManage.aidePlatformFacade.GetGameSignIn(IntParam); if (config != null) { CtrlHelper.SetText(txtProbability, config.Probability.ToString()); CtrlHelper.SetText(txtNeedDay, config.NeedDay.ToString()); CtrlHelper.SetText(txtSortID, config.SortID.ToString()); rblNullity.SelectedValue = config.Nullity.ToString(); ddlTypeID.SelectedValue = config.TypeID.ToString(); ddlPackageID.SelectedValue = config.PackageID.ToString(); //if (!string.IsNullOrEmpty(config.ResourceURL)) //{ // upImage.FilePath = "/Upload" + config.ResourceURL; //} } } }
/// <summary> /// 修改签到配置 /// </summary> /// <param name="config"></param> /// <returns></returns> public int UpdateGameSignIn(GameSignIn config) { return(_aidePlatformData.UpdateGameSignIn(config)); }
/// <summary> /// 新增签到配置 /// </summary> /// <param name="config"></param> /// <returns></returns> public int InsertGameSignIn(GameSignIn config) { return(_aidePlatformData.InsertGameSignIn(config)); }