Interface of ITOO ------ Return OrganizationName
Here are the code: (allthese code are type in theITOO.BasicSystemSetting.Service)
At IBasicOrganizationService:
#region 根据学院名称,返回其各个专业名称--Daniel+2016-2-13 /// <summary> /// 根据学院名称,返回其各个专业名称 /// </summary> /// <param name="CollegeName">学院名称</param> /// <returns></returns> [OperationContract] List<ViewModel.BasicOrganizationViewModel> QueryCollegeNameByCollegeName(string CollegeName); #endregion
At BasicOrganizationWCFService:
#region 根据学院名称,返回其各个专业名称--Daniel+2016-2-13 /// <summary> /// 根据学院名称,返回其各个专业名称 /// </summary> /// <param name="CollegeName">学院名称</param> /// <returns></returns> public List<BasicOrganizationViewModel>QueryCollegeNameByCollegeName(string CollegeName) { return basicOrganiztionBll.QueryCollegeNameByCollegeName(CollegeName); } #endregion
At IBasicOrganizationBll:
#region 根据学院名称,返回其各个专业名称--Daniel+2016-2-13 /// <summary> /// 根据学院名称,返回所有专业名称 /// </summary> /// <param name="CollegeName">学校名称</param> /// <returns></returns> List<ViewModel.BasicOrganizationViewModel> QueryCollegeNameByCollegeName(string CollegeName); #endregion
At BasicOrganizationBll:
#region 根据学院名称,返回其各个专业名称--Daniel+2016-2-13 /// <summary> /// 根据学院名称,返回其各个专业名称 /// </summary> /// <param name="CollegeName">学院名称</param> /// <returns></returns> public List<ViewModel.BasicOrganizationViewModel> QueryCollegeNameByCollegeName(string CollegeName) { //把实体装换成为viewmodel List<BasicOrganizationViewModel> list1 = new List<BasicOrganizationViewModel>(); //调用D层方法 list1 = this.CurrentDal.LoadItems(s => s.OrganizationName == CollegeName && s.IsEnabled == 1).Select(s => new BasicOrganizationViewModel() { OrganizationID =s.OrganizationID }).ToList(); List<BasicOrganizationViewModel>list2 = new List<BasicOrganizationViewModel>(); var pid = list1[0].OrganizationID; list2 = this.CurrentDal.LoadItems(s => s.OrganizationPID == pid && s.IsEnabled == 1).Select(s => new BasicOrganizationViewModel() { OrganizationName = s.OrganizationName ,OrganizationID=s.OrganizationID,OrganizationCode=s.OrganizationCode,SchoolLevelID=s.SchoolLevelID,OrganizationPID=s.OrganizationPID,Tuition=s.Tuition,OrganizitionTypeID=s.OrganizitionTypeID}).ToList(); return list2; } #endregion
At the first begin, some classmate they are so kind coming to share how to create
a interface when I even don’t known how to make it , as the time pass, which I
realize that it is not a big deal. Just keep at it and stick to it .