Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                dotype = Request.Params["dotype"].ToString();
                schid  = Com.Session.schid;

                #region 编辑绑定查询
                if (dotype == "e")
                {
                    stuid = Request.Params["id"].ToString();//
                    SchSystem.BLL.SchStuInfoV bll_stu = new SchSystem.BLL.SchStuInfoV();
                    DataTable dt = bll_stu.GetList("GradeId,GradeName,ClassId,ClassName,StuId,StuName,CardNo,StuNo,Sex,OldClassId,TestNo,TelNo,StudyType,Addr", "StuId=" + Com.Public.SqlEncStr(stuid)).Tables[0];

                    stugradeid = dt.Rows[0]["GradeId"].ToString();
                    stuclassid = dt.Rows[0]["ClassId"].ToString();

                    stuname  = dt.Rows[0]["StuName"].ToString();
                    stugrade = dt.Rows[0]["GradeName"].ToString();
                    stuclass = dt.Rows[0]["ClassName"].ToString();
                    stucode  = dt.Rows[0]["TestNo"].ToString();
                    stusex   = dt.Rows[0]["Sex"].ToString();
                    stucard  = dt.Rows[0]["CardNo"].ToString();
                    stutel   = dt.Rows[0]["TelNo"].ToString();
                    stuaddr  = dt.Rows[0]["Addr"].ToString();
                    stustp   = dt.Rows[0]["StudyType"].ToString();
                    stuocls  = dt.Rows[0]["OldClassId"].ToString();
                    SchSystem.BLL.SchStuGenUV bll_stugen = new SchSystem.BLL.SchStuGenUV();
                    DataTable dtgen = bll_stugen.GetList("Relation,GenName,TelNo", "StuId=" + Com.Public.SqlEncStr(stuid)).Tables[0];
                    if (dtgen != null && dtgen.Rows.Count > 0)
                    {
                        stug1name = dtgen.Rows[0]["GenName"].ToString();
                        stug1rl   = dtgen.Rows[0]["Relation"].ToString();
                        stug1rt   = dtgen.Rows[0]["TelNo"].ToString();
                        if (dtgen.Rows.Count > 1)
                        {
                            stug2name = dtgen.Rows[1]["GenName"].ToString();
                            stug2rl   = dtgen.Rows[1]["Relation"].ToString();
                            stug2rt   = dtgen.Rows[1]["TelNo"].ToString();
                        }
                    }

                    stuno = "00000000".Substring(0, 8 - stuid.Length) + stuid;
                }
                else
                {
                    stugradeid = Request.Params["gradecode"].ToString();
                    stuclassid = Request.Params["classid"].ToString();
                }
                drpgrade = Com.Public.GetDrpAreaClassMaster("4", Com.Session.schid, ref stugradeid, false);
                drpclass = Com.Public.GetDrpAreaClassMaster("5", stugradeid, ref stuclassid, false);
                StudentList.namepack npgrade = (StudentList.namepack)Newtonsoft.Json.JsonConvert.DeserializeObject <StudentList.namepack>(getusers("1", stugradeid));
                stugradeboss = npgrade.gradeboss;
                StudentList.namepack np = (StudentList.namepack)Newtonsoft.Json.JsonConvert.DeserializeObject <StudentList.namepack>(getusers("2", stuclassid));
                stuclassms  = np.classms;
                stuclasstec = np.classtec;
                #endregion
            }
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                stuid = Request.Params["id"].ToString();//

                SchSystem.BLL.SchStuInfoV bll_stu = new SchSystem.BLL.SchStuInfoV();
                DataTable dt = bll_stu.GetList("GradeId,GradeName,ClassId,ClassName,StuId,StuName,CardNo,StuNo,Sex,OldClassId,TestNo,TelNo,StudyType,Addr", "StuId=" + Com.Public.SqlEncStr(stuid)).Tables[0];

                string gradeid = dt.Rows[0]["GradeId"].ToString();
                string classid = dt.Rows[0]["ClassId"].ToString();
                stuname  = dt.Rows[0]["StuName"].ToString();
                stugrade = dt.Rows[0]["GradeName"].ToString();
                stuclass = dt.Rows[0]["ClassName"].ToString();
                stucode  = dt.Rows[0]["TestNo"].ToString();
                stusex   = dt.Rows[0]["Sex"].ToString() == "0"?"女":"男";
                stucard  = dt.Rows[0]["CardNo"].ToString();
                stutel   = dt.Rows[0]["TelNo"].ToString();
                stuaddr  = dt.Rows[0]["Addr"].ToString();
                stustp   = dt.Rows[0]["StudyType"].ToString() == "0" ? "否" : "是";;
                stuocls  = dt.Rows[0]["OldClassId"].ToString();
                SchSystem.BLL.SchStuGenUV bll_stugen = new SchSystem.BLL.SchStuGenUV();
                DataTable dtgen = bll_stugen.GetList("Relation,GenName,TelNo", "StuId=" + Com.Public.SqlEncStr(stuid)).Tables[0];
                if (dtgen != null && dtgen.Rows.Count > 0)
                {
                    stug1name = dtgen.Rows[0]["GenName"].ToString();
                    stug1rl   = dtgen.Rows[0]["Relation"].ToString();
                    stug1rt   = dtgen.Rows[0]["TelNo"].ToString();
                    if (dtgen.Rows.Count > 1)
                    {
                        stug2name = dtgen.Rows[1]["GenName"].ToString();
                        stug2rl   = dtgen.Rows[1]["Relation"].ToString();
                        stug2rt   = dtgen.Rows[1]["TelNo"].ToString();
                    }
                }
                StudentList.namepack npgrade = (StudentList.namepack)Newtonsoft.Json.JsonConvert.DeserializeObject <StudentList.namepack>(getusers("1", gradeid));
                stugradeboss = npgrade.gradeboss;
                StudentList.namepack np = (StudentList.namepack)Newtonsoft.Json.JsonConvert.DeserializeObject <StudentList.namepack>(getusers("2", classid));
                stuclassms  = np.classms;
                stuclasstec = np.classtec;
                stuid       = "00000000".Substring(0, 8 - stuid.Length) + stuid;
            }
        }
Esempio n. 3
0
        public static string getusers(string tp, string id)
        {
            StudentList.namepack np = new 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));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DataTable dt      = new DataTable();
                string    dotype  = Request.Params["dotype"].ToString();
                var       gradeid = Request.Params["gradecode"].ToString();
                var       classid = Request.Params["classid"].ToString();
                if (dotype == "c")
                {
                    Stubh = Request.Params["Stubh"].ToString();
                    string stuid = Request.Params["id"].ToString();
                    string sql   = "select * from SchStuInfoV where StuId='" + stuid + "' ";//根据学生ID查询出学校,年级,班级等信息
                    dt = DbHelperSQL.Query(sql).Tables[0];
                    if (gradeid == "")
                    {
                        gradeid = dt.Rows[0]["GradeId"].ToString();
                    }
                    if (classid == "")
                    {
                        classid = dt.Rows[0]["ClassId"].ToString();
                    }
                    DataRow[] drr          = dt.Select();
                    string    oldclassname = drr[0]["OldClassId"].ToString();
                    if (!string.IsNullOrEmpty(oldclassname) || oldclassname != "")
                    {
                        oldClassName = oldclassname;
                    }
                    else
                    {
                        oldClassName = "";
                    }
                    SchSystem.BLL.SchStuInfo bll_stu = new SchSystem.BLL.SchStuInfo();
                    string  strWhere = " a.StuId=" + stuid;
                    DataSet ds       = bll_stu.GetList(strWhere);//修改绑定需要的数据
                    ds.Tables[0].Columns.Add("jzGenName2");
                    ds.Tables[0].Columns.Add("jzLoginName2");
                    ds.Tables[0].Columns.Add("jzTelNo2");
                    ds.Tables[0].Columns.Add("jzPwd2");
                    ds.Tables[0].Columns.Add("jzStat2");
                    ds.Tables[0].Columns.Add("jzRelation2");
                    ds.Tables[0].Columns.Add("jzGenId2");
                    ds.Tables[0].Columns.Add("jzUnId2");
                    if (ds.Tables[0].Rows.Count != 0)
                    {
                        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                        {
                            for (int j = i + 1; j < ds.Tables[0].Rows.Count; j++)
                            {
                                if (ds.Tables[0].Rows[i]["StuId"].ToString() == ds.Tables[0].Rows[j]["StuId"].ToString())
                                {
                                    ds.Tables[0].Rows[i]["jzGenName2"]   = ds.Tables[0].Rows[j]["jzGenName1"].ToString();
                                    ds.Tables[0].Rows[i]["jzLoginName2"] = ds.Tables[0].Rows[j]["jzLoginName1"].ToString();
                                    ds.Tables[0].Rows[i]["jzTelNo2"]     = ds.Tables[0].Rows[j]["jzTelNo1"].ToString();
                                    ds.Tables[0].Rows[i]["jzPwd2"]       = ds.Tables[0].Rows[j]["jzPwd1"].ToString();
                                    ds.Tables[0].Rows[i]["jzStat2"]      = ds.Tables[0].Rows[j]["jzStat1"].ToString();
                                    ds.Tables[0].Rows[i]["jzRelation2"]  = ds.Tables[0].Rows[j]["jzRelation1"].ToString();
                                    ds.Tables[0].Rows[i]["jzGenId2"]     = ds.Tables[0].Rows[j]["jzGenId1"].ToString();
                                    ds.Tables[0].Rows[i]["jzUnId2"]      = ds.Tables[0].Rows[j]["jzUnId1"].ToString();
                                    ds.Tables[0].Rows.RemoveAt(j);
                                }
                            }
                        }
                    }
                    #region 缺省值:年級領導、班主任和任課教師
                    SchSystem.BLL.SchGradeUsers sgiBll = new SchSystem.BLL.SchGradeUsers();
                    SchSystem.BLL.SchClassUser  scuBll = new SchSystem.BLL.SchClassUser();
                    DataTable dtgradeuser = sgiBll.GetList("*", "GradeId='" + gradeid + "'").Tables[0];
                    if (dtgradeuser.Rows.Count > 0)
                    {
                        StringBuilder sbgradeuser = new StringBuilder();
                        foreach (DataRow dr in dtgradeuser.Rows)
                        {
                            sbgradeuser.Append(dr["UserTname"].ToString() + ",");
                        }
                        if (sbgradeuser.ToString().Length > 0)
                        {
                            njld = sbgradeuser.ToString().Substring(0, sbgradeuser.ToString().Length - 1);//年級領導
                        }
                    }
                    DataTable dtclassuser = scuBll.GetList("*", "ClassId='" + classid + "'").Tables[0];
                    if (dtclassuser.Rows.Count > 0)
                    {
                        StringBuilder sbgradeuser01 = new StringBuilder();
                        StringBuilder sbgradeuser02 = new StringBuilder();
                        foreach (DataRow dr in dtclassuser.Rows)
                        {
                            if (dr["IsMs"].ToString() == "1")
                            {
                                sbgradeuser01.Append(dr["UserTname"].ToString() + ",");
                            }
                            else
                            {
                                sbgradeuser02.Append(dr["UserTname"].ToString() + ",");
                            }
                        }
                        if (sbgradeuser01.ToString().Length > 0)
                        {
                            bzr = sbgradeuser01.ToString().Substring(0, sbgradeuser01.ToString().Length - 1);//班主任
                        }
                        if (sbgradeuser02.ToString().Length > 0)
                        {
                            bjjs = sbgradeuser02.ToString().Substring(0, sbgradeuser02.ToString().Length - 1);//任課教師
                        }
                    }
                    #endregion
                    StringBuilder sbarea = new StringBuilder();

                    //获取年级
                    sbarea.Append("<br/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;年级:<select id=\"nj\" style=\"width:100px\" disabled=\"disabled\">");

                    sbarea.Append(Com.Public.GetDrpAreaShow("4", Com.Session.schid, ref gradeid, false));
                    sbarea.Append("</select>&nbsp;&nbsp;&nbsp;&nbsp;");
                    //获取年级主任
                    StudentList.namepack npgrade = (StudentList.namepack)Newtonsoft.Json.JsonConvert.DeserializeObject <StudentList.namepack>(getusers("1", gradeid));
                    sbarea.Append("<span id=\"njld\" style=\"color:	#808080	\">年级领导:" + npgrade.gradeboss + "</span><br/><br/>");
                    //获取班级
                    sbarea.Append(" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;班级:<select id=\"bj\" style=\"width:100px\" disabled=\"disabled\" >");

                    sbarea.Append(Com.Public.GetDrpAreaShow("5", gradeid, ref classid, false));
                    sbarea.Append("</select>&nbsp;&nbsp;&nbsp;&nbsp;");
                    //获取班主任及任课老师
                    StudentList.namepack np = (StudentList.namepack)Newtonsoft.Json.JsonConvert.DeserializeObject <StudentList.namepack>(getusers("2", classid));
                    sbarea.Append("<span id=\"bzr\" style=\"color:	#808080	\">班主任:"+ np.classms + "</span>&nbsp;&nbsp; ");
                    sbarea.Append("<span id=\"bjjs\" style=\"color:	#808080	\">任课老师:" + np.classtec + "</span><br/><br/>");

                    areastr = sbarea.ToString();

                    umodelstr = dttojson.DatSetToJSON2(ds);;
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DataTable dt = new DataTable();
                dotype = Request.Params["dotype"].ToString();
                string gradeid = Request.Params["gradecode"].ToString();
                string classid = Request.Params["classid"].ToString();
                schid = Com.Session.schid;
                #region 编辑绑定查询
                if (dotype == "e")
                {
                    Stubh = Request.Params["Stubh"].ToString();
                    stuid = Com.Public.SqlEncStr(Request.Params["id"].ToString());
                    SchSystem.BLL.SchStuInfo bll_stu = new SchSystem.BLL.SchStuInfo();
                    string  strWhere = " a.StuId=" + stuid;
                    DataSet ds       = bll_stu.GetList(strWhere);//修改绑定需要的数据
                    ds.Tables[0].Columns.Add("jzGenName2");
                    ds.Tables[0].Columns.Add("jzLoginName2");
                    ds.Tables[0].Columns.Add("jzTelNo2");
                    ds.Tables[0].Columns.Add("jzPwd2");
                    ds.Tables[0].Columns.Add("jzStat2");
                    ds.Tables[0].Columns.Add("jzRelation2");
                    ds.Tables[0].Columns.Add("jzGenId2");
                    ds.Tables[0].Columns.Add("jzUnId2");
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                        {
                            for (int j = i + 1; j < ds.Tables[0].Rows.Count; j++)
                            {
                                if (ds.Tables[0].Rows[i]["StuId"].ToString() == ds.Tables[0].Rows[j]["StuId"].ToString())
                                {
                                    ds.Tables[0].Rows[i]["jzGenName2"]   = ds.Tables[0].Rows[j]["jzGenName1"].ToString();
                                    ds.Tables[0].Rows[i]["jzLoginName2"] = ds.Tables[0].Rows[j]["jzLoginName1"].ToString();
                                    ds.Tables[0].Rows[i]["jzTelNo2"]     = ds.Tables[0].Rows[j]["jzTelNo1"].ToString();
                                    ds.Tables[0].Rows[i]["jzPwd2"]       = ds.Tables[0].Rows[j]["jzPwd1"].ToString();
                                    ds.Tables[0].Rows[i]["jzStat2"]      = ds.Tables[0].Rows[j]["jzStat1"].ToString();
                                    ds.Tables[0].Rows[i]["jzRelation2"]  = ds.Tables[0].Rows[j]["jzRelation1"].ToString();
                                    ds.Tables[0].Rows[i]["jzGenId2"]     = ds.Tables[0].Rows[j]["jzGenId1"].ToString();
                                    ds.Tables[0].Rows[i]["jzUnId2"]      = ds.Tables[0].Rows[j]["jzUnId1"].ToString();
                                    ds.Tables[0].Rows.RemoveAt(j);
                                }
                            }
                        }
                        gradeid = ds.Tables[0].Rows[0]["GradeId"].ToString();
                        classid = ds.Tables[0].Rows[0]["ClassId"].ToString();
                    }
                    umodelstr = Newtonsoft.Json.JsonConvert.SerializeObject(ds.Tables[0]);
                }
                #endregion
                StringBuilder sbarea = new StringBuilder();
                //普通老师登录
                if (Com.Session.systype == "0")
                {
                    //获取年级
                    sbarea.Append("<br/>年级:<select id=\"nj\" style=\"width:100px\">");

                    sbarea.Append(Com.Public.GetDrpAreaClassMaster("4", Com.Session.schid, ref gradeid, false));
                    sbarea.Append("</select>&nbsp;&nbsp;&nbsp;&nbsp;");
                    //获取年级主任
                    StudentList.namepack npgrade = (StudentList.namepack)Newtonsoft.Json.JsonConvert.DeserializeObject <StudentList.namepack>(getusers("1", gradeid));
                    sbarea.Append("<span id=\"njld\" style=\"color:	#808080	\">年级领导:" + npgrade.gradeboss + "</span><br/><br/>");
                    //获取班级
                    sbarea.Append("班级:<select id=\"bj\" style=\"width:100px\" >");

                    sbarea.Append(Com.Public.GetDrpAreaClassMaster("5", gradeid, ref classid, false));
                    sbarea.Append("</select>&nbsp;&nbsp;&nbsp;&nbsp;");
                    //获取班主任及任课老师
                    StudentList.namepack np = (StudentList.namepack)Newtonsoft.Json.JsonConvert.DeserializeObject <StudentList.namepack>(getusers("2", classid));
                    sbarea.Append("<span id=\"bzr\" style=\"color:	#808080	\">班主任:"+ np.classms + "</span>&nbsp;&nbsp; ");
                    sbarea.Append("<span id=\"bjjs\" style=\"color:	#808080	\">任课老师:" + np.classtec + "</span><br/><br/>");

                    areastr = sbarea.ToString();
                }
            }
        }