Esempio n. 1
0
        protected void btn_Save_Click(object sender, EventArgs e)
        {
            DataEntities ent = new DataEntities();
            int id = WS.RequestInt("id");
            UserForm f = (from l in ent.UserForm where l.ID == id select l).FirstOrDefault();
            f.FormName = txt_FormName.Text;
            f.Content = txt_Content.Text.TrimDbDangerousChar();

            if (f.ID <= 0)
            {
                ent.AddToUserForm(f);
            }
            ent.SaveChanges();
            ent.Dispose();

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