예제 #1
0
 /// <summary>
 /// 作者:Primo
 /// 日期:2014.10.30
 /// 描述:获取该中心,那些课程是指定只能外教上的,或者指定中教上的
 /// </summary>
 /// <param name="branchId"></param>
 /// <param name="ProductLevelID"></param>
 /// <param name="ProductLevelCourseTypeID"></param>
 /// <returns></returns>
 public static List<Model.Acs.TeacherProductLevelCourseTypeCourseConfig> GetTeacherProductLevelCourseTypeCourseConfigList(int branchId, int productLevelID, int productLevelCourseTypeID)
 {
     var Db = new EmeAcsEntities();
     var model = (from a in Db.TeacherProductLevelCourseTypeCourseConfig
                  where a.BranchId == branchId
                  && a.ProductLevelID == productLevelID
                  && a.ProductLevelCourseTypeID == productLevelCourseTypeID
                  && a.Status == ConvertEnum.StatusTypeForActive
                  select a);
     return model.ToList();
 }
예제 #2
0
 /// <summary>
 /// 作者:Primo
 /// 日期:2014.07.29
 /// 描述:根据BranchId获取Weight
 /// </summary>
 /// <param name="branchId"></param>
 /// <returns></returns>
 public static Model.Acs.Weight GetWeightByBranchId(int branchId)
 {
     var Db = new EmeAcsEntities();
     return Db.Weight.Where(a => a.BranchId == branchId && a.Status == ConvertEnum.StatusTypeForActive).FirstOrDefault();
 }
예제 #3
0
        /// <summary>
        /// 作者:Primo
        /// 日期:2014.12.23
        /// 描述:获取教师,一天
        /// </summary>
        /// <param name="branchId"></param>
        /// <param name="beginDate"></param>
        /// <returns></returns>
        public static List<Model.Acs.Teacher> GetTeacherByBranchId(int branchId, DateTime beginDate, out Dictionary<int, List<ArrangeCourse>> acList)
        {
            var Db = new EmeAcsEntities();
            var model = (from a in Db.Teacher
                         where a.BranchId == branchId
                         && a.WorkDate == beginDate
                         && a.Status == ConvertEnum.StatusTypeForActive
                         select a).OrderBy(p => p.TeacherTypeId).ThenByDescending(p => p.IsFullTime);

            acList = new Dictionary<int, List<ArrangeCourse>>();
            foreach (var item in model)
            {
                var endDate = beginDate.AddDays(1);
                var modelItem = (from a in Db.ArrangeCourse
                                 where a.TeacherId == item.TeacherId
                                 && a.BeginTime >= beginDate
                                 && a.BeginTime < endDate
                                 select a).ToList();
                acList.Add(item.TeacherId.Value, modelItem);
            }
            return model.ToList();
        }
예제 #4
0
 /// <summary>
 /// 作者:Primo
 /// 日期:2014.12.25
 /// 描述:根据Id获取教师实体
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public static Model.Acs.Teacher GetTeacherById(int id)
 {
     var Db = new EmeAcsEntities();
     var model = Db.Teacher.FirstOrDefault(p => p.Id == id);
     return model;
 }
예제 #5
0
 /// <summary>
 /// 作者:Primo
 /// 日期:2014.08.04
 /// 描述:获取学员
 /// </summary>
 /// <param name="branchId"></param>
 /// <param name="beginDate"></param>
 /// <param name="endDate"></param>
 /// <returns></returns>
 public static List<Model.Acs.Student> GetStudentByBranchId(int branchId, DateTime beginDate, DateTime endDate)
 {
     var Db = new EmeAcsEntities();
     var model = (from a in Db.Student
                  where a.BranchId == branchId
                  && a.WorkDate >= beginDate
                  && a.WorkDate <= endDate
                  select a);
     return model.ToList();
 }
예제 #6
0
 /// <summary>
 /// 作者:Primo
 /// 日期:2014.08.04
 /// 描述:获取教师
 /// </summary>
 /// <param name="branchId"></param>
 /// <param name="beginDate"></param>
 /// <param name="endDate"></param>
 /// <returns></returns>
 public static List<Model.Acs.Teacher> GetTeacherByBranchId(int branchId, DateTime beginDate, DateTime endDate)
 {
     var Db = new EmeAcsEntities();
     var model = (from a in Db.Teacher
                  where a.BranchId == branchId
                  && a.WorkDate >= beginDate
                  && a.WorkDate <= endDate
                  && a.Status == ConvertEnum.StatusTypeForActive
                  select a);
     return model.ToList();
 }
예제 #7
0
 /// <summary>
 /// 作者:Primo
 /// 日期:2014.07.29
 /// 描述:根据BranchId获取Product集合
 /// </summary>
 /// <param name="branchId"></param>
 /// <returns></returns>
 public static List<Model.Acs.Product> GetProductByBranchId(int branchId)
 {
     var Db = new EmeAcsEntities();
     var model = (from a in Db.Product
                  where a.BranchId == branchId
                  && a.Status == ConvertEnum.StatusTypeForActive
                  select a);
     return model.ToList();
 }
예제 #8
0
        /// <summary>
        /// 获取产品 和 级别
        /// </summary>
        /// <param name="id"></param>
        /// <param name="pList"></param>
        /// <returns></returns>
        public static List<Model.Eme.Product> GetProductAndProductLevels(int id, out Dictionary<int, List<Model.Eme.ProductLevel>> pList)
        {
            var Db = new EmeAcsEntities();//Acs库连接
            var productlist = new List<Model.Eme.Product>();
            var productLevelList = new List<Model.Eme.ProductLevel>();
            pList = new Dictionary<int, List<Model.Eme.ProductLevel>>();

            var teacherObj = GetTeacherById(id);
            var pId = teacherObj.ProductId.Trim(',').Split(',');
            foreach (var item in pId)//循环获取产品
            {
                var edb = new Model.Eme.EmeEntities();//Eme库连接
                var intItem = Convert.ToInt32(item);
                var productObj = edb.Product.FirstOrDefault(p => p.Id == intItem && p.Status == ConvertEnum.StatusTypeForActive);//获取产品

                if (productObj == null)
                    continue;

                productlist.Add(productObj);
                var productLevelsObj = edb.ProductLevel.Where(p => p.ProductId == productObj.Id && p.Status == ConvertEnum.StatusTypeForActive).ToList();//获取级别
                productLevelList = new List<Model.Eme.ProductLevel>();
                foreach (var itemLevel in productLevelsObj)//循环筛选级别
                {
                    if (teacherObj.TeachRange.Contains("," + itemLevel.Id + ","))
                    {
                        productLevelList.Add(itemLevel);
                        if (pList.ContainsKey(productObj.Id))//判断是否存在这个Key值
                        {
                            pList[productObj.Id] = productLevelList;//替换
                        }
                        else
                        {
                            pList.Add(productObj.Id, productLevelList);//添加
                        }
                    }
                }
            }
            return productlist;
        }
예제 #9
0
 /// <summary>
 /// 作者:Primo
 /// 日期:2014.08.07
 /// 描述:获取CoursePlanResult
 /// </summary>
 /// <param name="branchId"></param>
 /// <param name="beginDate"></param>
 /// <param name="endDate"></param>
 /// <returns></returns>
 public static List<Model.Acs.CoursePlanResult> GetCoursePlanResultByBranchId(int branchId, DateTime beginDate, DateTime endDate)
 {
     var Db = new EmeAcsEntities();
     var model = (from a in Db.CoursePlanResult
                  where a.BranchId == branchId
                  && a.BeginDate >= beginDate
                  && a.EndDate <= endDate
                  && a.Status == ConvertEnum.StatusTypeForActive
                  select a);
     return model.ToList();
 }
예제 #10
0
 /// <summary>
 /// 调整课程时,获取教室
 /// </summary>
 /// <param name="branchId"></param>
 /// <param name="productLevelCourseTypeId"></param>
 /// <param name="workDate"></param>
 /// <param name="workTime"></param>
 /// <returns></returns>
 public static List<Model.Acs.Classroom> GetClassroom(int branchId, int productLevelCourseTypeId, DateTime workDate, string workTime)
 {
     var edbAcs = new EmeAcsEntities();//Acs 库
     var edbEme = new Model.Eme.EmeEntities();//Eme 库
     var modelProductLevelCourseTypeObj = edbEme.ProductLevelCourseType.FirstOrDefault(a => a.Id == productLevelCourseTypeId);
     var strProductCourseTypeId = string.Format(",{0},", modelProductLevelCourseTypeObj.ProductCourseTypeId);
     var model = (from a in edbAcs.Classroom
                  where a.BranchId == branchId
                  && a.WorkDate == workDate
                  && a.UnavailableTime.Contains(workTime) == false
                  && a.ClassroomTypeForProductCourseType.Contains(strProductCourseTypeId) == true
                  && a.Status == ConvertEnum.StatusTypeForActive
                  select a);
     return model.ToList();
 }
예제 #11
0
 /// <summary>
 /// 作者:Primo
 /// 日期:2014.10.27
 /// 描述:根据BranchId判断Weight是否存在
 /// </summary>
 /// <param name="branchId"></param>
 /// <returns></returns>
 public static bool ExistWeightByBranchId(int branchId)
 {
     var Db = new EmeAcsEntities();
     return Db.Weight.Any(a => a.BranchId == branchId && a.Status == ConvertEnum.StatusTypeForActive);
 }