@page @model GanjooRazor.Areas.Admin.Pages.ReviewPersonRelationEditsModel @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @using DNTPersianUtils.Core @using RMuseum.Models.Ganjoor @{ Layout = "_AdminLayout"; ViewData["Title"] = "بازبینی پیشنهادهای نسبت‌های خویشاوندی"; string RelationTypeName(PersonRelationType t) { switch (t) { case PersonRelationType.Parent: return "پدر/مادر و فرزند"; case PersonRelationType.Sibling: return "خواهر/برادر"; case PersonRelationType.Spouse: return "همسر"; case PersonRelationType.Ancestor: return "نیا و نواده"; default: return t.ToString(); } } string AffiliationTypeName(PersonAffiliationType t) { switch (t) { case PersonAffiliationType.Minister: return "وزیر/کارگزار"; case PersonAffiliationType.Advisor: return "مشاور"; case PersonAffiliationType.Courtier: return "درباری/همراه"; case PersonAffiliationType.Patron: return "حامی"; case PersonAffiliationType.Ally: return "متحد"; case PersonAffiliationType.Rival: return "رقیب"; case PersonAffiliationType.Servant: return "خدمتگزار"; case PersonAffiliationType.Companion: return "همدم"; case PersonAffiliationType.Successor: return "جانشین"; case PersonAffiliationType.Panegyrized: return "مدح‌گو"; case PersonAffiliationType.Satirized: return "هجوگو"; case PersonAffiliationType.Other: return "نوع دیگر"; default: return t.ToString(); } } string ActionName(PersonRelationSuggestionAction a) { switch (a) { case PersonRelationSuggestionAction.Add: return "افزودن نسبت جدید"; case PersonRelationSuggestionAction.Modify: return "ویرایش نسبت موجود"; case PersonRelationSuggestionAction.Remove: return "حذف نسبت موجود"; default: return a.ToString(); } } }

@ViewData["Title"]

@if (!string.IsNullOrEmpty(Model.FatalError)) {
@Model.FatalError
} else if (Model.Suggestion == null) { } else { var s = Model.Suggestion;

@ActionName(s.Action) @(s.Kind == PersonRelationSuggestionKind.Affiliation ? "وابستگی غیرخویشاوندی" : "نسبت خویشاوندی")

@if (!string.IsNullOrEmpty(s.SuggestionNote)) { }
پیشنهاد دهنده: @(s.User != null ? s.User.NickName : s.UserId.ToString()) — @s.Date.ToFriendlyPersianDateTextify()
یادداشت پیشنهاددهنده: @s.SuggestionNote
@if (s.Action == PersonRelationSuggestionAction.Remove) {
این پیشنهاد درخواست حذف نسبت زیر است:
} @if (s.Action == PersonRelationSuggestionAction.Modify) { } @if (s.Action == PersonRelationSuggestionAction.Modify) { } @if (s.Action == PersonRelationSuggestionAction.Modify) { } @if (s.Kind == PersonRelationSuggestionKind.Affiliation) { @if (s.Action == PersonRelationSuggestionAction.Modify) { } } else { @if (s.Action == PersonRelationSuggestionAction.Modify) { } @if (s.Action == PersonRelationSuggestionAction.Modify) { } } @if (s.Action == PersonRelationSuggestionAction.Modify) { }
@(s.Action == PersonRelationSuggestionAction.Remove || s.Action == PersonRelationSuggestionAction.Modify ? "مقدار فعلی" : "پیشنهاد")پیشنهاد
طرف اول @(s.Person1 != null ? s.Person1.Name : s.Person1Id.ToString()) @(s.Person1 != null ? s.Person1.Name : s.Person1Id.ToString())
طرف دوم @(s.Person2 != null ? s.Person2.Name : s.Person2Id.ToString()) @(s.Person2 != null ? s.Person2.Name : s.Person2Id.ToString())
نوع وابستگی @(s.Action == PersonRelationSuggestionAction.Modify && s.ExistingAffiliation != null ? AffiliationTypeName(s.ExistingAffiliation.AffiliationType) : AffiliationTypeName(s.SuggestedAffiliationType ?? PersonAffiliationType.Other))@AffiliationTypeName(s.SuggestedAffiliationType ?? PersonAffiliationType.Other)
نوع نسبت @(s.Action == PersonRelationSuggestionAction.Modify && s.ExistingRelation != null ? RelationTypeName(s.ExistingRelation.RelationType) : RelationTypeName(s.SuggestedRelationType))@RelationTypeName(s.SuggestedRelationType)
درجه (در نیا/نواده) @((s.Action == PersonRelationSuggestionAction.Modify && s.ExistingRelation != null ? s.ExistingRelation.DegreeHint : s.SuggestedDegreeHint)?.ToString().ToPersianNumbers())@s.SuggestedDegreeHint?.ToString().ToPersianNumbers()
یادداشت @(s.Action == PersonRelationSuggestionAction.Modify ? (s.Kind == PersonRelationSuggestionKind.Affiliation ? s.ExistingAffiliation?.Note : s.ExistingRelation?.Note) : s.SuggestedNote) @s.SuggestedNote
 
 
یادداشت برای پیشنهاددهنده:
بررسی
@Html.AntiForgeryToken()

@Model.Skip.ToPersianNumbers() از @Model.TotalCount.ToPersianNumbers()

}