- 爱易网页
-
ASP.NET教程
- 搞不懂了,再看旁人写的。net mvc DDD 程序,求教
日期:2014-05-17 浏览次数:20618 次
搞不懂了,再看别人写的。net mvc DDD 程序,求教
看到一个界面cshtml 有这样一句
@Html.EditorFor(m=>m.Model.Details) 在html上尽然显示一个列表,而且还带翻页功能,而且还可以自己添加删除修改没行内容,这不科学。求神回答。小弟就怎么点分了。
其中:Model为
[MetadataType(typeof(PaymentFeeSheetDTOMetadata))] //1.这句话是什么意思?
public class PaymentFeeSheetDTO : CostSheetDTOBase
{
public SheetTypeOption SheetType { get; set; }
public CounterpartyDTO Counterparty { get; set; }
public IList<PaymentFeeDetailDTO> Details { get; set; }
public double Amount { get; set; }
public AttachedSheetDTO AttachedSheet { get; set; }
public PaymentFeeSheetDTO()
{
Counterparty = new CounterpartyDTO();
AttachedSheet = new AttachedSheetDTO();
}
}
其中 PaymentFeeSheetDTOMetadata 为
public class PaymentFeeSheetDTOMetadata : CostSheetDTOBaseMetadata
{
//[LocalizedDisplay(ConstVariables.SheetType)]
[SelectInGroup(RenderAs=RenderAsOption.RadioButton)]
public SheetTypeOption SheetType { get; set; }
public CounterpartyDTO Counterparty { get; set; }
//这里的一系列[xx(xx=xx,xx=xx)]又是什么东西?
[GridView(DataRowType = typeof(PaymentFeeDetailDTO), SelectionMode = SelectionModeOption.Multiple, NewItemPartialView = "PaymentFeeDetail", NewItemAction = "NewPaymentFeeDetail", ListItemAction = "ListPaymentFeeDetails")]
[ContextMenu]
[DialogAction(Name = "Edit", Icon = IconOption.Edit, PartialView = "PaymentFeeDetail")]
[Button(Container = "Edit", Action = "EditPaymentFeeDetail", Icon = IconOption.Save, IsPrimary = true, Name = "Save")]
[ContextAction(Name = "Delete", Action = "DeletePaymentFeeDetail", Icon = IconOption.Delete)]
public IList<PaymentFeeDetailDTO> Details { get; set; }
public AttachedSheetDTO AttachedSheet { get; set; }
public double Amount { get; set; }
}