private void BtnUpdateCredits_Click(object sender, EventArgs e) { try { credits.CreditId = Int32.Parse(txtCreditId.Text.ToString()); credits.Amount = double.Parse(txtCreditAmount.Text.ToString()); credits.Rate = double.Parse(txtCreditRate.Text.ToString()); credits.Name = txtCreditName.Text.ToString(); credits.Fee = double.Parse(txtCreditFee.Text.ToString()); credits.StartDate = DateTime.Parse(CreditStartDate.Value.ToString()); credits.Status = ComboBoxStatus.SelectedItem.ToString(); credits.OperationalBalance = double.Parse(txtOperationalBalance.Text.ToString()); credits.FK_CUSTOMER_ID = txtFkCustomerId.Text.ToString(); mngCre.Update(credits); dataGridCredits.Rows.Clear(); dataGridCustomers.Rows.Clear(); CreditsForm_Load(null, null); MessageBox.Show("Hey updated here my man"); } catch (Exception ex) { MessageBox.Show("Missing Values" + ex); } }
// PUT: api/Credit/5 public IHttpActionResult Put(Credit credit) { try { var credMng = new CreditMangement(); credMng.Update(credit); apiResponse.Message = "Credit was updated"; return(Ok(apiResponse)); } catch (BusinessException bex) { return(InternalServerError(new Exception(bex.ExceptionId + "--" + bex.AppMessage.Message))); } }