void btnSave_Click(object sender, EventArgs e) { noe = new not(); noe.note = this.txtnote.Text; ac.nots.Add(noe); ac.SaveChanges(); this.Close(); MessageBox.Show("successfully!"); }
void Save() { dataEntities db = new dataEntities(); not noe = new not(); noe.note = this.txtnote.Text; db.nots.Add(noe); db.SaveChanges(); this.Close(); MessageBox.Show("successfully!"); }
void listview_DoubleClick(object sender, EventArgs e) { if (listview.SelectedRows.Count == 1) { dataEntities db = new dataEntities(); not noe = new not(); var row = listview.SelectedRows[0]; string cell = (string)row.Cells["note"].Value; Form3 a = new Form3(cell); a.ShowDialog(); if(noe.note!=cell) { delete(); } this.load(); } }
public Form3(string note) { InitializeComponent(); ac = new dataEntities(); noe = ac.nots.Single(st=>st.note==note); }