Ejemplo n.º 1
0
 public BackendCateringViewModelItem()
 {
     Event  = new BackendEventViewModelItem();
     User   = new BackendUserViewModelItem();
     Order  = new List <BackendCateringOrderItem>();
     Status = new BackendCateringStatusOption(1);
 }
Ejemplo n.º 2
0
 public BackendTournamentViewModelItem()
 {
     Event  = new BackendEventViewModelItem();
     Game   = new BackendGameViewModelItem();
     Player = new List <BackendUserViewModelItem>();
     Teams  = new List <BackendTournamentTeamViewModelItem>();
 }
Ejemplo n.º 3
0
        public IHttpActionResult Backend_Detail_Update(Int32 id, BackendEventViewModelItem request)
        {
            BackendEventViewModel viewmodel = new BackendEventViewModel();
            EventDataController   dataCtrl  = new EventDataController();

            try
            {
                dataCtrl.Update(request.ToModel());
            }
            catch (Exception ex)
            {
                return(Error(viewmodel, ex));
            }

            return(Ok(viewmodel, "Eintrag wurde gespeichert."));
        }
Ejemplo n.º 4
0
        public IHttpActionResult Backend_Detail_Insert(BackendEventViewModelItem request)
        {
            BackendEventViewModel viewmodel = new BackendEventViewModel();
            EventDataController   dataCtrl  = new EventDataController();

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

            return(Ok(viewmodel, "Eintrag wurde gespeichert."));
        }
Ejemplo n.º 5
0
        public static Event ToModel(this BackendEventViewModelItem viewmodel)
        {
            Event model = new Event();

            model.ID                  = viewmodel.ID;
            model.EventTypeID         = viewmodel.EventType.ID;
            model.Volume              = viewmodel.Volume;
            model.Image               = viewmodel.Image;
            model.Start               = viewmodel.Start;
            model.End                 = viewmodel.End;
            model.ReservationCost     = viewmodel.ReservationCost;
            model.IsActiveReservation = viewmodel.IsActiveReservation;
            model.IsActiveCatering    = viewmodel.IsActiveCatering;
            model.IsActiveFeedback    = viewmodel.IsActiveFeedback;
            model.IsPrivate           = viewmodel.IsPrivate;
            model.FeedbackLink        = viewmodel.FeedbackLink;
            model.District            = viewmodel.District;
            model.Street              = viewmodel.Street;
            model.Housenumber         = viewmodel.Housenumber;
            model.Postcode            = viewmodel.Postcode;
            model.City                = viewmodel.City;

            return(model);
        }
Ejemplo n.º 6
0
        public static BackendEventViewModelItem FromModel(this BackendEventViewModelItem viewmodel, Event model)
        {
            viewmodel.ID                  = model.ID;
            viewmodel.Name                = model.EventType.Name + " Vol." + model.Volume;
            viewmodel.Volume              = model.Volume;
            viewmodel.Image               = model.Image;
            viewmodel.Start               = model.Start;
            viewmodel.End                 = model.End;
            viewmodel.ReservationCost     = model.ReservationCost;
            viewmodel.IsActiveReservation = model.IsActiveReservation;
            viewmodel.IsActiveCatering    = model.IsActiveCatering;
            viewmodel.IsActiveFeedback    = model.IsActiveFeedback;
            viewmodel.IsPrivate           = model.IsPrivate;
            viewmodel.FeedbackLink        = model.FeedbackLink;
            viewmodel.District            = model.District;
            viewmodel.Street              = model.Street;
            viewmodel.Housenumber         = model.Housenumber;
            viewmodel.Postcode            = model.Postcode;
            viewmodel.City                = model.City;

            viewmodel.EventType.FromModel(model.EventType);

            return(viewmodel);
        }
Ejemplo n.º 7
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("ChallongeLink", new InputInformation()
            {
                Type = InputInformationType.@string
            });
            result.Add("Mode", new InputInformation()
            {
                Type = InputInformationType.@string, Required = true
            });
            result.Add("TeamSize", 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
            });

            result.Add("Event", new InputInformation()
            {
                Type = InputInformationType.reference, Reference = "Event", ReferenceForm = Form.GetReferenceForm(BackendEventViewModelItem.GetForm()), Required = true
            });
            result.Add("Game", new InputInformation()
            {
                Type = InputInformationType.reference, Reference = "Game", ReferenceForm = Form.GetReferenceForm(BackendGameViewModelItem.GetForm()), Required = true
            });
            result.Add("Player", new InputInformation()
            {
                Type = InputInformationType.referenceButton, Reference = "User", ReferenceForm = Form.GetReferenceForm(BackendUserViewModelItem.GetForm())
            });
            result.Add("Teams", new InputInformation()
            {
                Type = InputInformationType.referenceButton, Reference = "Team", ReferenceForm = Form.GetReferenceForm(BackendTournamentTeamViewModelItem.GetForm())
            });

            return(result);
        }
Ejemplo n.º 8
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("ReservationDate", new InputInformation()
            {
                Type = InputInformationType.datetime, Required = true
            });
            result.Add("ReservationState", new InputInformation()
            {
                Type = InputInformationType.choice, Required = true
            });
            result.Add("Description", new InputInformation()
            {
                Type = InputInformationType.@string
            });
            result.Add("IsPayed", new InputInformation()
            {
                Type = InputInformationType.boolean
            });

            result.Add("User", new InputInformation()
            {
                Type = InputInformationType.reference, Reference = "User", ReferenceForm = Form.GetReferenceForm(BackendUserViewModelItem.GetForm()), Required = true
            });
            result.Add("TransferUser", new InputInformation()
            {
                Type = InputInformationType.reference, Reference = "TransferUser", ReferenceForm = Form.GetReferenceForm(BackendUserViewModelItem.GetForm())
            });
            result.Add("Event", new InputInformation()
            {
                Type = InputInformationType.reference, Reference = "Event", ReferenceForm = Form.GetReferenceForm(BackendEventViewModelItem.GetForm()), Required = true, Readonly = true
            });

            return(result);
        }
Ejemplo n.º 9
0
 public BackendSeatingViewModelItem()
 {
     User  = new BackendUserViewModelItem();
     Event = new BackendEventViewModelItem();
 }
Ejemplo n.º 10
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("Status", new InputInformation()
            {
                Type = InputInformationType.choice, Required = true
            });
            result.Add("SeatNumber", new InputInformation()
            {
                Type = InputInformationType.integer, Required = true, Readonly = true
            });
            result.Add("Event", new InputInformation()
            {
                Type = InputInformationType.reference, Reference = "Event", ReferenceForm = Form.GetReferenceForm(BackendEventViewModelItem.GetForm()), Required = true, Readonly = true
            });
            result.Add("User", new InputInformation()
            {
                Type = InputInformationType.reference, Reference = "User", ReferenceForm = Form.GetReferenceForm(BackendUserViewModelItem.GetForm()), Required = true, Readonly = true
            });
            result.Add("Note", new InputInformation()
            {
                Type = InputInformationType.text
            });
            result.Add("Registered", new InputInformation()
            {
                Type = InputInformationType.datetime, Readonly = true
            });

            return(result);
        }