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()); }
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)); }
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)); }