Пример #1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            using (var db = new AGRODataContext(Server.MapPath("\\")))
            {
                Animals a = new Animals
                {
                    AName       = TextBox1.Text,
                    MarketPrice = Convert.ToDouble(TextBox2.Text),
                    Count       = Convert.ToInt32(TextBox3.Text)
                };

                db.Animals.InsertOnSubmit(a);

                try
                {
                    db.SubmitChanges();
                    BindGrid();
                }
                catch (Exception exception)
                {
                    Debug.WriteLine($"Somethig wrong: {exception.Message}");
                }
            }
        }
Пример #2
0
 partial void UpdateAnimals(Animals instance);
Пример #3
0
 partial void DeleteAnimals(Animals instance);
Пример #4
0
 partial void InsertAnimals(Animals instance);