public ActionResult ClassList(string param_plan, string param_subject, int? param_status, string param_searchTxt, int pageIndex = 1) { int totalPage; var fkBll = new Traning_InfoFkBLL(); var traningBll = new Training_PlanBLL(); ViewBag.PlanList = DataTableToListHelper<Dianda.AP.Model.Training_Plan>.ConvertToModel(traningBll.GetList(" Delflag=0 and Display=1 ").Tables[0]); ViewBag.SubjectList = fkBll.GetList(" CategoryType=3 and Delflag=0 and Display=1 ", "Sort desc"); var organ = new Organ_DetailBLL().GetModel(SiteCache.Instance.ManageOrganId); //组织分区下未删除状态 string where = " Delflag=0 and OrganId= " + SiteCache.Instance.ManageOrganId + " and PartitionId=" + organ.PartitionId; if (!string.IsNullOrEmpty(param_plan))//学期计划 { where += " and PlanId =" + Dianda.Common.QueryString.Decrypt(param_plan); } if (!string.IsNullOrEmpty(param_subject))//学科 { where += " and (subject=1 or exists( select 1 from Class_TeachSubject where ClassId=Class_Detail.id and TeachSubject=" + Dianda.Common.QueryString.Decrypt(param_subject) + "))"; } if (param_status.HasValue)//状态 { where += " and Status =" + param_status.Value; } if (!string.IsNullOrEmpty(param_searchTxt))//查询条件 { where += " and( Title like '%" + ExtendHelper.Split(param_searchTxt )+ "%' or exists( SELECT 1 FROM dbo.Traning_Detail WHERE Title LIKE '%" + ExtendHelper.Split(param_searchTxt) + "%' AND id=Class_Detail.TraningId))"; } var list = DataTableToListHelper<Dianda.AP.Model.Class_Detail>.ConvertToModel(PagingQueryBll.GetPagingDataTable("Class_Detail", where, "id", pageIndex, out totalPage)); ViewBag.pageIndex = pageIndex; ViewBag.totalPage = totalPage; ViewBag.basecount = 10; ViewBag.instructorList = DataTableToListHelper<Dianda.AP.Model.Member_Account>.ConvertToModel(new Member_AccountBLL().GetAccountByMannagerGroup(organ.PartitionId, organ.Id, 6)); return View(list); }
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 and IsOpen=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(); //} list = organBll.GetListModel(" id in ( " + model.OrganRange + ")"); ViewBag.schoolList = list; ViewBag.classId = param_id; ViewBag.OrangRange = model.OrganRange.Split(','); ViewBag.doaction = param_doaction; return View(model); }
public ActionResult Add() { PrepareTrainingApplyBLL bll = new PrepareTrainingApplyBLL(); ViewBag.TrainingObjectData = bll.GetTraningObject(); ViewBag.SubjectData = bll.GetSubject(); ViewBag.StudyLevelData = bll.GetStudyLevel(); ViewBag.TrainingFormData = bll.GetTrainingForm(); ViewBag.TeacherTitleData = bll.GetTeacherTitle(); ViewBag.TrainingFeildData = bll.GetTrainingField("Delflag=0 and IsSpec=0", ""); ViewBag.OutCourseTypeData = bll.GetOutCourseType("Delflag=0", ""); Organ_Detail otypeModel = new Organ_DetailBLL().GetModel(Code.SiteCache.Instance.ManageOrganId); ViewBag.OTypeId = otypeModel == null ? 0 : Convert.ToInt32(otypeModel.OType); return View(); }
public ActionResult ClassAuditList(string param_plan, string param_subject, string param_organ, int? param_status, string param_searchTxt, int pageIndex = 1) { int totalPage; var fkBll = new Traning_InfoFkBLL(); var traningBll = new Training_PlanBLL(); var organBll = new Organ_DetailBLL(); ViewBag.PlanList = DataTableToListHelper<Dianda.AP.Model.Training_Plan>.ConvertToModel(traningBll.GetList(" Delflag=0 and Display=1 ").Tables[0]); ViewBag.SubjectList = fkBll.GetList(" CategoryType=3 and Delflag=0 and Display=1 ", "Sort desc"); ViewBag.OrganList = new Organ_DetailBLL().GetListModel(" Delflag=0"); //市级管理员,可以查看所有班级信息。Delflag=0,display=1.status不为1和7的。 string where = " Delflag=0 and Display=1 and status not in(1,7) "; if (!string.IsNullOrEmpty(param_plan))//学期计划 { where += " and PlanId =" + Dianda.Common.QueryString.Decrypt(param_plan); } if (!string.IsNullOrEmpty(param_subject))//学科 { where += " and TraningId =" + Dianda.Common.QueryString.Decrypt(param_subject); } if (!string.IsNullOrEmpty(param_organ))//机构 { where += " and OrganId =" + Dianda.Common.QueryString.Decrypt(param_organ); } if (param_status.HasValue)//状态 { where += " and Status =" + param_status.Value; } if (!string.IsNullOrEmpty(param_searchTxt))//查询条件 { where += " and( Title like '%" + ExtendHelper.Split(param_searchTxt.Trim()) + "%' or exists( SELECT 1 FROM dbo.Traning_Detail WHERE Title LIKE '%" + ExtendHelper.Split(param_searchTxt.Trim()) + "%' AND id=Class_Detail.TraningId))"; } var list = DataTableToListHelper<Dianda.AP.Model.Class_Detail>.ConvertToModel(PagingQueryBll.GetPagingDataTable("Class_Detail", where, "id", pageIndex, out totalPage)); ViewBag.pageIndex = pageIndex; ViewBag.totalPage = totalPage; ViewBag.basecount = 10; return View(list); }
public ActionResult Edit(int id) { PrepareTrainingApplyBLL bll = new PrepareTrainingApplyBLL(); NationalAbility_CourseBLL nationalAbility_CourseBLL = new NationalAbility_CourseBLL(); Traning_Detail model = bll.GetTrainingDetail(Convert.ToInt32(id), "Delflag=0 and (Status=1 or Status=4 or CanEdit=1)"); if (model == null) { return Content("<script>setTimeout(function () { window.location.href = '/Prepare/TrainingApply/List' }, 3000);</script>操作失败,3秒后自动返回到列表!"); } ViewBag.TrainingObjectData = bll.GetTraningObject(); ViewBag.SubjectData = bll.GetSubject(); ViewBag.StudyLevelData = bll.GetStudyLevel(); ViewBag.TrainingFormData = bll.GetTrainingForm(); ViewBag.TeacherTitleData = bll.GetTeacherTitle(); ViewBag.TrainingFeildData = bll.GetTrainingField("Delflag=0 and IsSpec=0", ""); ViewBag.TrainingCategoryData = bll.GetTrainingCategory("Delflag=0 and Field=" + model.TraingField, ""); ViewBag.TrainingTopicData = bll.GetTrainingTopic("Delflag=0 and CategoryId=" + model.TraingCategory, ""); ViewBag.NationalCoursData = nationalAbility_CourseBLL.GetList2("Delflag=0 and TCategoryId=" + model.TraingCategory, ""); ViewBag.AttachData = bll.GetAttachTable("Delflag=0 and TraningId=" + id, ""); ViewBag.OutCourseTypeData = bll.GetOutCourseType("Delflag=0", ""); Organ_Detail otypeModel = new Organ_DetailBLL().GetModel(Code.SiteCache.Instance.ManageOrganId); ViewBag.OTypeId = otypeModel == null ? 0 : Convert.ToInt32(otypeModel.OType); return View(model); }
public ActionResult Add(Traning_Detail model) { PrepareTrainingApplyBLL bll = new PrepareTrainingApplyBLL(); ViewBag.TrainingObjectData = bll.GetTraningObject(); ViewBag.SubjectData = bll.GetSubject(); ViewBag.StudyLevelData = bll.GetStudyLevel(); ViewBag.TrainingFormData = bll.GetTrainingForm(); ViewBag.TeacherTitleData = bll.GetTeacherTitle(); ViewBag.OutCourseTypeData = bll.GetOutCourseType("Delflag=0", ""); Organ_Detail otypeModel = new Organ_DetailBLL().GetModel(Code.SiteCache.Instance.ManageOrganId); ViewBag.OTypeId = otypeModel == null ? 0 : Convert.ToInt32(otypeModel.OType); if (model.TraingCategory == 0) { TempData["Msg"] = "课程小类不能为空!"; return View(model); } if (model.TraingTopic == null || model.TraingTopic == 0) { TempData["Msg"] = "课程主题不能为空!"; return View(model); } if (string.IsNullOrEmpty(model.TeacherName)) { TempData["Msg"] = "请输入讲师名称!"; return View(model); } if (string.IsNullOrEmpty(model.TeacherFrom)) { TempData["Msg"] = "请输入讲师来自什么地方!"; return View(model); } string msg = ""; if (model.Title == null) model.Title = ""; else model.Title = model.Title.Trim(); model.OrganId = Code.SiteCache.Instance.ManageOrganId; //if (bll.CheckExists(model.Title.Replace("'", "''"), Convert.ToInt32(model.OrganId), model.Id)) //{ // TempData["Msg"] = "课程名称已存在"; // return View(model); //} int picType = Code.ExtendHelper.ToInt(Request["PicType"]); if (picType == 0) { TempData["Msg"] = "请选择图片!"; return View(model); } else if (picType == 1)//选择提供的图片 { model.Pic = Request["PicValue"]; } else if (picType == 2)//选择上传的图片 { HttpPostedFileBase pic = Request.Files["Pic"]; string picPath = Code.UploadCore.UploadImage(pic, ref msg); if (picPath == "") { TempData["Msg"] = msg; return View(model); } model.Pic = picPath; } HttpPostedFileBase teacherPic = Request.Files["TeacherPic"]; string teacherPicPath = Code.UploadCore.UploadImage(teacherPic, ref msg); if (teacherPicPath == "") { TempData["Msg"] = msg; return View(model); } model.TeacherPic = teacherPicPath; model.CreateDate = DateTime.Now; model.Creater = Code.SiteCache.Instance.ManagerId; model.PartitionId = Code.SiteCache.Instance.LoginInfo.PartitionId; if (model.Range == 1)//区级时更新上级机构Id model.ParentOrganId = bll.GetParentOrganId(Convert.ToInt32(model.OrganId)); if (model.Range == 2)//市级 model.ParentOrganId = null; int outCourseType = Code.ExtendHelper.ToInt(Request["OutCourseType"]); if (model.OutSideType == -1)//内部平台 { model.OutSideLink = null; model.OutSideContent = null; } else//外部平台 { model.OutSideType = outCourseType; } if (Request["submit"] == "保存") model.Status = 1; if (Request["submit"] == "保存并提交") model.Status = 2; model.Display = true; using (TransactionScope trans = new TransactionScope()) { try { //新增培训信息 bll.AddTrainingDetail(model); //更新附件 if (!string.IsNullOrEmpty(Request["AttachPathList"])) { DataTable dt = bll.GetAttachTable("1=0", ""); foreach (string s in Request["AttachPathList"].Split(new string[] { ":" }, StringSplitOptions.RemoveEmptyEntries)) { DataRow row = dt.NewRow(); string[] file = s.Split('|'); row["Id"] = file[0]; row["TraningId"] = model.Id; row["Title"] = file[1].Replace("'", "''"); row["Link"] = file[2]; row["Sort"] = 50; row["Display"] = 1; row["Delflag"] = 0; row["CreateDate"] = DateTime.Now; dt.Rows.Add(row); } bll.BatchAttach(dt); } if (model.Status == 2)//保存并提交时,新增一条申请流程记录 { Traning_ApplyApplication apply = new Traning_ApplyApplication(); apply.TraningId = model.Id; apply.Status = 1; apply.Remark = "提交审核"; apply.Creater = model.Creater; apply.OrganId = model.OrganId; apply.Delflag = false; apply.CreateDate = DateTime.Now; bll.AddTrainingApply(apply); } trans.Complete(); return RedirectToAction("List"); } catch (Exception) { TempData["Msg"] = "保存失败!"; return View(model); } } }
//班级首页 public ActionResult Index() { var fkBll = new Traning_InfoFkBLL(); var traningBll = new Training_PlanBLL(); var traningDBll = new Traning_DetailBLL(); 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 and status=5", ""); //(, "");" Range=2" } else//进修学院则可以选择自己机构开设的课程,也可以选择自己机构所属的区县下的所有课程。通过Traning_Detail.ParentOrganId。如果Range=2,则表面是市级共享课程。则可以无条件选择。 { ViewBag.CourseList = traningDBll.GetList(" ((OrganId =" + organ.Id + " or ParentOrganId=" + organ.Id + ") ) and Delflag=0 and Display=1 and status=5", ""); }//or Range=2 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.StudyLevelList = fkBll.GetList(" CategoryType=4 and Delflag=0 and Display=1 ", "Sort desc"); ViewBag.TeachGradeList = fkBll.GetList(" CategoryType=7 and Delflag=0 and Display=1 ", "Sort desc"); ViewBag.TeachRankList = fkBll.GetList(" CategoryType=8 and Delflag=0 and Display=1 ", "Sort desc"); return View(); }
//根据选择的课程返回学校范围 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); } }
//所有辅导员 public JsonResult getAllInstructor(int type,int pageIndex=1) { var organ = new Organ_DetailBLL().GetModel(SiteCache.Instance.ManageOrganId); IList < Dianda.AP.Model.Member_Account > list; if (type == 0) list = DataTableToListHelper<Dianda.AP.Model.Member_Account>.ConvertToModel(new Member_AccountBLL().GetAccountByMannagerGroup(0, 0, 6)); else list = DataTableToListHelper<Dianda.AP.Model.Member_Account>.ConvertToModel(new Member_AccountBLL().GetAccountByMannagerGroup(organ.PartitionId, organ.Id, 6)); return Json(new { instructorList = list.Skip((pageIndex-1)*8).Take(8), totalPage = Math.Ceiling( Convert.ToDouble( list.Count)/8) }, JsonRequestBehavior.AllowGet); }
public static bool CheckIsCanRegister(int ClassId, int MemberId) { Organ_DetailBLL organ_DetailBLL = new Organ_DetailBLL(); int ParentOrganId = 1; int oType = 1; int partitionId = Code.SiteCache.Instance.LoginInfo.PartitionId; int UserId = MemberId; int OrganId = 1; ParentOrganId = (int)organ_DetailBLL.GetModel(Code.SiteCache.Instance.ManageOrganId).ParentId; oType = (int)organ_DetailBLL.GetModel(Code.SiteCache.Instance.ManageOrganId).OType; OrganId = Code.SiteCache.Instance.ManageOrganId; Member_AccountBLL member_AccountBLL = new Member_AccountBLL(); Member_Account ma = member_AccountBLL.GetModel(UserId, ""); Member_BaseInfoBLL member_BaseInfoBLL = new Member_BaseInfoBLL(); Member_BaseInfo m = member_BaseInfoBLL.GetModelByAccountId(UserId); string where = " and td.PartitionId='" + partitionId + "'and cd.PlanId='" + Code.SiteCache.Instance.PlanId + "' and cd.PartitionId='" + partitionId + "' and cd.Id='" + ClassId + "'"; if (oType == 1) { where += " and td.OrganId='" + OrganId + "'"; } else if (oType == 2) { if (m != null) { where += " and ((css.StudySection in(select StudySection from Member_StudySection where AccountId='" + UserId + "' and Delflag='false')and css.delflag='false' )or cd.StudyLevel=1)"; where += " and ((cts.TeachSubject in(select TeachSubject from Member_TeachSubject where AccountId='" + UserId + "' and Delflag='false')and cts.delflag='false' )or cd.Subject=1)"; where += " and ((ctg.TeachGrade in(select TeachGrade from Member_TeachGrade where AccountId='" + UserId + "' and Delflag='false')and ctg.delflag='false' )or cd.TeachGrade=1)"; where += " and ((ctr.TeachRank in(select WorkRank from Member_WorkRank where AccountId='" + UserId + "' and Delflag='false')and ctr.delflag='false' )or cd.TeachRank=1)"; where += " and (CHARINDEX('," + OrganId + ",',','+cd.OrganRange+',')>0 or cd.OrganRange='0')"; where += " and (td.OrganId='" + ParentOrganId + "' or td.Range=2)"; } else { where += "and 1=2"; } } else if (oType == 5) { if (m != null) { where += " and ((css.StudySection in(select StudySection from Member_StudySection where AccountId='" + UserId + "' and Delflag='false')and css.delflag='false' )or cd.StudyLevel=1)"; where += " and ((cts.TeachSubject in(select TeachSubject from Member_TeachSubject where AccountId='" + UserId + "' and Delflag='false')and cts.delflag='false' )or cd.Subject=1)"; where += " and ((ctg.TeachGrade in(select TeachGrade from Member_TeachGrade where AccountId='" + UserId + "' and Delflag='false')and ctg.delflag='false' )or cd.TeachGrade=1)"; where += " and ((ctr.TeachRank in(select WorkRank from Member_WorkRank where AccountId='" + UserId + "' and Delflag='false')and ctr.delflag='false' )or cd.TeachRank=1)"; where += " and (CHARINDEX('," + ma.OrganId + ",',','+cd.OrganRange+',')>0 or cd.OrganRange='0')"; where += " and (td.OrganId='" + OrganId + "' or td.Range=2)"; } else { where += "and 1=2"; } } else { where += " and 1=2"; } Traning_DetailBLL traning_DetailBLL = new Traning_DetailBLL(); int total = 0; List<Traning_Detail> tdlist = traning_DetailBLL.GetListHasClass(10, 1, where, "CreateDate desc", out total); return total > 0; }
/// <summary> /// 学校--审核列表 /// </summary> /// <returns></returns> public ActionResult CoursemarketVerify(int? pageIndex, int? planId, int? status, int? trainingId, int? myclassId, string searchTitle) { ViewBag.Title = "教师报名管理"; int i = TypeConverter.ObjectToInt(pageIndex, 1); int groupId = Code.SiteCache.Instance.GroupId;//4,学校管理7,普通教师 //int groupId = 4; Organ_DetailBLL organ_DetailBLL = new Organ_DetailBLL(); int OrganId = 0; string where = ""; if (groupId == 4) { OrganId = (int)organ_DetailBLL.GetModel(Code.SiteCache.Instance.ManageOrganId).ParentId; ViewBag.Yes = 2; ViewBag.No = 3; where += " and ma.OrganId='" + Code.SiteCache.Instance.ManageOrganId + "'"; //where += " and mcr.Status<=3"; } else if (groupId == 2) { OrganId = Code.SiteCache.Instance.ManageOrganId; ViewBag.Yes = 4; ViewBag.No = 5; where += " and cd.OrganId='" + Code.SiteCache.Instance.ManageOrganId + "'"; where += " and mcr.Status in(2,4,5)"; } else if (groupId == 3) { OrganId = Code.SiteCache.Instance.ManageOrganId; ViewBag.Yes = 4; ViewBag.No = 5; where += " and cd.OrganId='" + Code.SiteCache.Instance.ManageOrganId + "'"; where += " and mcr.Status in(2,4,5)"; } else { where += " and 1=2"; } if (planId != null && planId > 0) { where += " and mcr.PlanId='" + planId + "' "; } else { planId = -1; } if (status != null && status > 0) { where += " and mcr.Status='" + status + "' "; } else { status = -1; } if (trainingId != null && trainingId > 0) { where += " and mcr.TrainingId='" + trainingId + "' "; } else { trainingId = -1; } if (myclassId != null && myclassId > 0) { where += " and mcr.ClassId='" + myclassId + "' "; } else { myclassId = -1; } if (!string.IsNullOrEmpty(searchTitle)) { where += " and (mbi.RealName like'%" + searchTitle.Replace("'", "''") + "%' or ma.Nickname like '%" + searchTitle.Replace("'", "''") + "%' or ma.UserName like '%" + searchTitle.Replace("'", "''") + "%' or mbi.TeacherNo like '%" + searchTitle.Replace("'", "''") + "%' or mbi.CredentialsNumber like '%" + searchTitle.Replace("'", "''") + "%' or td.Title like '%" + searchTitle.Replace("'", "''") + "%' or cd.Title like '%" + searchTitle.Replace("'", "''") + "%')"; } int total = 0; Member_ClassRegisterBLL member_ClassRegisterBLL = new Member_ClassRegisterBLL(); List<ClassRegisterManage> tdlist = member_ClassRegisterBLL.GetListManage(10, i, where, "CreateDate desc", out total); ViewData["searchTitle"] = string.IsNullOrEmpty(searchTitle) ? "" : searchTitle; ViewData["planId"] = planId; ViewData["status"] = status; ViewData["trainingId"] = trainingId; ViewData["myclassId"] = myclassId; ViewData["groupId"] = groupId; ViewBag.pageIndex = i; ViewBag.totalPage = total; Training_PlanBLL training_PlanBLL = new Training_PlanBLL(); ViewBag.PlanList = training_PlanBLL.GetListModel(" Display=1 and Delflag='false'"); Traning_FieldBLL traning_FieldBLL = new Traning_FieldBLL(); ViewBag.FieldList = traning_FieldBLL.GetList(" Display=1 and Delflag='false' and IsSpec=0", " Sort"); Traning_DetailBLL traning_DetailBLL = new Traning_DetailBLL(); ViewBag.TraningList = traning_DetailBLL.GetList(" Display=1 and Delflag='false' and PartitionId='" + Code.SiteCache.Instance.LoginInfo.PartitionId + "' and Status=5 and (OrganId='" + OrganId + "' or Range=2)", " Id"); Class_DetailBLL class_DetailBLL = new Class_DetailBLL(); ViewBag.ClassList = class_DetailBLL.GetListModel(" Display=1 and Delflag='false' "); return View(tdlist); }
/// <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); }