Example #1
0
        public string ToString(string format, IFormatProvider formatProvider)
        {
            switch (format)
            {
            case null:
            case "N":
                return(ToString());

            case "I":
                return(Id.ToString());

            case "NA":
                return(Name);

            case "PC":
                return(PeopleCount.ToString());

            case "B":
                return(Birthyear.ToString());

            case "ID":
                return(IsDead.ToString());

            case "C":
                return(Country);

            case "All":
                return(String.Format("#ID:{0}\tName:{1}\tPeople Count:{2}\tBirthyear:{3}\tIsDead:{4}\tCountry:{5}", Id, Name, PeopleCount, Birthyear, IsDead, Country));

            default:
                throw new FormatException(String.Format("Format {0} not supported", format));
            }
        }
Example #2
0
        public IActionResult Post_Detail_people(int?id)
        {
            PeopleCount query = db.TPosts.AsEnumerable()
                                .GroupJoin(db.TJoinPeople, p => p.FPostId, j => j.FPostId, (p, j) => new PeopleCount
            {
                PostID      = p.FPostId,
                PeopleTotal = p.FPeople,
                joined      = j.Count(p => p.FJoincheck == true),
                waited      = j.Count(p => p.FJoincheck == false),
            }).FirstOrDefault(p => p.PostID == id);

            return(PartialView("Post_Detail_people", query));
        }
Example #3
0
        private string GetMd5Hash()
        {
            var fields = string.Concat(
                Code,
                PeopleCount.ToString(),
                ChameleonCount.ToString(),
                State,
                Character,
                TimeToPollMillisecond.ToString()
                );
            var inputBytes = Encoding.ASCII.GetBytes(fields);

            return(MD5.Create()
                   .ComputeHash(inputBytes)
                   .Select(x => x.ToString("X2"))
                   .Concat());
        }
Example #4
0
#pragma warning restore 649

        internal RoomAnalytics(CiscoTelePresenceCodec codec)
            : base(codec)
        {
            _peopleCount = new PeopleCount(this, "PeopleCount");
        }