示例#1
0
        public async Task LoadAsync(PlaceDetailsArgs args)
        {
            ViewModelArgs = args ?? PlaceDetailsArgs.CreateDefault();

            if (ViewModelArgs.IsNew)
            {
                Item = new PlaceModel();
                Item = await PlaceService.CreateNewPlaceAsync(ViewModelArgs.CustomerID);

                IsEditMode = true;
            }
            else
            {
                try
                {
                    var item = await PlaceService.GetPlaceAsync(ViewModelArgs.PlaceID);

                    Item = item ?? new PlaceModel {
                        PlaceID = ViewModelArgs.PlaceID, IsEmpty = true
                    };
                }
                catch (Exception ex)
                {
                    LogException("Place", "Load", ex);
                }
            }
        }