123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- //using System;
- //using System.Collections.Generic;
- //using System.Linq;
- //using System.Text;
- //using System.Linq.Expressions;
- //using Bowin.Common.Linq;
- //using Bowin.Common.Linq.Entity;
- //using EMIS.DataLogic.ExaminationApply;
- //using EMIS.Entities;
- //using EMIS.ViewModel;
- //using EMIS.ViewModel.ExaminationApply;
- //namespace EMIS.CommonLogic.ExaminationApply
- //{
- // public class SubjectCountLimitServices : BaseServices, ISubjectCountLimitServices
- // {
- // public SubjectCountLimitDAL SubjectCountLimitDAL { get; set; }
- // public Bowin.Common.Linq.Entity.IGridResultSet<SubjectCountLimitView> GetSubjectCountLimitViewList(ViewModel.ConfiguretView subjectCountLimitView,
- // Guid? examinationTypeID, Guid? facultymajorID, int? yearNum, int pageIndex, int pageSize)
- // {
- // Expression<Func<EX_ExaminationSubjectCountLimit, bool>> exp = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- // if (examinationTypeID.HasValue)
- // {
- // exp = exp.And(x => x.ExaminationTypeID == examinationTypeID);
- // }
- // if (facultymajorID.HasValue)
- // {
- // exp = exp.And(x => x.FacultymajorID == facultymajorID);
- // }
- // if (yearNum.HasValue)
- // {
- // exp = exp.And(x => x.Years == yearNum);
- // }
- // var q = SubjectCountLimitDAL.GetSubjectCountLimitView(exp);
- // if (!string.IsNullOrEmpty(subjectCountLimitView.ConditionValue) && !string.IsNullOrEmpty(subjectCountLimitView.Attribute))
- // q = q.DynamicWhere(subjectCountLimitView.Attribute, subjectCountLimitView.Condition, subjectCountLimitView.ConditionValue);
- // return GetQueryByDataRangeByCollege(q).OrderBy(x => x.ExaminationTypeName).ThenBy(x => x.FacultymajorName).ToGridResultSet<SubjectCountLimitView>(pageIndex, pageSize);
- // }
- // public IList<ViewModel.ExaminationApply.SubjectCountLimitView> GetSubjectCountLimitViewList(ViewModel.ConfiguretView subjectCountLimitView, Guid? examinationTypeID, Guid? facultymajorID)
- // {
- // Expression<Func<EX_ExaminationSubjectCountLimit, bool>> exp = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- // if (examinationTypeID.HasValue)
- // {
- // exp = exp.And(x => x.ExaminationTypeID == examinationTypeID);
- // }
- // if (facultymajorID.HasValue)
- // {
- // exp = exp.And(x => x.FacultymajorID == facultymajorID);
- // }
- // var q = SubjectCountLimitDAL.GetSubjectCountLimitView(exp);
- // if (!string.IsNullOrEmpty(subjectCountLimitView.ConditionValue) && !string.IsNullOrEmpty(subjectCountLimitView.Attribute))
- // q = q.DynamicWhere(subjectCountLimitView.Attribute, subjectCountLimitView.Condition, subjectCountLimitView.ConditionValue);
- // return GetQueryByDataRangeByCollege(q).OrderBy(x => x.ExaminationTypeName).ThenBy(x => x.FacultymajorName).ToList();
- // }
- // public ViewModel.ExaminationApply.SubjectCountLimitView GetSubjectCountLimitViewInfo(Guid? subjectCountLimitID)
- // {
- // return SubjectCountLimitDAL.GetSubjectCountLimitView(x => x.ExaminationSubjectCountLimitID == subjectCountLimitID).FirstOrDefault();
- // }
- // public void Save(ViewModel.ExaminationApply.SubjectCountLimitView subjectCountLimitView)
- // {
-
- // var subjectCountLimitEntity = SubjectCountLimitDAL.ExaminationSubjectCountLimitRepository.GetSingle(x => x.ExaminationSubjectCountLimitID == subjectCountLimitView.ExaminationSubjectCountLimitID);
- // var RepeatSubjectCountLimit = SubjectCountLimitDAL.ExaminationSubjectCountLimitRepository.GetSingle(x =>
- // x.ExaminationTypeID == subjectCountLimitView.ExaminationTypeID &&
- // x.FacultymajorID == subjectCountLimitView.FacultymajorID && x.Years == subjectCountLimitView.Years);
-
- // if (subjectCountLimitEntity != null)
- // {
- // if (RepeatSubjectCountLimit != null && subjectCountLimitEntity.ExaminationSubjectCountLimitID != RepeatSubjectCountLimit.ExaminationSubjectCountLimitID)
- // { //门数限定,判断考试类型、院系专业、年级数不能重复
- // throw new Exception("已存在相同的考试类型、院系专业、年级数,请核查");
- // }
- // subjectCountLimitEntity.ExaminationTypeID = subjectCountLimitView.ExaminationTypeID;
- // subjectCountLimitEntity.FacultymajorID = subjectCountLimitView.FacultymajorID;
- // subjectCountLimitEntity.Years = subjectCountLimitView.Years;
- // subjectCountLimitEntity.SubjectCountLimit = subjectCountLimitView.SubjectCountLimit;
- // this.SetModifyStatus(subjectCountLimitEntity);
- // }
- // else
- // {
- // if (RepeatSubjectCountLimit != null)
- // { //门数限定,判断考试类型、院系专业、年级数不能重复
- // throw new Exception("已存在相同的考试类型、院系专业、年级数,请核查");
- // }
- // subjectCountLimitEntity = new EX_ExaminationSubjectCountLimit();
- // subjectCountLimitEntity.ExaminationSubjectCountLimitID = Guid.NewGuid();
- // subjectCountLimitEntity.ExaminationTypeID = subjectCountLimitView.ExaminationTypeID;
- // subjectCountLimitEntity.FacultymajorID = subjectCountLimitView.FacultymajorID;
- // subjectCountLimitEntity.Years = subjectCountLimitView.Years;
- // subjectCountLimitEntity.SubjectCountLimit = subjectCountLimitView.SubjectCountLimit;
- // this.SetNewStatus(subjectCountLimitEntity);
- // UnitOfWork.Add(subjectCountLimitEntity);
- // }
- // UnitOfWork.Commit();
- // }
- // public void Delete(IList<Guid?> subjectCountLimitID)
- // {
- // if (subjectCountLimitID.Count > 0)
- // {
- // UnitOfWork.Delete<EX_ExaminationSubjectCountLimit>(x => subjectCountLimitID.Contains(x.ExaminationSubjectCountLimitID));
- // }
- // }
- // /// <summary>
- // /// 批量修改前,验证门数限定表的院系专业、学年数、考试类型是否重复
- // /// </summary>
- // /// <param name="examinationType">考试类型</param>
- // /// <param name="facultymajorIDs">院系专业</param>
- // /// <param name="years">学年数</param>
- // /// <returns></returns>
- // public string[] Validation(Guid? examinationType,List<Guid?> facultymajorIDs,List<int?> years)
- // {
- // try
- // {
- // for (int i = 0; i < facultymajorIDs.Count; i++)
- // {
- // Guid a = facultymajorIDs[0].Value;
- // int b = years[0].Value;
- // //var SubjectCountLimit = SubjectCountLimitDAL.ExaminationSubjectCountLimitRepository.Entities.Where(x =>
- // // x.ExaminationTypeID == examinationType.Value && x.FacultymajorID == facultymajorIDs[0].Value &&
- // // x.Years == years[0].Value).FirstOrDefault();
- // var SubjectCountLimit = SubjectCountLimitDAL.GetSubjectCountLimitView(x =>
- // x.ExaminationTypeID == examinationType.Value && x.FacultymajorID == a &&
- // x.Years == b).FirstOrDefault();
- // if (SubjectCountLimit != null)
- // return new[] { "false", "专业【"+SubjectCountLimit.FacultymajorName + "】第" + SubjectCountLimit.Years + "学年的【" + SubjectCountLimit.ExaminationTypeName + "】考试类型数据已存在。" };
- // }
- // }
- // catch (Exception ex)
- // {
- // return new[] { "false", ex.Message };
- // }
-
- // return new[] { "true", "成功" };
- // }
- // }
- //}
|