private void btnDelete_Click(object sender, EventArgs e) { try { if (_Variable == null) { lblMessage.Text = "Silinecek değişkeni seçiniz."; return; } using (IVariableRepository varRepo = new VariableRepository(new Datacore.Data.BeamDeflectionDbContext())) { Variable oldVar = varRepo.Get(x => x.ID == _Variable.ID).Result; var result = varRepo.Delete(oldVar); switch (result.State) { case Basecore.Model.Enums.BusinessResultType.NotSet: lblMessage.Text = result.Message; break; case Basecore.Model.Enums.BusinessResultType.Success: lblMessage.Text = "Başarıyla silindi. Son silinen değişkenin adı : " + oldVar.Name; break; case Basecore.Model.Enums.BusinessResultType.Error: lblMessage.Text = result.Message; break; case Basecore.Model.Enums.BusinessResultType.Warning: lblMessage.Text = result.Message; break; case Basecore.Model.Enums.BusinessResultType.Info: lblMessage.Text = result.Message; break; default: break; } ucEditVariables_Load(sender, e); } } catch (Exception ex) { lblMessage.Text = "Hata : " + ex.GetBaseException(); } }