private void button_insert_Click(object sender, EventArgs e) { TB_CUST temp = new TB_CUST(); temp.cust_id = textBox1.Text; temp.birth_dt = textBox2.Text; instance.tb_custs.Add(temp); instance.Save(); DataLoad(); }
public void Load() { instance.Query_Select(); tb_custs.Clear(); foreach (DataRow item in instance.ds.Tables[0].Rows) { TB_CUST temp = new TB_CUST(); temp.cust_id = item["CUST_ID"].ToString(); temp.birth_dt = item["BIRTH_DT"].ToString(); tb_custs.Add(temp); } }
private void button_update_Click(object sender, EventArgs e) { try { TB_CUST temp = instance.tb_custs.Single ((x) => x.cust_id.Trim().ToString() == textBox1.Text); //DataManager.tb_custs.Remove(temp); temp.birth_dt = textBox2.Text; instance.Save(); DataLoad(); } catch (Exception ex) { } }
private void button_delete_Click(object sender, EventArgs e) { try { //싱글은 pk 대상으로 해야 함 //값이 두 개 들어 있으면 catch에서 걸림 TB_CUST temp = instance.tb_custs.Single ((x) => x.cust_id.Trim().ToString() == textBox1.Text); instance.tb_custs.Remove(temp); instance.Save(); DataLoad(); } catch (Exception ex) { } }