Beispiel #1
0
        protected async override void Add()
        {
            CRUDType  = CRUDType.Adding;
            CRUDState = CRUDCardState.Busy;
            await Task.Delay(2000);

            await DataAccess.AddAsset(NewItem);

            SelectedItem = NewItem;
            CRUDState    = CRUDCardState.Default;
        }
Beispiel #2
0
        protected async override void Duplicate()
        {
            CRUDType  = CRUDType.Copying;
            CRUDState = CRUDCardState.Busy;
            Asset newItem = new Asset();

            newItem.AssetCategory = new AssetCategory();
            DataAccess.CopyProperties(typeof(Asset), newItem, SelectedItem);
            newItem.Id = 0;
            await DataAccess.AddAsset(newItem);

            SelectedIndex = DataAccess.Assets.Count - 1;
            CRUDState     = CRUDCardState.Default;
        }