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 async void ShowUserCurrency() { try { string countryCode = PickerModel.selectedModel.CountryCode; ShowUserCurrencyResponse userCurrencyResponseObj = null; if (IosUtils.IosUtility.IsReachable()) { IosUtility.showProgressHud(""); userCurrencyResponseObj = await WebServiceMethods.GetUserCurrencyFromCountryCode(countryCode); InvokeOnMainThread(() => { if (userCurrencyResponseObj != null && !string.IsNullOrEmpty(userCurrencyResponseObj.CurrencyName)) { TxtCurrency.Text = userCurrencyResponseObj.CurrencyName; } }); IosUtility.hideProgressHud(); } } catch (Exception e) { IosUtility.hideProgressHud(); IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"), IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSUnknownError", "LSErrorTitle")); } }
async void SaveRecord() { try { if (IosUtils.IosUtility.IsReachable()) { IosUtils.IosUtility.showProgressHud(""); bool isLedgerSaved = await WebServiceMethods.SaveLedgerOrdersNew(SuperVC.LedgerOrderObj); IosUtility.hideProgressHud(); if (!isLedgerSaved) { IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"), IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSUnknownError", "LSErrorTitle")); } else { SuperVC.NavigationController.PopViewController(true); } } } catch (Exception e) { IosUtility.hideProgressHud(); IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"), IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSUnknownError", "LSErrorTitle")); } }
void ConfigureView() { if (SuperVC.LedgerOrderObj.LedgerOrderItems == null) { SuperVC.LedgerOrderObj.LedgerOrderItems = new List <LedgerOrderItem>(); } ContntTbl.RegisterNibForCellReuse(AddOrderSecondTVCell.Nib, AddOrderSecondTVCell.Key); ContntTbl.TableFooterView = new UIView(); ContntTbl.EstimatedRowHeight = HeightConstants.CellHeight70; ContntTbl.RowHeight = UITableView.AutomaticDimension; ContntTbl.ReloadData(); IosUtility.setcornerRadius(BtnAdd); IosUtility.setcornerRadius(BtnNext); }
async void GetTaxTypes() { try { if (IosUtils.IosUtility.IsReachable() && PickerModel != null) { IosUtils.IosUtility.showProgressHud(""); TaxTypeResponseList = await Webservices.WebServiceMethods. ShowTaxRates( string.IsNullOrEmpty(PickerModel.selectedModel.CountryCode)? ConutryCode : PickerModel.selectedModel.CountryCode); IosUtility.hideProgressHud(); if (TaxTypeResponseList != null && TaxTypeResponseList.Count > 0) { //var temp = TaxTypeResponseList.Where(a => a.TaxID == TaxId).FirstOrDefault(); //SelectedTax = temp; //if (SelectedTax == null && isTaxEdit) //{ // SelectedTax = TaxTypeResponseList[0]; //} SelectedTax = TaxTypeResponseList[0]; TaxPickerModel = new TaxTypePickerModel(TaxTypeResponseList, TxtTaxType, SelectedTax); TaxtTypePicker.Model = TaxPickerModel; CalculateVat(); } else { IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"), IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSUnknownError", "LSErrorTitle")); } } } catch (Exception e) { IosUtility.hideProgressHud(); IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"), IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSUnknownError", "LSErrorTitle")); } }
public async Task CallWebserviceForOrdersList() { try { if (IosUtility.IsReachable()) { IosUtility.showProgressHud(""); var ledgerOrderItemList = await WebServiceMethods.GetLedgerOrderItems(LedgerOrderObj.CompCode, LedgerOrderObj.JournalNo); LedgerOrderObj.LedgerOrderItems = ledgerOrderItemList; IosUtility.hideProgressHud(); } } catch (Exception ex) { IosUtility.hideProgressHud(); IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"), IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSUnknownError", "LSErrorTitle")); } }
public async void CallWebserviceForOrdersList() { try { if (IosUtility.IsReachable()) { IosUtility.showProgressHud(""); ledgerOrderList = await WebServiceMethods.GetOrders(Settings.UserId, IBStartDateTxt.Text, IBEndDateTxt.Text); IBContntTbl.ReloadData(); IosUtility.hideProgressHud(); } } catch (Exception ex) { IosUtility.hideProgressHud(); IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"), IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSUnknownError", "LSErrorTitle")); } }
async void GetAccountCodes() { try { if (IosUtils.IosUtility.IsReachable()) { IosUtils.IosUtility.showProgressHud(""); accountOrderResponseList = await Webservices.WebServiceMethods.GetAccountForOrders(); IosUtility.hideProgressHud(); if (accountOrderResponseList != null && accountOrderResponseList.Count > 0) { var temp = accountOrderResponseList.Where(a => a.AccountId == SuperVC.LedgerOrderObj.AccountId).FirstOrDefault(); SelectedAccount = temp; if (SelectedAccount == null) { SelectedAccount = accountOrderResponseList[0]; } PickerModel = new AccountOrderPickerModel(accountOrderResponseList, TxtSelectAcoountTilte, SelectedAccount); IBAccountPicker.Model = PickerModel; ShowAccountAddress(); ShowUserCurrency(); } else { IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"), IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSUnknownError", "LSErrorTitle")); } } } catch (Exception e) { IosUtility.hideProgressHud(); IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"), IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSUnknownError", "LSErrorTitle")); } }
async void GetRevenueAccount() { try { if (IosUtils.IosUtility.IsReachable()) { IosUtils.IosUtility.showProgressHud(""); revenueAccountResponseList = await Webservices.WebServiceMethods.GetRevenueOrders(compCode); IosUtility.hideProgressHud(); if (revenueAccountResponseList != null && revenueAccountResponseList.Count > 0) { var temp = revenueAccountResponseList.Where(a => a.AccountId == AccountId).FirstOrDefault(); SelectedAccount = temp; if (SelectedAccount == null) { SelectedAccount = revenueAccountResponseList[0]; } PickerModel = new AccountOrderPickerModel(revenueAccountResponseList, TxtRevenue, SelectedAccount); RevenuePicker.Model = PickerModel; isTaxEdit = false; GetTaxTypes(); } else { IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"), IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSUnknownError", "LSErrorTitle")); } } } catch (Exception e) { IosUtility.hideProgressHud(); IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"), IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSUnknownError", "LSErrorTitle")); } }