コード例 #1
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);
        }
コード例 #2
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);
     }
 }