12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.DataLogic.Repositories;
- using EMIS.ViewModel.TeachingMaterial;
- using System.Linq.Expressions;
- using EMIS.Entities;
- namespace EMIS.DataLogic.Common.TeachingMaterial
- {
- public class PublishDAL
- {
- public PublishRepository PublishRepository { get; set; }
- /// <summary>
- /// 获取出版单位信息列表
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<PublisherView> GetPulishGridView(Expression<Func<CF_Publish, bool>> exp)
- {
- var view = PublishRepository.GetList(exp).Select(x => new PublisherView
- {
- PublishID = x.PublishID,
- Email = x.Email,
- Address = x.Address,
- BandCard = x.BandCard,
- BandName = x.BandName,
- ContectUser = x.ContectUser,
- Ein = x.Ein,
- Desc = x.Desc,
- Fax = x.Fax,
- IsPrint = x.IsPrint.Value,
- IsPrintName = x.IsPrint.Value == true ? "是" : "否",
- IsPulish = x.IsPulish.Value,
- IsPulishName = x.IsPulish.Value ==true ? "是" : "否",
- IsSupplier = x.IsSupplier.Value,
- IsSupplierName = x.IsSupplier.Value == true ? "是" : "否",
- Mobile = x.Mobile,
- Phone = x.Phone,
- UnitCode = x.UnitCode,
- UnitName = x.UnitName,
- UnitShortName = x.UnitShortName
- });
- return view;
- }
-
- /// <summary>
- /// 获取出版单位单位
- /// </summary>
- /// <returns></returns>
- public PublisherView GetSinglePublish(Guid publishID)
- {
- var publish = PublishRepository.GetSingle(x => x.PublishID == publishID);
- var publishView = new PublisherView()
- {
- PublishID = publish.PublishID,
- Ein = publish.Ein,
- Desc = publish.Desc,
- Phone = publish.Phone,
- Mobile = publish.Mobile,
- UnitName = publish.UnitName,
- UnitCode = publish.UnitCode,
- UnitShortName = publish.UnitShortName,
- IsPrint = publish.IsPrint.GetValueOrDefault(),
- IsPulish = publish.IsPulish.GetValueOrDefault(),
- IsSupplier = publish.IsSupplier.GetValueOrDefault(),
- Address = publish.Address,
- BandCard = publish.BandCard,
- BandName = publish.BandName,
- ContectUser = publish.ContectUser,
- Email = publish.Email,
- Fax = publish.Fax
- };
- return publishView;
- }
- }
- }
|