예제 #1
0
 //根据选择的课程返回学校范围
 public JsonResult GetSchoolByCourse(string courseid)
 {
     try
     {
         var course = new Traning_DetailBLL().GetModel(courseid.ToInt(), "");
         var organBll = new Organ_DetailBLL();
         var list = new List<Organ_Detail>();
         if (course.Range == 1) //区级
         {
             list = organBll.GetListModel(" Delflag=0 and  OType IN ( 1, 2, 3 ) and PartitionId=" + SiteCache.Instance.LoginInfo.PartitionId + " and ParentId=" + SiteCache.Instance.ManageOrganId);
         }
         else//市级
         {
             list = organBll.GetShiOrganDetailList();
         }
         return Json(list, JsonRequestBehavior.AllowGet);
     }
     catch (Exception ex)
     {
         return Json(new { Code = -1, Msg = ex.Message }, JsonRequestBehavior.AllowGet);
     }
 }
예제 #2
0
        public ActionResult ClassAuditDetail(string id, string doaction)
        {
            var param_id = Dianda.Common.QueryString.Decrypt(id);
            string param_doaction = "";
            if (doaction != null)
                param_doaction = Dianda.Common.QueryString.Decrypt(doaction);

            var fkBll = new Traning_InfoFkBLL();
            var traningBll = new Training_PlanBLL();
            var traningDBll = new Traning_DetailBLL();
            var bll = new Class_DetailBLL();
            var model = bll.GetModel(param_id.ToInt());
            var organ = new Organ_DetailBLL().GetModel(SiteCache.Instance.ManageOrganId);
            if (organ.OType == 1)//培训机构职能选择自己机构开设的课程
            {
                ViewBag.CourseList = traningDBll.GetList(" OrganId =" + organ.Id + " and Delflag=0 and Display=1 ", "");
            }
            else//进修学院则可以选择自己机构开设的课程,也可以选择自己机构所属的区县下的所有课程。通过Traning_Detail.ParentOrganId。如果Range=2,则表面是市级共享课程。则可以无条件选择。
            {
                ViewBag.CourseList = traningDBll.GetList(" ((OrganId =" + organ.Id + " or ParentOrganId=" + organ.Id + ") or Range=2 ) and Delflag=0 and Display=1 ", "");
            }
            ViewBag.OrganId = SiteCache.Instance.ManageOrganId;
            ViewBag.PartitionId = organ.PartitionId;
            ViewBag.PlanList = DataTableToListHelper<Dianda.AP.Model.Training_Plan>.ConvertToModel(traningBll.GetList("  Delflag=0 and Display=1 ").Tables[0]);
            ViewBag.ClassesList = fkBll.GetList(" CategoryType=5 and Delflag=0 and Display=1 ", "Sort desc");
            ViewBag.SubjectList = fkBll.GetList(" CategoryType=3 and Delflag=0 and Display=1 ", "Sort desc");
            ViewBag.Subject = model.Subject;
            ViewBag.existSubjectList = new Class_TeachSubjectBLL().GetList(" Delflag=0 and ClassId=" + param_id, "");
            ViewBag.StudyLevelList = fkBll.GetList(" CategoryType=4 and Delflag=0 and Display=1 ", "Sort desc");
            ViewBag.StudyLevel = model.StudyLevel;
            ViewBag.existStudyLevel = new Class_StudySectionBLL().GetList(" Delflag=0 and ClassId=" + param_id, "");
            ViewBag.TeachGradeList = fkBll.GetList(" CategoryType=7 and Delflag=0 and Display=1 ", "Sort desc");
            ViewBag.TeachGrade = model.TeachGrade;
            ViewBag.existTeachGrade = new Class_TeachGradeBLL().GetList(" Delflag=0 and ClassId=" + param_id, "");
            ViewBag.TeachRankList = fkBll.GetList(" CategoryType=8 and Delflag=0 and Display=1 ", "Sort desc");
            ViewBag.TeachRank = model.TeachRank;
            ViewBag.existTeachRank = new Class_TeachRankBLL().GetList(" Delflag=0 and ClassId=" + param_id, "");

            var course = new Traning_DetailBLL().GetModel(model.TraningId, "");
            var organBll = new Organ_DetailBLL();
            var list = new List<Organ_Detail>();
            if (course.Range == 1) //区级
            {
                list = organBll.GetListModel("  OType IN ( 1, 2, 3 ) and PartitionId=" + course.PartitionId + " and ParentId=" + (course.OrganId.HasValue ? course.OrganId.Value : 0));
            }
            else//市级
            {
                list = organBll.GetShiOrganDetailList();
            }
            ViewBag.schoolList = list;
            ViewBag.classId = param_id;
            ViewBag.OrangRange = model.OrganRange.Split(',');
            ViewBag.doaction = param_doaction;
            return View(model);
        }
예제 #3
0
        /// <summary>
        /// 教师--课程超市列表
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="organId"></param>
        /// <param name="field"></param>
        /// <param name="searchTitle"></param>
        /// <returns></returns>
        //[UrlDecrypt]
        public ActionResult CoursemarketSingleList(int? pageIndex, int? organId, int? field, string searchTitle)
        {
            ViewBag.Title = "课程超市";

            int i = TypeConverter.ObjectToInt(pageIndex, 1);
            int groupId = Code.SiteCache.Instance.GroupId;//4,学校管理7,普通教师
            Organ_DetailBLL organ_DetailBLL = new Organ_DetailBLL();
            int CountyOrganId = 0;

            int oType = 1;
            if (groupId == 7)
            {
                oType = (int)organ_DetailBLL.GetModel(Code.SiteCache.Instance.OrganId).OType;
                CountyOrganId = (int)organ_DetailBLL.GetModel(Code.SiteCache.Instance.OrganId).ParentId;
            }
            else if (groupId == 2 || groupId == 3 || groupId == 4)
            {
                oType = (int)organ_DetailBLL.GetModel(Code.SiteCache.Instance.ManageOrganId).OType;
                if (groupId == 4)
                    CountyOrganId = (int)organ_DetailBLL.GetModel(Code.SiteCache.Instance.ManageOrganId).ParentId;
                else
                    CountyOrganId = Code.SiteCache.Instance.ManageOrganId;
            }
            ViewBag.OType = oType;
            int partitionId = Code.SiteCache.Instance.LoginInfo.PartitionId;
            Member_BaseInfoBLL member_BaseInfoBLL = new Member_BaseInfoBLL();
            Member_BaseInfo m = member_BaseInfoBLL.GetModelByAccountId(Code.SiteCache.Instance.LoginInfo.UserId);
            string where = " and td.PartitionId='" + partitionId + "'and cd.PlanId='" + Code.SiteCache.Instance.PlanId + "' and cd.PartitionId='" + partitionId + "'";

            if (oType == 1)
            {
                ViewBag.OrganList = organ_DetailBLL.GetListModel(" OType=1 and Delflag='false'");
            }
            else if (oType == 2 || oType == 5)
            {
                ViewBag.OrganList = organ_DetailBLL.GetListModel(" OType=5 and Delflag='false'");
            }
            else
            {
                where += " and 1=2";
            }

            if (m != null)
            {
                where += " and (td.OrganId='" + CountyOrganId + "' or td.Range=2)";
            }
            else
            {
                where += " and 1=2";
            }

            if (organId != null && organId > 0)
            {
                where += " and td.OrganId='" + organId + "' ";
            }
            else { organId = -1; }
            if (!string.IsNullOrEmpty(searchTitle))
            { where += " and td.Title like'%" + searchTitle.Replace("'", "''") + "%' "; }
            string where2 = where;
            if (field != null && field > 0)
            { where += " and td.TraingField='" + field + "' "; }
            Traning_DetailBLL traning_DetailBLL = new Traning_DetailBLL();
            int total = 0;
            List<Traning_Detail> tdlist = traning_DetailBLL.GetListHasClass(10, i, where, "CreateDate desc", out total);

            ViewData["searchTitle"] = string.IsNullOrEmpty(searchTitle) ? "" : searchTitle;
            ViewData["organId"] = organId;
            ViewData["field"] = field;
            ViewData["partitionId"] = partitionId;
            ViewData["groupId"] = groupId;
            ViewBag.pageIndex = i;
            ViewBag.totalPage = total;

            Traning_FieldBLL traning_FieldBLL = new Traning_FieldBLL();

            List<Traning_Field> traning_FieldList = traning_FieldBLL.GetList(" Delflag='false' and display='1' and Id<>3", " Sort");
            ViewBag.FieldList = traning_FieldList;
            List<Traning_Detail> tdlistall = traning_DetailBLL.GetListHasClass(-1, -1, where2, "CreateDate desc", out total);
            List<int> list = new List<int>(traning_FieldList.Count);
            int sum = 0;
            foreach (Traning_Field tf in traning_FieldList)
            {
                int c = tdlistall.Where(a => a.TraingField == tf.Id).Count();
                list.Add(c);
                sum += c;
            }

            ViewBag.Sum = sum;
            ViewBag.FCount = list;
            return View(tdlist);
        }