123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Bowin.Common.Linq.Entity;
- using EMIS.ViewModel.SupervisionManage;
- using EMIS.DataLogic.SupervisionManage;
- using EMIS.Entities;
- using EMIS.ViewModel;
- namespace EMIS.CommonLogic.SupervisionManage
- {
- public class SupervisionUserServices : BaseServices, ISupervisionUserServices
- {
- public SupervisionUserDAL SupervisionUserDAL { get; set; }
- public IGridResultSet<ProjectRecordTeacherView> GetSupervisionUserGrid(ConfiguretView conditionView, Guid? collegeID, int? pageIndex, int? pageSize)
- {
- var query = SupervisionUserDAL.GetProjectRecordTeacherView();
- if (collegeID.HasValue)
- {
- query = query.Where(x => x.CollegeID == collegeID);
- }
- return query.OrderBy(x => x.LoginID.Length).OrderBy(x => x.LoginID).ToGridResultSet(pageIndex, pageSize);
- }
- public ProjectRecordTeacherView GetProjectRecordTeacherView(Guid? supervisionUserID)
- {
- return SupervisionUserDAL.GetProjectRecordTeacherView().Where(x => x.SupervisionUserID == supervisionUserID).FirstOrDefault();
- }
- public void Save(ProjectRecordTeacherView projectRecordTeacherView)
- {
- var supervisionUser = new SUP_SupervisionUser();
- if (projectRecordTeacherView.SupervisionUserID != Guid.Empty)
- {
- supervisionUser = this.SupervisionUserDAL.SupervisionUserRepository.GetSingle(x => x.SupervisionUserID == projectRecordTeacherView.SupervisionUserID);
- this.SetModifyStatus(supervisionUser);
- }
- else
- {
- supervisionUser.SupervisionUserID = Guid.NewGuid();
- supervisionUser.UserID = projectRecordTeacherView.TeacherID;
- this.SetNewStatus(supervisionUser);
- this.UnitOfWork.Add(supervisionUser);
- }
- UnitOfWork.Commit();
- }
- public void Delete(IList<Guid?> supervisionUserIDList)
- {
- UnitOfWork.Delete<SUP_SupervisionUser>(x => supervisionUserIDList.Contains(x.SupervisionUserID));
- }
- }
- }
|