您的位置: 首页 >日志>前端技术>详细内容

前端技术

领导信箱增加收信人显示

来源:本站原创 发布时间:2023-07-07 08:42:41 浏览次数: 【字体:

领导信箱【公开信访列表.cshtml】,若提交写信时时选择了写信人,前台列表增加收件人显示,效果如下:

1


复制标签【公开信访列表.cshtml】,进行修改,代码修改如下:

注入前:

@inject PetitionLetterService PetitionLetterService
@inject GlobalDepartmentService GlobalDepartmentService
@inject PetitionLetterBoxService PetitionLetterBoxService


 注入后:

@inject PetitionLetterService PetitionLetterService
@inject GlobalDepartmentService GlobalDepartmentService
@inject PetitionLetterBoxService PetitionLetterBoxService
@inject AddresseeService AddresseeService


变量前:

count++;
var className = "";
var department = GlobalDepartmentService.GetEntity(n => n.DepartmentId == publicity.PetitionDepartmentId);


变量后:

count++;
var className = "";
var department = GlobalDepartmentService.GetEntity(n => n.DepartmentId == publicity.PetitionDepartmentId);
var addressee = AddresseeService.GetEntity(x => x.AddresseeId == publicity.AddresseeId);


标题结构:

<td class="title">
    @if (addressee != null)
    {
      <span class="addressee">@addressee.AddresseeName</span>
     }
    <a href="@Url.Action("Details", "home", new { id = publicity.PetitionLetterId, area = "Petition" })">
        @publicity.Title.CutText(TitleLength, "…")
    </a>
</td>

2  


×

用户登录