void LoadQuotation(Schemas.Product.ProductQuotationInfo quotationInfo) { var companiesNumber = quotationInfo.CompaniesNumberTypes.Count; EnterpriseNameButton.SetTitle(quotationInfo.CompaniesNumberTypes[0].Name, UIControlState.Normal); if (companiesNumber > 0) { companyType = quotationInfo.CompaniesNumberTypes[0]; if (companiesNumber == 1) { EnterpriseNameButton2.Hidden = true; EmpresasView.Hidden = true; TypeNameButton.RemoveTarget((sender, e) => TypeOperationDidTouch((UIButton)TypeNameButton), UIControlEvent.TouchUpInside); } else { EnterpriseNameButton2.Hidden = false; EmpresasView.Hidden = false; } } }
private void ChooseEnterprises() { var optionMenu = UIAlertController.Create(null, "Elegir Opción", UIAlertControllerStyle.ActionSheet); for (int i = 0; i < Product.ProductQuotation.CompaniesNumberTypes.Count; i++) { var companyTypeSelect = Product.ProductQuotation.CompaniesNumberTypes[i]; optionMenu.AddAction(UIAlertAction.Create(companyTypeSelect.Name, UIAlertActionStyle.Default, alert => { companyType = companyTypeSelect; EnterpriseNameButton.SetTitle(companyTypeSelect.Name, UIControlState.Normal); } )); } optionMenu.AddAction(UIAlertAction.Create("Cancelar", UIAlertActionStyle.Cancel, alert => { } )); PresentViewController(optionMenu, true, null); }