private void Dgvlist_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { int idcustom = Convert.ToInt32(Dgvlist.Rows[e.RowIndex].Cells[0].Value); cs = context.customerissues.Find(idcustom); lblname.Text = cs.customer_name; lblemail.Text = cs.Customer_email; lblphone.Text = cs.customer_phone; lblbookname.Text = cs.book_name; lblissuedate.Text = cs.book_issue_date.ToString(); lblbookprice.Text = cs.book_price.ToString(); }
private void Btnad_Click(object sender, EventArgs e) { customerissue csm = new customerissue { customer_name = Txt1.Text, customer_surname = Txt2.Text, Customer_email = Txt3.Text, customer_phone = Txt4.Text, book_name = Txt5.Text, book_issue_date = Dt6.Value, book_price = Convert.ToInt32(Txt7.Text), }; context.customerissues.Add(csm); context.SaveChanges(); MessageBox.Show("Info add"); }