protected void SubmitButton_Click(object sender, EventArgs e) { if (Page.IsValid) { if (!StringHelper.IsNumber(FatherId.Value)) { FatherId.Value = "0"; } if (!StringHelper.IsNumber(Sort.Value)) { Sort.Value = "1"; } onePage.Title = MyTitle.Value; onePage.PageTitle = PageTitle.Value; if (!String.IsNullOrEmpty(Keywords.Value)) { onePage.Keywords = Keywords.Value.Replace(",", ","); } else { onePage.Keywords = Keywords.Value; } onePage.Descn = Descn.Value; onePage.UrlAlias = UrlAlias.Value; if (onePage.Mode == 0) { onePage.Content = MyContent.Value; } else { onePage.Content = null; } onePage.FatherId = Convert.ToInt32(FatherId.Value); onePage.ISort = Convert.ToInt32(Sort.Value); if (onePage.Pkid > 0) { //更改 bll_onePage.Update(onePage); bll_urlRoute.Update(); WebUtility.ShowAlertMessage("保存成功!", "onePageManage.aspx" + param); } else { //增加 onePage.Enabled = true; onePage.CreateTime = DateTime.Now.ToString(); bll_onePage.Insert(onePage); bll_urlRoute.Update(); WebUtility.ShowAlertMessage("新增成功!", Request.RawUrl); } } }
protected void SubmitButton_Click(object sender, EventArgs e) { if (Page.IsValid) { if (!StringHelper.IsNumber(Mode.SelectedValue)) { WebUtility.ShowAlertMessage("请选择页面形式!", null); } onePage.Title = MyTitle.Value; onePage.Mode = Convert.ToInt32(Mode.SelectedValue); onePage.UrlAlias = UrlAlias.Value; if (onePage.Mode == 0) { onePage.RawUrl = null; onePage.InitContent = InitContent.Value; } else { onePage.RawUrl = RawUrl.Value; onePage.InitContent = null; } if (onePage.Pkid > 0) { //更改 bll_onePage.Update(onePage); // bll_urlRoute.Update(); WebUtility.ShowAlertMessage("保存成功!", "onePageManage.aspx" + param); } else { //增加 onePage.Content = InitContent.Value; onePage.Inbuilt = true; onePage.Enabled = true; onePage.CreateTime = DateTime.Now.ToString(); bll_onePage.Insert(onePage); // bll_urlRoute.Update(); WebUtility.ShowAlertMessage("新增成功!", Request.RawUrl); } } }