コード例 #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            DBDataContext DB = new DBDataContext();

            AB w = new AB();

            w.Book_Id   = textBox2.Text;
            w.Book_Name = textBox1.Text;
            w.Quantity  = textBox3.Text;

            DB.ABs.InsertOnSubmit(w);
            DB.SubmitChanges();
            MessageBox.Show("Book Added!!");
        }
コード例 #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            DBDataContext DB = new DBDataContext();
            string        id = textBox2.Text;
            AB            s  = DB.ABs.SingleOrDefault(x => x.Book_Id == id);

            if (s != null)
            {
                s.Book_Id   = textBox2.Text;
                s.Book_Name = textBox1.Text;
                s.Quantity  = textBox3.Text;
                DB.SubmitChanges();
                MessageBox.Show("Information Updated!!");
            }
        }
コード例 #3
0
        private void button3_Click(object sender, EventArgs e)
        {
            DBDataContext DB = new DBDataContext();

            string id = textBox2.Text;
            AB     s  = DB.ABs.SingleOrDefault(x => x.Book_Id == id);

            if (s != null)
            {
                textBox1.Text = s.Book_Name;
                textBox3.Text = s.Quantity;
            }
            else
            {
                MessageBox.Show("Data not found");
            }
        }
コード例 #4
0
 partial void DeleteAB(AB instance);
コード例 #5
0
 partial void UpdateAB(AB instance);
コード例 #6
0
 partial void InsertAB(AB instance);