예제 #1
0
        public static string getnj(string typecode, string pcode, string schid, string classid)
        {
            if (schid == "undefined")
            {
                schid = Com.SoureSession.Soureschid;
            }
            schid    = Com.Public.SqlEncStr(schid);
            typecode = Com.Public.SqlEncStr(typecode);
            string ClassId = "";

            SchSystem.BLL.SchGradeUsers sguBLL = new SchSystem.BLL.SchGradeUsers();
            SchSystem.BLL.SchClassUser  scuBLL = new SchSystem.BLL.SchClassUser();
            SchWebMaster.Web.Student.StudentList.namepack np = new SchWebMaster.Web.Student.StudentList.namepack();

            if (typecode == "1")//1为获取年级领导
            {
                string GradeCode = Com.Public.SqlEncStr(pcode);
                string sql1      = "";
                string sql2      = "";
                if (Com.SoureSession.Souresystype != "2")//判断是否是超管
                {
                    sql1 = "select GradeId from dbo.SchGradeInfo where GradeId='" + GradeCode + "' and SchId='" + Com.SoureSession.Soureschid + "'";
                    sql2 = "select *  FROM SchClassGradeV  where IsFinish<>2 and SchId='" + Com.SoureSession.Soureschid + "' and IsFinish=0 and GradeCode='" + GradeCode + "' and ClassId='" + classid + "' order by GradeCode,ClassName	";
                }
                else
                {
                    sql1 = "select GradeId from dbo.SchGradeInfo where GradeId='" + GradeCode + "'  and SchId='" + schid + "'";
                    sql2 = "select *  FROM SchClassGradeV  where IsFinish<>2 and SchId='" + schid + "' and IsFinish=0 and GradeCode='" + GradeCode + "' and ClassId='" + classid + "' order by GradeCode,ClassName	";
                }
                DataTable dt1     = DbHelperSQL.Query(sql1).Tables[0];
                string    GradeId = "";
                if (dt1.Rows.Count > 0)
                {
                    GradeId = dt1.Rows[0]["GradeId"].ToString();
                }
                DataTable dt2 = DbHelperSQL.Query(sql2).Tables[0];
                if (dt2.Rows.Count > 0)
                {
                    njld = np.gradeboss = sguBLL.GetNames("GradeId='" + GradeId + "'");
                }
                if (dt2.Rows.Count != 0)
                {
                    ClassId = dt2.Rows[0]["ClassId"].ToString();
                    bzr     = np.classms = scuBLL.GetNames("ClassId='" + ClassId + "' and IsMs=1");
                    bjjs    = np.classtec = scuBLL.GetNames("ClassId=" + ClassId + " and IsMs=0");
                }
            }
            else//侧为获取班主任和任课老师
            {
                np.classms  = scuBLL.GetNames("ClassId='" + pcode + "' and IsMs=1 and SchId='" + schid + "'");
                np.classtec = scuBLL.GetNames("ClassId=" + pcode + " and IsMs=0  and SchId='" + schid + "'");
            }

            return(Newtonsoft.Json.JsonConvert.SerializeObject(np));
        }
        public static string getusers(string tp, string id)
        {
            SchWebMaster.Web.Student.StudentList.namepack np = new SchWebMaster.Web.Student.StudentList.namepack();
            if (Com.Public.IsNum(id))
            {
                if (tp == "1")//获取年级主任
                {
                    SchSystem.BLL.SchGradeUsers sguBLL = new SchSystem.BLL.SchGradeUsers();
                    np.gradeboss = sguBLL.GetNames("GradeId=" + Com.Public.SqlEncStr(id));
                }
                else
                {
                    SchSystem.BLL.SchClassUser scuBLL = new SchSystem.BLL.SchClassUser();
                    np.classms  = scuBLL.GetNames("ClassId=" + Com.Public.SqlEncStr(id) + " and IsMs=1");
                    np.classtec = scuBLL.GetNames("ClassId=" + Com.Public.SqlEncStr(id) + " and IsMs=0");
                }
            }

            return(Newtonsoft.Json.JsonConvert.SerializeObject(np));
        }