public object DeleteWidget([FromBody] WidgetUpdateParam PM) { try { WidgetBusiness b = new WidgetBusiness(); var Result = b.DeleteWidget(PM); return(Result); } catch (Exception e) { return(new Error() { IsError = true, Message = e.Message }); } }
public object AddWidget([FromBody] WidgetParam obj) { try { WidgetBusiness save = new WidgetBusiness(); var result = save.SaveWidget(obj); return(result); } catch (Exception e) { return(new Error() { IsError = true, Message = e.Message }); } }
public object UpdateWidget(WidgetUpdateParam b) { try { WidgetBusiness type = new WidgetBusiness(); var Result = type.WidgetUpdate(b); return(Result); } catch (Exception e) { return(new Error() { IsError = true, Message = e.Message }); } }
public object GetWidgetInfo(UserCredential uc) { try { WidgetBusiness widget = new WidgetBusiness(); var Result = widget.GetWidget(uc); return(Result); } catch (Exception e) { return(new Error() { IsError = true, Message = e.Message }); } }
public MainWindowViewModel() { _widgetBusiness = new WidgetBusiness(); Widgets = new ObservableCollection <Widget>(_widgetBusiness.AllWidgets()); if (Widgets.Any()) { SelectedWidget = Widgets[0]; } ButtonSellCommand = new RelayCommand(new Action <object>(SellWidgets)); ButtonBuyCommand = new RelayCommand(new Action <object>(BuyWidgets)); ButtonAddCommand = new RelayCommand(new Action <object>(AddWidget)); ButtonEditCommand = new RelayCommand(new Action <object>(EditWidget)); ButtonDeleteCommand = new RelayCommand(new Action <object>(DeleteWidget)); ButtonQuitCommand = new RelayCommand(new Action <object>(QuitWidget)); WidgetToAdd = new Widget(); WidgetToEdit = SelectedWidget.Copy(); }