欢迎来到天天文库
浏览记录
ID:57672941
大小:47.30 KB
页数:12页
时间:2020-08-31
《教程-XAF使用视图.docx》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、XAF使用视图有表Fee和表FeeEntry一对多关系。publicclassTFee:BaseObject{privatestring_fBillNo;privateDateTime_fAccountingDate;privateDateTime_fDateBegin;privateDateTime_fDateEnd;privatestring_fDescription;privateCheckState_fState;privateTLoan_fLoan;publicTFee(Sessionsession):base(session){}[XafDisplayName("单据编号")
2、]publicstringFBillNo{get{return_fBillNo;}set{_fBillNo=value;}}[XafDisplayName("结算日期")]publicDateTimeFAccountingDate{get{return_fAccountingDate;}set{_fAccountingDate=value;}}[XafDisplayName("业务单号"),LookupEditorMode(LookupEditorMode.Search)]publicTLoanFLoan{get{return_fLoan;}set{_fLoan=value;}}[Xaf
3、DisplayName("计算起始日期")]publicDateTimeFDateBegin{get{return_fDateBegin;}set{_fDateBegin=value;}}[XafDisplayName("计算截止日期")]publicDateTimeFDateEnd{get{return_fDateEnd;}set{_fDateEnd=value;}}[XafDisplayName("备注"),ModelDefault("RowCount","12")]publicstringFDescription{get{return_fDescription;}set{_fDes
4、cription=value;}}[XafDisplayName("审核状态"),ModelDefault("AllowEdit","false")]publicCheckStateFState{get{return_fState;}set{_fState=value;}}[DevExpress.Xpo.Aggregated,Association("TFee-TFeeEntrys")][RuleRequiredField("TFeeTFeeEntryRequried",DefaultContexts.Save,"结算项目必须输入!")]publicXPCollection5、try>TFeeEntry{get{returnGetCollection("TFeeEntry");}}publicoverridevoidAfterConstruction(){base.AfterConstruction();FAccountingDate=System.DateTime.Today;}}[XafDisplayName("结算单分录")]publicclassTFeeEntry:BaseObject{privatedecimal_fAmount;privateTAuxiliaryInformation_fCategory;publicTFeeE6、ntry(Sessionsession):base(session){}[Association("TFee-TFeeEntrys")]publicTFeeTFee{get;set;}[XafDisplayName("结算项目"),DataSourceCriteria("FType=1")][RuleRequiredField("TFeeEntryFCategoryRequried",DefaultContexts.Save,"结算项目必须输入!")]publicTAuxiliaryInformationFCategory{get{return_fCategory;}set{_fCate7、gory=value;}}[XafDisplayName("金额")]publicdecimalFAmount{get{return_fAmount;}set{_fAmount=value;}}1.创建视图(SQL2008)2./******Object:View[dbo].[ViewFee]ScriptDate:06/03/201317:30:40******/3.SETANSI_NULLSON4.GO5.6.SETQUOTED_
5、try>TFeeEntry{get{returnGetCollection("TFeeEntry");}}publicoverridevoidAfterConstruction(){base.AfterConstruction();FAccountingDate=System.DateTime.Today;}}[XafDisplayName("结算单分录")]publicclassTFeeEntry:BaseObject{privatedecimal_fAmount;privateTAuxiliaryInformation_fCategory;publicTFeeE
6、ntry(Sessionsession):base(session){}[Association("TFee-TFeeEntrys")]publicTFeeTFee{get;set;}[XafDisplayName("结算项目"),DataSourceCriteria("FType=1")][RuleRequiredField("TFeeEntryFCategoryRequried",DefaultContexts.Save,"结算项目必须输入!")]publicTAuxiliaryInformationFCategory{get{return_fCategory;}set{_fCate
7、gory=value;}}[XafDisplayName("金额")]publicdecimalFAmount{get{return_fAmount;}set{_fAmount=value;}}1.创建视图(SQL2008)2./******Object:View[dbo].[ViewFee]ScriptDate:06/03/201317:30:40******/3.SETANSI_NULLSON4.GO5.6.SETQUOTED_
此文档下载收益归作者所有