Beispiel #1
0
        private void DeleteTenantButton_Click(object sender, EventArgs e)
        {
            try
            {
                if (TenantGridView.CurrentRow == null || PropertyGridView.CurrentRow == null)
                {
                    return;
                }

                var tenant = (TenantModel)TenantGridView.CurrentRow.DataBoundItem;

                _tenantService.Delete(tenant.Id);

                var property = (PropertyModel)PropertyGridView.CurrentRow.DataBoundItem;

                TenantGridView.DataSource = _tenantService.GetByPropertyId(property.Id);
            }
            catch (Exception)
            {
                //log ex
                MessageBox.Show("System error has occurred", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #2
0
 /// <summary>
 /// 删除租户信息
 /// </summary>
 /// <param name="id"></param>
 public void Delete(string id)
 {
     _tenantService.Delete(id);
 }
        public async Task <IActionResult> DeleteForm(string keyValue)
        {
            await tenantService.Delete(keyValue);

            return(Success("删除成功。"));
        }