public async Task <IActionResult> Edit(int id, [Bind("ParentId,EnfantId,LienParente,Visible")] Filiation filiation)
        {
            if (id != filiation.ParentId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(filiation);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FiliationExists(filiation.ParentId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EnfantId"] = new SelectList(_context.Enfants, "EnfantId", "EnfantId", filiation.EnfantId);
            ViewData["ParentId"] = new SelectList(_context.Parents, "ParentId", "ParentId", filiation.ParentId);
            return(View(filiation));
        }
Exemple #2
0
 private void ScoreTrigger_OnScoreTrigger(Filiation filiation)
 {
     foreach (var scorePanel in panelsList)
     {
         if (scorePanel.Filiation == filiation)
         {
             scorePanel.IncrementScore();
         }
     }
 }
        public async Task <IActionResult> Create([Bind("ParentId,EnfantId,LienParente,Visible")] Filiation filiation)
        {
            if (ModelState.IsValid)
            {
                _context.Add(filiation);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EnfantId"] = new SelectList(_context.Enfants, "EnfantId", "EnfantId", filiation.EnfantId);
            ViewData["ParentId"] = new SelectList(_context.Parents, "ParentId", "ParentId", filiation.ParentId);
            return(View(filiation));
        }
Exemple #4
0
 public void SetEndGameTextAccordingToWinner(Filiation winner)
 {
     if (winner == Filiation.Player1)
     {
         SetText("Player 1 wins");
     }
     else if (winner == Filiation.Player2)
     {
         SetText("Player 2 wins");
     }
     else
     {
         Debug.LogWarning("[EndGameCanvas] Filiation not supported by function");
     }
 }
Exemple #5
0
 public MessagingStepGridModel(HtmlHelper html, Filiation filiation, GridFilteringModes modes)
 {
     Attributes(@class => "messaging-step");
     Column.For(
         s => html.ActionLink(
             s.Name ?? Resource.Unknown,
             "Details",
             "MessagingStep",
             new RouteValueDictionary(new { id = s.ActivityID }),
             new Dictionary <string, object> {
         { "data-ajax-grid", "true" }
     })
         )
     .Named("Port Name")
     .Sortable(modes.Sortable(), s => s.Name)
     .Filterable(modes.Steppable(), s => s.Name);
     // TODO Column.For(s => s.MessageBody.IsNullOrEmpty() ? null : Html.ActionButton("Save", "Save", "MessagingStep", new { id = s.ActivityID }))
     Column.For(s => html.ActionButton("Download", "Save", "MessagingStep", new { id = s.ActivityID }))
     .Named("Body Action")
     .Encode(false)
     .Sortable(false);
     if (modes.Sortable() && filiation != Filiation.Orphan)
     {
         Column.For(s => html.ActionLink("Process", "Process", "MessagingStep", new { id = s.ActivityID }, null))
         .Named("Go to...")
         .Encode(false)
         .Sortable(false);
     }
     Column.For(s => s.Value1)
     .Named("Value 1")
     .Sortable(modes.Sortable())
     .Filterable(modes.Sortable());
     Column.For(s => s.Value2)
     .Named("Value 2")
     .Sortable(modes.Sortable())
     .Filterable(modes.Sortable());
     Column.For(s => s.Value3)
     .Named("Value 3")
     .Sortable(modes.Sortable())
     .Filterable(modes.Sortable());
     Column.For(s => s.BeginTime.ToLocalTime())
     .Named("Time")
     .Sortable(modes.Sortable(), s => s.BeginTime)
     .Attributes(s => new Dictionary <string, object> {
         { "title", s.Item.BeginTime }
     });
     Column.For(s => s.Status)
     .Sortable(modes.Sortable())
     .Filterable(modes.Sortable());
     Column.For(s => s.MessageSize)
     .Sortable(modes.Sortable());
     Column.For(s => s.FriendlyMessageType)
     .Named("Message Type")
     .Sortable(modes.Sortable(), s => s.MessageType)
     .Attributes(s => new Dictionary <string, object> {
         { "title", s.Item.MessageType }
     })
     .Filterable(modes.Sortable(), s => s.MessageType);
     Column.For(s => s.TransportType)
     .Sortable(modes.Sortable())
     .Filterable(modes.Sortable());
     RenderUsing(new DynamicGridRenderer <MessagingStep>());
 }