private void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                using (ICalculationRepository calRepo = new CalculationRepository(new BeamDeflectionDbContext()))
                {
                    BeamDeflection.Domain.Model.BeamDeflectionDb.Calculation oldCal = calRepo.Get(x => x.ID == _Calculation.ID).Result;
                    if (oldCal == null)
                    {
                        lblMessage.Text = "Silmek istediğiniz hesaplamayı seçiniz.";
                        return;
                    }
                    var result = calRepo.Delete(oldCal);
                    switch (result.State)
                    {
                    case Basecore.Model.Enums.BusinessResultType.NotSet:
                        lblMessage.Text = result.Message;
                        break;

                    case Basecore.Model.Enums.BusinessResultType.Success:
                        lblMessage.Text = "Silme işlemi başarılı.";
                        ucEditCalculations_Load(sender, e);
                        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;
                    }
                }
            }
            catch (Exception ex)
            {
                lblMessage.Text = "Hata : " + ex.GetBaseException();
            }
        }
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            if (_User == null)
            {
                lblMessage.Text = "Kullanıcı seçin";
                return;
            }
            if (_Load == null)
            {
                lblMessage.Text = "Yük tipi seçin";
                return;
            }
            if (_Unit == null)
            {
                lblMessage.Text = "Birim seçin";
                return;
            }
            if (_Calculation == null)
            {
                lblMessage.Text = "Hesaplama seçin";
                return;
            }
            try
            {
                using (ICalculationRepository calRepo = new CalculationRepository(new BeamDeflectionDbContext()))
                {
                    BeamDeflection.Domain.Model.BeamDeflectionDb.Calculation newCal = calRepo.Get(x => x.ID == _Calculation.ID, "Load", "AppUser", "Unit").Result;
                    newCal.IsActive  = chkIsActive.Checked;
                    newCal.IsDeleted = chkIsDeleted.Checked;
                    newCal.LoadId    = ((Load)cmbLoads.SelectedItem).ID;
                    newCal.UnitId    = ((Unit)cmbUnits.SelectedItem).ID;
                    newCal.UserId    = ((ApplicationUser)cmbUsers.SelectedItem).ID;
                    newCal.Result    = Convert.ToDouble(txtResult.Text);
                    newCal.UpdatedAt = DateTime.UtcNow;
                    var result = calRepo.Update(newCal);

                    switch (result.State)
                    {
                    case Basecore.Model.Enums.BusinessResultType.NotSet:
                        lblMessage.Text = result.Message;
                        break;

                    case Basecore.Model.Enums.BusinessResultType.Success:
                        lblMessage.Text = "Düzenleme başarılı. Son düzenlenen hesaplama sonucu : " + result.Result.Result;
                        ucEditCalculations_Load(sender, e);
                        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;
                    }
                }
            }
            catch (Exception ex)
            {
                lblMessage.Text = "Hata : " + ex.GetBaseException();
            }
        }