// обработка нажатия кнопки добавления private async void CreateCostCat(object sender, EventArgs e) { CostCat costCat = new CostCat(); CostCatPage costCatPage = new CostCatPage { BindingContext = costCat }; await Navigation.PushAsync(costCatPage); }
// обработка нажатия элемента в списке private async void OnItemSelected(object sender, SelectedItemChangedEventArgs e) { CostCat selectedCostCat = (CostCat)e.SelectedItem; CostCatPage costCatPage = new CostCatPage { BindingContext = selectedCostCat }; await Navigation.PushAsync(costCatPage); }
public JsonResult Edit(CostCat model) { var apiResult = new APIResult(); try { CostCatBll.AddOrUpdate(model, UserContext.CurrentUser.HotelId); } catch (Exception ex) { apiResult.Ret = -1; apiResult.Msg = ex.Message; if (!(ex is OperationExceptionFacade)) { LogFactory.GetLogger().Log(LogLevel.Error, ex); } } return(Json(apiResult)); }