コード例 #1
0
ファイル: VoteProfile.cs プロジェクト: zerodowned/UO-Forever
        public string ToHtmlString(bool technical = false)
        {
            var html = new StringBuilder();

            if (technical)
            {
                html.AppendLine(
                    String.Format(
                        "[{0}]: Vote at '{1}' ({2}) for {3} tokens.",
                        VoteTime.ToSimpleString(Voting.CMOptions.DateFormat),
                        VoteSite.Name,
                        VoteSite.Link,
                        TokenAmount.ToString("#,0")));
            }
            else
            {
                html.AppendLine(
                    String.Format(
                        "[{0}]: Vote at '{1}' for {2} tokens.",
                        VoteTime.ToSimpleString(Voting.CMOptions.DateFormat),
                        VoteSite.Name,
                        TokenAmount.ToString("#,0")));
            }

            return(html.ToString());
        }
コード例 #2
0
        public ActionResult EditVoteTime([Bind(Include = "ID,Start_Date,End_Date")] VoteTime voteTime)
        {
            if (ModelState.IsValid)
            {
                db.Entry(voteTime).State = EntityState.Modified;
                db.SaveChanges();

                ModelState.Clear();
                ViewBag.SuccessMessage = "Voting Time changed successfully!";
                return(View("EditVoteTime"));
            }
            return(View(voteTime));
        }
コード例 #3
0
        public ActionResult EditVoteTime(int?id)
        {
            id = 1;

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            VoteTime voteTime = db.VoteTimes.Find(id);

            if (voteTime == null)
            {
                return(HttpNotFound());
            }
            return(View(voteTime));
        }