Beispiel #1
0
        protected void btn_Save_Click(object sender, EventArgs e)
        {
            DataEntities ent = new DataEntities();

            int id = WS.RequestInt("id");
            Link l = (from ls in ent.Link where ls.ID == id select ls).FirstOrDefault();

            l.Index = txt_Index.Text.ToInt32();
            l.LinkTitle = txt_LinkTitle.Text.TrimDbDangerousChar();
            l.Url = txt_Url.Text.TrimDbDangerousChar();

            if (id <= 0)
            {
                ent.AddToLink(l);
            }
            ent.SaveChanges();
            ent.Dispose();

            CreatePage.GreateIndexPage();

            Js.AlertAndChangUrl("保存成功!","LinkList.aspx");
        }