public async Task <ActionResult <Liaison> > PostLiaison(Liaison liaison)
        {
            _context.liaisons.Add(liaison);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetLiaison", new { id = liaison.Id }, liaison));
        }
 public void TouchHold(Vector3 pCo)
 {
     if (HaveLiason)
     {
         Liaison.CellCs().SetCurrPosi(pCo, -20f);    // Outside .. Follow Touch Position.
     }
 }
        public async Task <IActionResult> PutLiaison(int id, Liaison liaison)
        {
            if (id != liaison.Id)
            {
                return(BadRequest());
            }

            _context.Entry(liaison).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!LiaisonExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
 public static CampaignStaffViewModel CampaignContactSummaryFrom(Liaison source, char committeeID)
 {
     if (source == null)
     {
         source = new Liaison(0);
     }
     return(new CampaignStaffViewModel
     {
         CommitteeID = committeeID,
         ID = source.ID,
         Name = PersonNameFrom(source),
         ContactType = source.LiaisonType
     });
 }
Exemple #5
0
 /// <summary>
 /// Gets the ID for a campaign liaison.
 /// </summary>
 /// <param name="l">The <see cref="Liaison"/> to examine.</param>
 /// <param name="c">The <see cref="Committee"/> for which <paramref name="l"/> is a liaison.</param>
 /// <returns>An identifier for liaison <paramref name="l"/>.</returns>
 private string GetLiaisonID(Liaison l, Committee c)
 {
     if (l == null)
     {
         return(string.Empty);
     }
     else if (l.LiaisonType == LiaisonType.Consultant)
     {
         return(string.Format("{0}{1}{2}", ConsultantPrefix, c.ID, l.ID));
     }
     else
     {
         return(string.Format("{0}{1}{2}", LiaisonPrefix, c.ID, l.ID));
     }
 }
Exemple #6
0
        public void StopAD()
        {
            string Message = null;

            Message = "ky" + '\r'; // Stop both motors
            Byte[] Donnees = System.Text.Encoding.ASCII.GetBytes(Message);
            try
            {
                Liaison.Open();                            // on ouvre la liaison série
                Liaison.Write(Donnees, 0, Donnees.Length); // on envoie les données
                Liaison.Close();
            } // on ferme la liaison série
            catch
            {
                Erreur =
                    "Impossible d'acceder à la liaison serie, le port est peut etre utilise par une autre application !";
            }
        }
Exemple #7
0
        public string GetCurrentPosition()
        {
            string Message = null;

            Message = "";
            Byte[] Donnees = System.Text.Encoding.ASCII.GetBytes(Message);
            try
            {
                Liaison.Open();                            // on ouvre la liaison série
                Liaison.Write(Donnees, 0, Donnees.Length); // on envoie les données
                Liaison.Read(Donnees, 0, Donnees.Length);
                Liaison.Close();
                Message = System.Text.Encoding.ASCII.GetString(Donnees);
            } // on ferme la liaison série
            catch
            {
                Erreur =
                    "Impossible d'acceder à la liaison serie, le port est peut etre utilise par une autre application !";
            }

            return(Message);
        }
    //  _////////////////////////////////////////////////_    _///////////////////////_    _____  Switch  _____  Btw Frames  _____
    void LiaisonSwitch()
    { // Called from Mouse Up.   UITileManager :: AlienSwitchProcess
        //if (mAlien == null || mAlienTarget == null)            return;
        Ag.LogIntenseWord(" CuLiaison :: LiaisonSwitch ");

        CuCell     alien  = Liaison.CellCs();
        CuCell     targt  = FrameDest.mSwitchObj.CellCs();
        GameObject Target = FrameDest.mSwitchObj;

        if (!alien.SameKindOf(Target))
        {
            FrameHome = FrameDest = null;
            Liaison   = null;
            return;
        }

        switch ("SWAP")
        {
        case "SWAP":

            FrameHome.RemoveCellWith(Liaison.name, Target);
            FrameDest.RemoveCellWith(Target.name, Liaison);

            Ag.Swap <int> (ref alien.mSortNum, ref targt.mSortNum);
            Ag.Swap <GameObject> (ref alien.mPrevGobj, ref targt.mPrevGobj);
            Ag.Swap <GameObject> (ref alien.mNextGobj, ref targt.mNextGobj);

            alien.Pstn.SwapCurposiAndSetTargetWith(targt.Pstn);
            break;
            //case "INSERT":            //Target.CellCs ().InsertAt (mAlien);
        }

        FrameDest.ArrangeCells();
        FrameHome.ArrangeCells();

        FrameHome = FrameDest = null;
        Liaison   = null;
    }
Exemple #9
0
        public void SetSpeedY(string n)
        {
            int numN = Int32.Parse(n);

            if (numN < 0)
            {
                string Message = null;

                Message = "sy" + n + '\r';
                Byte[] Donnees = System.Text.Encoding.ASCII.GetBytes(Message);
                try
                {
                    Liaison.Open();                            // on ouvre la liaison série
                    Liaison.Write(Donnees, 0, Donnees.Length); // on envoie les données
                    Liaison.Close();                           // on ferme la liaison série
                }
                catch
                {
                    Erreur =
                        "Impossible d'accèder à la liaison série, le port est peut-être utilisé par une autre application !";
                }
            }
        }
Exemple #10
0
        public void RotationDEC(string b)
        {
            int numPosition = Int32.Parse(b);

            if (numPosition > -644999 && numPosition < 639999)
            {
                string Message = null;

                Message = "Y" + b + '\r';
                Byte[] Donnees = System.Text.Encoding.ASCII.GetBytes(Message);
                try
                {
                    Liaison.Open();                            // on ouvre la liaison série
                    Liaison.Write(Donnees, 0, Donnees.Length); // on envoie les données
                    Liaison.Close();
                } // on ferme la liaison série
                catch
                {
                    Erreur =
                        "Impossible d'accèder à la liaison série, le port est peut-être utilisé par une autre application !";
                }
            }
        }
        public static CampaignStaffViewModel CampaignStaffFrom(Entity source)
        {
            if (source == null)
            {
                source = new Entity();
            }
            var model = new CampaignStaffViewModel
            {
                Name         = PersonNameFrom(source),
                ContactInfo  = ContactInfoFrom(source),
                Employer     = EmployerFrom(source.Employer),
                ContactOrder = source.ContactOrder,
            };
            Liaison l = source as Liaison;

            if (l != null)
            {
                model.ContactType          = l.LiaisonType;
                model.ConsultantEntityName = l.EntityName;
                model.ManagerialControl    = l.HasManagerialControl;
                model.VGLiaison            = l.IsVGLiaison;
            }
            return(model);
        }
        public string AffichageLabyrinthe()
        {
            // Vérifier si la methode de prim a déjà été executée au préalable
            if (liaisonsFinales == null)
            {
                MessageBox.Show("Commencer par Lancer l'algorithme de PRIM !");
                return(null);
            }


            StringBuilder str = new StringBuilder();

            Liaison[][] ecran = new Liaison[GetMap().GetLargeur * 2 - 1][];
            for (int y = 0; y < (GetMap().GetLargeur * 2) - 1; y++)
            {
                ecran[y] = new Liaison[GetMap().GetLongueur * 2 - 1];
            }

            // parcourir les liaisons pour les ajouter dans le Tableau
            Liaison tmp;

            foreach (Liaison item in liaisonsFinales)
            {
                tmp = item;
                int tmp_y = tmp.getCoordY();
                int tmp_x = tmp.GetCoordX();
                ecran[tmp_y][tmp_x] = tmp;
            }

            for (int y = 0; y < GetMap().GetLongueur * 2 - 1; y++)
            {
                for (int x = 0; x < GetMap().GetLargeur * 2 - 1; x++)
                {
                    if (x % 2 == 0 && y % 2 == 0)
                    {
                        str.Append(ProduireDirectionLiaison(
                                       ElementExiste(x, y - 1, ecran),
                                       ElementExiste(x + 1, y, ecran),
                                       ElementExiste(x, y + 1, ecran),
                                       ElementExiste(x - 1, y, ecran)
                                       ));
                    }
                    else if (x % 2 == 1 && y % 2 == 0)
                    {
                        // liaison Horizontale
                        if (ElementExiste(x, y, ecran))
                        {
                            str.Append("═"); // Alt + 205
                        }
                        else
                        {
                            str.Append(" ");
                        }
                    }
                    else if (x % 2 == 0)
                    {
                        // Liaison verticale
                        if (ElementExiste(x, y, ecran))
                        {
                            str.Append("║"); // Alt + 186
                        }
                        else
                        {
                            str.Append(" ");
                        }
                    }
                    else
                    {
                        str.Append(" ");
                    }
                    str.Append(" ");
                }
                str.Append("\n");
            }

            return(str.ToString());
        }
Exemple #13
0
 /// <summary>
 /// Analyzes a liaison to determine its eligibility for a new C-Access account.
 /// </summary>
 /// <param name="l">The <see cref="Liaison"/> to analyze.</param>
 /// <param name="c">The <see cref="Committee"/> for which <paramref name="l"/> is a liaison.</param>
 private void AnalyzeEntity(Liaison l, Committee c)
 {
     AnalyzeEntity(l, GetLiaisonID(l, c));
 }