public IHttpActionResult Backend_ProductAttribute_Detail_Update(Int32 id, BackendProductAttributeViewModelItem request) { BackendProductAttributeViewModel viewmodel = new BackendProductAttributeViewModel(); CateringProductAttributeDataController dataCtrl = new CateringProductAttributeDataController(); try { var result = dataCtrl.Update(request.ToModel()); } catch (Exception ex) { return(Error(viewmodel, ex)); } return(Ok(viewmodel, "Eintrag wurde gespeichert.")); }
public IHttpActionResult Backend_ProductAttribute_Detail_Insert(BackendProductAttributeViewModelItem request) { BaseViewModel viewmodel = new BaseViewModel(); CateringProductAttributeDataController dataCtrl = new CateringProductAttributeDataController(); try { var result = dataCtrl.Insert(request.ToModel()); } catch (Exception ex) { return(Error(viewmodel, ex)); } return(Ok(viewmodel, "Bestellung wurde aufgenommen.")); }
public IHttpActionResult Backend_ProductAttribute_Detail(Int32 id) { BackendProductAttributeViewModel viewmodel = new BackendProductAttributeViewModel(); CateringProductAttributeDataController dataCtrl = new CateringProductAttributeDataController(); try { viewmodel.Data.FromModel(dataCtrl.GetItem(id)); } catch (Exception ex) { return(Error(viewmodel, ex)); } return(Ok(viewmodel)); }
public IHttpActionResult Backend_ProductAttribute_Get() { BackendProductAttributeListViewModel viewmodel = new BackendProductAttributeListViewModel(); CateringProductAttributeDataController dataCtrl = new CateringProductAttributeDataController(); BackendProductAttributeListArgs args = new BackendProductAttributeListArgs(); try { Int32 TotalItemsCount = 0; viewmodel.FromModel(dataCtrl.FilterList(args, out TotalItemsCount)); viewmodel.Pagination.TotalItemsCount = TotalItemsCount; } catch (Exception ex) { return(Error(viewmodel, ex)); } return(Ok(viewmodel)); }
public IHttpActionResult Backend_Product_Detail_New() { BackendProductViewModel viewmodel = new BackendProductViewModel(); CateringProductAttributeDataController attrDataCtrl = new CateringProductAttributeDataController(); try { foreach (var option in attrDataCtrl.GetItems().OrderBy(x => x.Name)) { viewmodel.AttributeOptions.Add(new BackendProductAttributeViewModelItem().FromModel(option)); } } catch (Exception ex) { return(Error(viewmodel, ex)); } return(Ok(viewmodel)); }