예제 #1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            Abilities a = new Abilities();

            a.Ability = TextBox1.Text;
            db.Abilities.Add(a);
            db.SaveChanges();
            Response.Redirect("Abilities.aspx");
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            int id      = int.Parse(Request.QueryString["Id"]);
            var ability = db.Abilities.Find(id);

            ability.Ability = TextBox1.Text;
            db.SaveChanges();
            Response.Redirect("Abilities.Aspx");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            DbCvEntityEntities db = new DbCvEntityEntities();
            int x       = Convert.ToInt32(Request.QueryString["Id"]);
            var ability = db.Abilities.Find(x);

            db.Abilities.Remove(ability);
            db.SaveChanges();
            Response.Redirect("Abilities.Aspx");
        }
예제 #4
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            Contacts c = new Contacts();

            c.Name    = TextBox1.Text;
            c.Email   = TextBox2.Text;
            c.Topic   = TextBox3.Text;
            c.Message = TextBox4.Text;
            db.Contacts.Add(c);
            db.SaveChanges();
        }