partial void BtnOkClicked(Foundation.NSObject sender) { try { ledgerItem = new LedgerOrderItem(); ledgerItem.LineDescription = TxtDescription.Text; ledgerItem.BaseAmount = Convert.ToDecimal(TxtAmount.Text); ledgerItem.TaxAmount = Convert.ToDecimal(TxtVat.Text); ledgerItem.CompCode = SelectedAccount.CompCode; ledgerItem.AccountCode = SelectedAccount.AccountCode; ledgerItem.AccountId = SelectedAccount.AccountId; ledgerItem.AccountName = SelectedAccount.AccountName; // Add extra field ledgerItem.TaxCode = " "; ledgerItem.ProcessedBy = Convert.ToInt32(Settings.UserId); ledgerItem.TransactionReference = " "; if (ItemAdded != null) { ItemAdded(ledgerItem, null); } this.DismissViewController(true, null); } catch (Exception e) { IosUtility.hideProgressHud(); IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"), IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSUnknownError", "LSErrorTitle")); } }
private void Btn_save_Click(object sender, EventArgs e) { try { LedgerOrderItem model = new LedgerOrderItem(); model.LineDescription = edt_item_desc_val.Text; model.BaseAmount = Convert.ToDecimal(edt_amount_val.Text); model.TaxAmount = Convert.ToDecimal(edt_vat_val.Text); model.CompCode = revAccOrderResponseObj.CompCode; model.AccountCode = revAccOrderResponseObj.AccountCode; model.AccountId = revAccOrderResponseObj.AccountId; model.AccountName = revAccOrderResponseObj.AccountName; // Add extra field model.TaxCode = " "; model.ProcessedBy = Convert.ToInt32(mSharedPreferencesManager. GetString(ConstantsDroid.USER_ID_PREFERENCE, "0")); model.TransactionReference = " "; secondFragment.AddLedgerOrderItem(model, itemPos); Dismiss(); } catch (Exception ex) { Console.Write(ex.StackTrace); } }
public void configure(LedgerOrderItem data, int index) { Index = index; LblAccountNameValue.Text = data.AccountName; LblTaxValue.Text = data.TaxAmount.ToString(); LblItemTitle.Text = data.LineDescription; LblBaseAmountValue.Text = data.BaseAmount.ToString(); }
public override void OnActivityCreated(Bundle savedInstanceState) { base.OnActivityCreated(savedInstanceState); edt_item_desc_val = mView.FindViewById <EditText>(Resource.Id.edt_item_desc_val); edt_amount_val = mView.FindViewById <EditText>(Resource.Id.edt_amount_val); edt_vat_val = mView.FindViewById <EditText>(Resource.Id.edt_vat_val); btn_save = mView.FindViewById <Button>(Resource.Id.btn_save); btn_cancel = mView.FindViewById <Button>(Resource.Id.btn_cancel); spin_revenue_account_val = mView.FindViewById <Spinner>(Resource.Id.spin_revenue_account_val); spin_tax_rates_val = mView.FindViewById <Spinner>(Resource.Id.spin_tax_rates_val); img_delete = mView.FindViewById <ImageView>(Resource.Id.img_delete); btn_save.Click += Btn_save_Click; btn_cancel.Click += Btn_cancel_Click; img_delete.Click += Img_delete_Click; edt_amount_val.TextChanged += Edt_amount_val_TextChanged; itemPos = Arguments.GetInt("itemPos", -1); isEditOrderItem = Arguments.GetBoolean("isEditOrderItem", false); string ledgerOrderLineItemString = Arguments.GetString("ledgerOrderLineItem", null); if (isEditOrderItem && !string.IsNullOrEmpty(ledgerOrderLineItemString)) { ledgerObj = secondFragment.GetLedgerOrderObj(); ledgerOrderItemObj = JsonConvert.DeserializeObject <LedgerOrderItem>(ledgerOrderLineItemString); if (ledgerOrderItemObj != null) { edt_item_desc_val.Text = ledgerOrderItemObj.LineDescription; edt_amount_val.Text = string.Format("{0:F2}", ledgerOrderItemObj.BaseAmount); edt_vat_val.Text = string.Format("{0:F2}", ledgerOrderItemObj.TaxAmount); InitRevenueAccountSpinnerValues(ledgerOrderItemObj.CompCode); } } else { ledgerObj = secondFragment.GetLedgerOrderObj(); InitRevenueAccountSpinnerValues(ledgerObj.CompCode); } // Set View Enability bool inEditMode = Arguments.GetBoolean("inEditMode", false); ShowViewEnablibity(inEditMode); }
public void AddLedgerOrderItem(LedgerOrderItem ledgerOrderItemModel, int pos) { try { if (pos == -1) { ledgerOrderItemLst.Add(ledgerOrderItemModel); InitializeAdapter(); } else { ledgerOrderItemLst[pos] = ledgerOrderItemModel; mAdapter.NotifyDataSetChanged(); } } catch (Exception e) { } }
void ConfigureView() { if (ledgerItem == null) { ledgerItem = new LedgerOrderItem(); } else { TxtDescription.Text = ledgerItem.LineDescription; TxtAmount.Text = ledgerItem.BaseAmount.ToString(); } IosUtils.IosUtility.setcornerRadius(BtnOk); IosUtils.IosUtility.setcornerRadius(BtnCancel); TxtRevenue.InputView = RevenuePicker; TxtRevenue.InputAccessoryView = RevenueDoneBar; TxtTaxType.InputView = TaxtTypePicker; TxtTaxType.InputAccessoryView = TaxTypeDoneBar; TxtAmount.InputAccessoryView = AmountDoneBar; ShouldEdit(); GetRevenueAccount(); }