protected void btnEdit_Click(object sender, EventArgs e) { var info = AdPageInfoBLL.Instance.GetSingle(new AdPageInfoPara() { Id = int.Parse(hidId.Value) }); if (info != null) { info.Title = txtTitle.Value; info.UserId = int.Parse(ddlAdUserName.SelectedValue); info.Content = hidContent.Value; info.LastDate = DateTime.Now; info.Title = txtTitle.Value; info.WeiXinUrl = txtWeiXinUrl.Value; info.ViewPage = txtPage.Value; info.Money = DbConvert.GetDecimal(txtMoney.Value, 0); info.PlanIp = DbConvert.GetInt(txtPlanIp.Value, 0); info.UserCode = hidUserCode.Value; info.QcodeImg = txtQcodeImg.Text; info.TitleImg = imgPerview.ImageUrl; info.TitleShort = txtTitleShort.Text; info.MoneyCount = DbConvert.GetDecimal(txtMoneyCount.Value, 0); int planip = 0; if (!string.IsNullOrEmpty(txtPlanIp.Value)) { planip = DbConvert.GetInt(txtPlanIp.Value); } info.PlanIp = planip; info.TemplateName = ddlTemplate.SelectedValue; info.StaticContent = hidStaticContent.Value; info.DefaultQcode = txtQcodeImg.Text; info.QcodeImg2 = txtQcodeImg2.Text; info.DefaultQcode2 = txtDefaultQcode2.Text; info.DomainList = txtDomainList.Text; info.TitleShort = txtTitleShort.Text; if (AdPageInfoBLL.Instance.CreateAdPage(info.ViewPage, ddlTemplate.SelectedValue, info.Id)) { AdPageInfoBLL.Instance.Edit(info); } else { lblMsg.Text = "【广告页面】己经存在。"; } AdPageInfoBLL.Instance.Refresh(); Response.Redirect("/Admin/Ads/AdPageList.aspx"); } }
protected void btnSave_Click(object sender, EventArgs e) { AdPageInfoVO info = new AdPageInfoVO(); info.Title = txtTitle.Value; info.UserId = int.Parse(ddlAdUserName.SelectedValue); info.AdType = 0; info.Content = hidContent.Value; info.CreateDate = DateTime.Now; info.LastDate = DateTime.Now; info.Title = txtTitle.Value; info.TitleImg = imgPerview.ImageUrl; info.WeiXinUrl = txtWeiXinUrl.Value; info.ViewPage = txtPage.Value; info.Money = DbConvert.GetDecimal(txtMoney.Value, 0); info.QcodeImg = txtQcodeImg.Text; info.BuyMoney = 0; info.MoneyCount = DbConvert.GetDecimal(txtMoneyCount.Value, 0); int planip = 0; if (!string.IsNullOrEmpty(txtPlanIp.Value)) { planip = DbConvert.GetInt(txtPlanIp.Value); } info.PlanIp = planip; info.PlanTerminal = 0; info.StartTime = DateTime.Now; info.UserCode = hidUserCode.Value; info.TemplateName = ddlTemplate.SelectedValue; info.CreateUserId = Account.UserId; info.StaticContent = hidStaticContent.Value; info.DeleteDate = DateTime.Now; info.DefaultQcode = txtQcodeImg.Text; info.QcodeImg2 = txtQcodeImg2.Text; info.DefaultQcode2 = txtDefaultQcode2.Text; info.DomainList = txtDomainList.Text; info.TitleShort = txtTitleShort.Text; int adid = AdPageInfoBLL.Instance.AddIdentity(info); if (AdPageInfoBLL.Instance.CreateAdPage(info.ViewPage, ddlTemplate.SelectedValue, adid)) { Response.Redirect("/Admin/Ads/AdPageList.aspx"); } else { lblMsg.Text = "【广告页面】己经存在。"; } }