private void button17_Click(object sender, EventArgs e) { BindDataNhanVien(); SMSRepostitory rep = new SMSRepostitory(); WAITER_INFO dt = new WAITER_INFO(); if (FormState == FormBase.FormStateType.New) { dt.NAME = textBox9.Text.Trim(); dt.BIRTHDAY = dateTimePicker2.Value; dt.ADDRESS = textBox8.Text.Trim(); dt.PHONE = textBox6.Text.Trim(); rep.InsertWaiter(dt); } else if (FormState == FormBase.FormStateType.Edit) { dt.Id = PKEY; dt.NAME = textBox9.Text.Trim(); dt.BIRTHDAY = dateTimePicker2.Value; dt.ADDRESS = textBox8.Text.Trim(); dt.PHONE = textBox6.Text.Trim(); rep.UpdateWaiter(dt); } FormState = FormBase.FormStateType.Normal; LoadDataNhanVien(); }