protected void btn_Submit_Click(object sender, EventArgs e) { Link LinkItem = new Link(); LinkItem.LinkName = txt_link_name.Value; LinkItem.LinkUrl = txt_link_site_url.Value; LinkItem.SortId = Convert.ToInt32(txt_sortid.Value); if (Id == 0) { //添加 if (LinkBiz.AddLink(LinkItem) > 0) { base.ErrorMsg("提交成功!", "FriendLinkList.aspx", 1); } else { base.ErrorMsg("提交失败!", "FriendLinkList.aspx", 0); } } else { //修改 LinkItem.Id = Id; if (LinkBiz.UpdateLink(LinkItem) > 0) { base.ErrorMsg("提交成功!", "FriendLinkList.aspx", 1); } else { base.ErrorMsg("提交失败!", "FriendLinkList.aspx", 0); } } }
protected void SubmitButton_Click(object sender, EventArgs e) { LinkInfo link = new LinkInfo(); link.ID = RequestHelper.GetQueryString <int>("ID"); link.LinkClass = Convert.ToInt32(this.LinkClass.Text); if (link.LinkClass == 1) { link.Display = this.TextDisplay.Text; } else { link.Display = this.PictureDisplay.Text; } link.URL = this.URL.Text; link.Remark = this.Remark.Text; string alertMessage = ShopLanguage.ReadLanguage("AddOK"); if (link.ID == -2147483648) { base.CheckAdminPower("AddLink", PowerCheckType.Single); int id = LinkBLL.AddLink(link); AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("Link"), id); } else { base.CheckAdminPower("UpdateLink", PowerCheckType.Single); LinkBLL.UpdateLink(link); AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("UpdateRecord"), ShopLanguage.ReadLanguage("Link"), link.ID); alertMessage = ShopLanguage.ReadLanguage("UpdateOK"); } AdminBasePage.Alert(alertMessage, RequestHelper.RawUrl); }
protected void SubmitButton_Click(object sender, EventArgs e) { LinkInfo link = new LinkInfo(); link.ID = RequestHelper.GetQueryString <int>("ID"); link.LinkClass = 1; link.Display = TextDisplay.Text; link.URL = URL.Text; link.Remark = Remark.Text; string alertMessage = ShopLanguage.ReadLanguage("AddOK"); if (link.ID == int.MinValue) { CheckAdminPower("AddLink", PowerCheckType.Single); int id = LinkBLL.AddLink(link); AdminLogBLL.Add(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("Link"), id); } else { CheckAdminPower("UpdateLink", PowerCheckType.Single); LinkBLL.UpdateLink(link); AdminLogBLL.Add(ShopLanguage.ReadLanguage("UpdateRecord"), ShopLanguage.ReadLanguage("Link"), link.ID); alertMessage = ShopLanguage.ReadLanguage("UpdateOK"); } ScriptHelper.Alert(alertMessage, RequestHelper.RawUrl); }