Create ARAdjusment with Code

hi everybody

i wondering if i can create Adjusment with code, im a trying with this block of code but
got this error:

A valid Transaction Amount is Required

this is my code:

// the amount variable is the adjust amount of one of my invoices…
double amount = 0.580;
EpiTextBox txtKeyField = (EpiTextBox)csm.GetNativeControlReference(“46567b2e-6bc0-4967-be35-a0ec6843838f”);
int InvoiceNum = Convert.ToInt32(txtKeyField.Text);
ARAdjustmentAdapter ARA = new ARAdjustmentAdapter(this.oTrans);
ARA.BOConnect();
ARA.GetNewCashDtl1(InvoiceNum);
ARA.ARAdjustmentData.Tables[“CashDtl”].Rows[0].BeginEdit();
ARA.ARAdjustmentData.Tables[“CashDtl”].Rows[0][“TranAmt”] = amount;
ARA.ARAdjustmentData.Tables[“CashDtl”].Rows[0][“DocTranAmt”] = amount;
ARA.ARAdjustmentData.Tables[“CashDtl”].Rows[0][“Discount”] = amount;
ARA.ARAdjustmentData.Tables[“CashDtl”].Rows[0][“DocDiscount”] = amount;
ARA.ARAdjustmentData.Tables[“CashDtl”].Rows[0][“DocDispTranAmt”] = amount;

	ARA.ARAdjustmentData.Tables["CashDtl"].Rows[0]["DocInvoiceBal"]        = amount;

// ARA.ARAdjustmentData.Tables[“CashDtl”].Rows[ARA.ARAdjustmentData.Tables[“CashDtl”].Rows.Count-1][“TranAmt”] = amount;
// ARA.ARAdjustmentData.Tables[“CashDtl”].Rows[ARA.ARAdjustmentData.Tables[“CashDtl”].Rows.Count-1][“DocTranAmt”] = amount;
ARA.ARAdjustmentData.Tables[“CashDtl”].Rows[0].EndEdit();
ARA.Update();
ARA.Dispose();

thanks in advance