Exemplo n.º 1
0
        public IActionResult Delete(int?id)
        {
            ActionResult <Schedule> schedule = _business.GetById(id);

            if (schedule.Value == null)
            {
                return(NotFound("Consulta não encontrada"));
            }
            _business.Delete(schedule.Value);
            return(Ok());
        }
Exemplo n.º 2
0
        private void repositoryItemDelete_Click(object sender, EventArgs e)
        {
            if (gridView1.FocusedRowHandle == GridControl.NewItemRowHandle)
            {
                return;
            }


            if (XtraMessageBox.Show(this, "Bạn chắn chắn xóa dòng này?", "Thông báo", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
            {
                var  row    = gridView1.GetFocusedDataRow();                           // get data on one row
                bool result = schedulueBusiness.Delete((int)row["PatientScheduleID"]); // delete in schedule paramater (datatype)row["ScheduleID"]
                if (result)
                {
                    gridView1.DeleteSelectedRows();
                }
                else
                {
                    XtraMessageBox.Show(this, "Xóa thất bại", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Exemplo n.º 3
0
 public Result Delete(int id)
 {
     return(_scheduleBusiness.Delete(id));
 }