private void toolDelete_Click(object sender, EventArgs e) { if (PKEY == null) { MessageBox.Show("Bạn chưa chọn đối tượng nào", "Cảnh báo"); } if (MessageBox.Show("Bạn có chắc muốn xóa không?", "Xác nhận xóa", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) { SMSRepostitory rep = new SMSRepostitory();; List<Guid> lst = new List<Guid>(); lst.Add(PKEY); rep.DeleteDishType(PKEY); LoadData(); } }
private void toolSave_Click(object sender, EventArgs e) { SMSRepostitory rep = new SMSRepostitory();; DISH_TYPE dt = new DISH_TYPE(); if (FormState == FormStateType.New) { dt.NAME = txtNAME.Text.Trim(); rep.InsertDishType(dt); } else if (FormState == FormStateType.Edit) { dt.Id = PKEY; dt.NAME=txtNAME.Text.Trim(); rep.UpdateDishType(dt); } FormState = FormStateType.Normal; ChangeControlStatus(); LoadData(); }
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(); }
private void button24_Click(object sender, EventArgs e) { BindDataMonAn(); SMSRepostitory rep = new SMSRepostitory(); DISH dt = new DISH(); if (FormState == FormBase.FormStateType.New) { dt.CODE = int.Parse(textBox10.Text); dt.NAME_VN = textBox11.Text; dt.NAME_EN = textBox12.Text; dt.PRICE = decimal.Parse(textBox13.Text); dt.DISHTYPE_ID = PKEY1; rep.InsertDish(dt); } else if (FormState == FormBase.FormStateType.Edit) { dt.Id = PKEY; dt.CODE = int.Parse(textBox10.Text); dt.NAME_VN = textBox11.Text; dt.NAME_EN = textBox12.Text; dt.PRICE = decimal.Parse(textBox13.Text); dt.DISHTYPE_ID = PKEY1; rep.UpdateDish(dt); } FormState = FormBase.FormStateType.Normal; // LoadDataThucDonMau(); LoadDataMonAn(); }
private void button15_Click(object sender, EventArgs e) { BindDataDauBep(); SMSRepostitory rep = new SMSRepostitory(); CHEF_INFO dt = new CHEF_INFO(); if (FormState == FormBase.FormStateType.New) { dt.NAME = textBox7.Text.Trim(); dt.BIRTHDAY = dateTimePicker1.Value; dt.ADDRESS = textBox4.Text.Trim(); dt.PHONE = textBox5.Text.Trim(); rep.InsertCheft(dt); } else if (FormState == FormBase.FormStateType.Edit) { dt.Id = PKEY; dt.NAME = textBox7.Text.Trim(); dt.BIRTHDAY = dateTimePicker1.Value; dt.ADDRESS = textBox4.Text.Trim(); dt.PHONE = textBox5.Text.Trim(); rep.UpdateChef(dt); } FormState = FormBase.FormStateType.Normal; LoadDataDauBep(); }