protected void dodaj_Click(object sender, EventArgs e) { if (fname.Text == "" || lname.Text == "" || address.Text == "") { error.Text = "Insert values!"; return; } var a = from ow in db.owners select ow.owner_id; owner o = new owner(); o.fname = fname.Text; o.lname = lname.Text; o.address = address.Text; o.owner_id = a.Max() + 1; db.owners.InsertOnSubmit(o); db.SubmitChanges(); Response.Redirect("Dog.aspx"); }
partial void Deleteowner(owner instance);
partial void Updateowner(owner instance);
partial void Insertowner(owner instance);