Exemplo n.º 1
0
        public static BackendEventTypeViewModelItem FromModel(this BackendEventTypeViewModelItem viewmodel, EventType model)
        {
            viewmodel.ID          = model.ID;
            viewmodel.Name        = model.Name;
            viewmodel.Description = model.Description;

            return(viewmodel);
        }
Exemplo n.º 2
0
        public static EventType ToModel(this BackendEventTypeViewModelItem viewmodel)
        {
            EventType model = new EventType();

            model.ID          = viewmodel.ID;
            model.Name        = viewmodel.Name;
            model.Description = viewmodel.Description;

            return(model);
        }
Exemplo n.º 3
0
        public IHttpActionResult Backend_Detail_Insert(BackendEventTypeViewModelItem request)
        {
            BackendEventTypeViewModel viewmodel = new BackendEventTypeViewModel();

            try
            {
                // TODO
            }
            catch (Exception ex)
            {
                return(Error(viewmodel, ex));
            }

            return(Ok(viewmodel));
        }
Exemplo n.º 4
0
        public IHttpActionResult Backend_Detail_Update(Int32 id, BackendEventTypeViewModelItem request)
        {
            BackendEventTypeViewModel viewmodel = new BackendEventTypeViewModel();
            EventTypeDataController   dataCtrl  = new EventTypeDataController();

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

            return(Ok(viewmodel, "Der Eintrag wurde gespeichert."));
        }
Exemplo n.º 5
0
        public static Dictionary <string, InputInformation> GetForm()
        {
            Dictionary <string, InputInformation> result = new Dictionary <string, InputInformation>();

            result.Add("ID", new InputInformation()
            {
                Type = InputInformationType.integer, Readonly = true
            });
            result.Add("Name", new InputInformation()
            {
                Type = InputInformationType.@string, Readonly = true
            });
            result.Add("Volume", new InputInformation()
            {
                Type = InputInformationType.integer, Required = true
            });
            result.Add("Start", new InputInformation()
            {
                Type = InputInformationType.datetime, Required = true
            });
            result.Add("End", new InputInformation()
            {
                Type = InputInformationType.datetime, Required = true
            });
            result.Add("Image", new InputInformation()
            {
                Type = InputInformationType.@string, Required = true
            });
            result.Add("ReservationCost", new InputInformation()
            {
                Type = InputInformationType.integer, Required = true
            });
            result.Add("IsActiveReservation", new InputInformation()
            {
                Type = InputInformationType.boolean
            });
            result.Add("IsActiveCatering", new InputInformation()
            {
                Type = InputInformationType.boolean
            });
            result.Add("IsActiveFeedback", new InputInformation()
            {
                Type = InputInformationType.boolean
            });
            result.Add("IsPrivate", new InputInformation()
            {
                Type = InputInformationType.boolean
            });
            result.Add("FeedbackLink", new InputInformation()
            {
                Type = InputInformationType.@string, Required = true
            });

            result.Add("District", new InputInformation()
            {
                Type = InputInformationType.@string, Required = true
            });
            result.Add("Street", new InputInformation()
            {
                Type = InputInformationType.@string, Required = true
            });
            result.Add("Housenumber", new InputInformation()
            {
                Type = InputInformationType.@string, Required = true
            });
            result.Add("Postcode", new InputInformation()
            {
                Type = InputInformationType.@string, Required = true
            });
            result.Add("City", new InputInformation()
            {
                Type = InputInformationType.@string, Required = true
            });

            result.Add("EventType", new InputInformation()
            {
                Type = InputInformationType.reference, Reference = "EventType", ReferenceForm = Form.GetReferenceForm(BackendEventTypeViewModelItem.GetForm()), Required = true
            });

            return(result);
        }
Exemplo n.º 6
0
 public BackendEventViewModelItem()
 {
     EventType = new BackendEventTypeViewModelItem();
 }