Ejemplo n.º 1
0
        public IHttpActionResult Backend_Product_Detail_Update(Int32 id, BackendProductViewModelItem request)
        {
            BackendProductViewModel       viewmodel = new BackendProductViewModel();
            CateringProductDataController dataCtrl  = new CateringProductDataController();
            CateringProductAttributeRelationDataController relDataCtrl = new CateringProductAttributeRelationDataController();

            try
            {
                var result = dataCtrl.Update(request.ToModel());
                relDataCtrl.UpdateProduct(result, request.Attributes);
            }
            catch (Exception ex)
            {
                return(Error(viewmodel, ex));
            }

            return(Ok(viewmodel, "Eintrag wurde gespeichert."));
        }
Ejemplo n.º 2
0
        public IHttpActionResult Backend_Product_Detail_Insert(BackendProductViewModelItem request)
        {
            BaseViewModel viewmodel = new BaseViewModel();
            CateringProductDataController dataCtrl = new CateringProductDataController();
            CateringProductAttributeRelationDataController relDataCtrl = new CateringProductAttributeRelationDataController();

            try
            {
                var result = dataCtrl.Insert(request.ToModel());
                relDataCtrl.UpdateProduct(result, request.Attributes);
            }
            catch (Exception ex)
            {
                return(Error(viewmodel, ex));
            }

            return(Ok(viewmodel, "Bestellung wurde aufgenommen."));
        }