Пример #1
0
 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
         });
     }
 }
Пример #2
0
 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
         });
     }
 }
Пример #3
0
        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
                });
            }
        }
Пример #4
0
        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
                });
            }
        }
Пример #5
0
        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();
        }