public IActionResult OnPostReview() { Confirmation = false; CBS RequestDirecter = new CBS(); Golfer.Approved = Approved.ToString(); DateTime.TryParse(MembershipStartDate, out DateTime date); Golfer.MembershipStartDate = date; Golfer.MemberNumber = (int)TempData["MemberNumber"]; Confirmation = RequestDirecter.ReviewMembershipApplication(Golfer); if (Confirmation) { TempData["Alert"] = $"Successfully Updated Membership Application"; return(RedirectToPage("/Index")); } else { TempData["Danger"] = true; Alert = $"Could Not Update Membership Application"; Golfer = null; } return(Page()); }
/// <summary> /// 使用一定的格式构造一个字符串 /// </summary> /// <param name="format"></param> /// <param name="formatProvider"></param> /// <returns></returns> public string ToString(string format, IFormatProvider formatProvider) { var b = new StringBuilder(format); b.Replace("Artist", Artist); b.Replace("artist", Artist); b.Replace("bpm", Bpm.ToString(CultureInfo.CurrentCulture)); b.Replace("stars", Stars.ToString(CultureInfo.CurrentCulture)); b.Replace("mode", Mode.ToString()); b.Replace("cs", CircleSize.ToString(CultureInfo.CurrentCulture)); b.Replace("ar", ApproachRate.ToString(CultureInfo.CurrentCulture)); b.Replace("hp", HpDrain.ToString(CultureInfo.CurrentCulture)); b.Replace("od", OverallDifficulty.ToString(CultureInfo.CurrentCulture)); b.Replace("circles", HitCircle.ToString()); b.Replace("sliders", Slider.ToString()); b.Replace("spiners", Spinner.ToString()); b.Replace("creator", Creator); b.Replace("Title", Title); b.Replace("title", Title); b.Replace("Tags", Tags); b.Replace("tags", Tags); b.Replace("setid", BeatmapSetId.ToString()); b.Replace("maxcombo", MaxCombo.ToString()); b.Replace("approved", Approved.ToString()); var total = TimeSpan.FromSeconds(TotalTime); var hit = TimeSpan.FromSeconds(DrainTime); b.Replace("length", $"{total.TotalMinutes}:{total.Seconds}"); b.Replace("hitlength", $"{hit.TotalMinutes}:{hit.Seconds}"); b.Replace("version", Version); b.Replace("md5", Md5); b.Replace("id", BeatmapId.ToString()); return(b.ToString()); }
public override string ToString() { return(string.Format( "approved = {0}, issued = {1}", Approved.ToString("C0", Program.Culture), Issued.ToString("C0", Program.Culture) )); } // ToString
public virtual string GetProperty(string strPropertyName, string strFormat, System.Globalization.CultureInfo formatProvider, DotNetNuke.Entities.Users.UserInfo accessingUser, DotNetNuke.Services.Tokens.Scope accessLevel, ref bool propertyNotFound) { switch (strPropertyName.ToLower()) { case "commentid": // Int return(CommentID.ToString(strFormat, formatProvider)); case "componentid": // Int return(ComponentId.ToString(strFormat, formatProvider)); case "itemtype": // Int return(ItemType.ToString(strFormat, formatProvider)); case "itemid": // Int return(ItemId.ToString(strFormat, formatProvider)); case "parentid": // Int if (ParentId == null) { return(""); } ; return(((int)ParentId).ToString(strFormat, formatProvider)); case "message": // NVarCharMax return(PropertyAccess.FormatString(Message, strFormat)); case "approved": // Bit if (Approved == null) { return(""); } ; return(Approved.ToString()); default: propertyNotFound = true; break; } return(Null.NullString); }