private string getProvision(IHasRegulation regulation) { if (regulation == null) { return(string.Empty); } return("更改规定:" + regulation.ChangeRegulation + "|作废规定:" + regulation.InvalidRegulation + "|退票规定:" + regulation.RefundRegulation + "|签转规定:" + regulation.EndorseRegulation); }
private string getProvision(IHasRegulation regulation) { if (regulation == null) { return(string.Empty); } return(" <span><span class='b'>废票规定:</span>" + regulation.InvalidRegulation + "</span> <span> <span><span class='b'>退票规定:</span>" + regulation.RefundRegulation + "</span> <span class='b'>改签规定:</span>" + regulation.ChangeRegulation + "</span> <span class='b'>签转规定:</span>" + regulation.EndorseRegulation + "</span>"); }
private object getProvisionList(IHasRegulation regulation) { if (regulation == null) { return new[] { new { key = string.Empty, value = string.Empty } } } ; return(new[] { new { key = "更改规定", value = regulation.ChangeRegulation }, new { key = "作废规定", value = regulation.InvalidRegulation }, new { key = "退票规定", value = regulation.RefundRegulation }, new { key = "签转规定", value = regulation.EndorseRegulation } }); }
public static string GetRegulation(IHasRegulation regulation) { StringBuilder result = new StringBuilder(); result.AppendFormat("<p><span class=b>更改规定:</span>{0}</p>", regulation.ChangeRegulation); result.AppendFormat("<p><span class=b>作废规定:</span>{0}</p>", regulation.InvalidRegulation); result.AppendFormat("<p><span class=b>退票规定:</span>{0}</p>", regulation.RefundRegulation); result.AppendFormat("<p><span class=b>签转规定:</span>{0}</p>", regulation.EndorseRegulation); return(result.ToString()); //return ((string.IsNullOrWhiteSpace(regulation.RefundRegulation) ? string.Empty : (regulation.RefundRegulation.Trim() + "$")) + // (string.IsNullOrWhiteSpace(regulation.InvalidRegulation) ? string.Empty : (regulation.InvalidRegulation.Trim() + "$")) + // (string.IsNullOrWhiteSpace(regulation.ChangeRegulation) ? string.Empty : (regulation.ChangeRegulation.Trim() + "$")) + // (string.IsNullOrWhiteSpace(regulation.EndorseRegulation) ? string.Empty : (regulation.EndorseRegulation.Trim() + "$"))).TrimEnd("$".ToCharArray()).Replace("$", "。"); }