/// <summary> /// 获得页面数据 /// </summary> /// <param name="model"></param> private void GetPageValue(Peer_coun_head model) { string strCounId = ComHandleClass.getInstance().ByStuNumberGetCounCode(user.User_Id); Basic_coun_info coun = CounHandleClass.getInstance().GetCounInfo_Obj(strCounId); if (coun != null) { model.COUN_ID = coun.ENO; model.COUN_NAME = coun.NAME; model.COUN_DEPARTMENT = coun.DEPARTMENT; } Basic_stu_info stu = StuHandleClass.getInstance().GetStuInfo_Obj(user.User_Id); if (stu != null) { model.STU_NAME = stu.NAME; model.STU_NUMBER = stu.NUMBER; model.XY = stu.COLLEGE; model.ZY = stu.MAJOR; model.GRADE = stu.EDULENTH; model.CLASS_CODE = stu.CLASS; } Peer_project_head peer = PeerInfoHandleClass.getInstance().GetPeerInfoHead(Post("hidPeerSeqNo")); if (peer != null) { model.PEER_SEQ_NO = peer.SEQ_NO; model.PEER_NAME = peer.PEER_NAME; model.PEER_YEAR = peer.PEER_YEAR; } model.OP_TIME = GetDateLongFormater(); }
/// <summary> /// 通过学号判断是否是辅导员或者研究生 /// </summary> /// <returns></returns> private string ChkUserInfo() { if (string.IsNullOrEmpty(Get("userno"))) { return("用户学工号不能为空!"); } //判断是否是辅导员 Basic_coun_info coun_info = CounHandleClass.getInstance().GetCounInfo_Obj(Get("userno")); Basic_stu_info stu_info = StuHandleClass.getInstance().GetStuInfo_Obj(Get("userno")); if (coun_info == null) { if (stu_info == null) { return("录入的学工号不存在,请确认!"); } if (stu_info.STUTYPE.Equals("B")) { return("录入的学工号不符合班级辅导员设置要求!"); } } return(string.Empty); }
/// <summary> /// 通过学工号获得辅导员基础信息 /// </summary> /// <returns></returns> private string GetUserInfo() { if (string.IsNullOrEmpty(Get("userno"))) { return("用户学工号不能为空!"); } Basic_coun_info coun_info = CounHandleClass.getInstance().GetCounInfo_Obj(Get("userno")); Basic_stu_info stu_info = StuHandleClass.getInstance().GetStuInfo_Obj(Get("userno")); #region 构建表结构 DataTable dtJson = new DataTable(); dtJson.TableName = "FDY_INFO"; //创建 “用户编号” 列 DataColumn UserIdColumn = new DataColumn(); UserIdColumn.DataType = System.Type.GetType("System.String"); UserIdColumn.ColumnName = "USERID"; dtJson.Columns.Add(UserIdColumn); //创建 “用户姓名” 列 DataColumn UserNameColumn = new DataColumn(); UserNameColumn.DataType = System.Type.GetType("System.String"); UserNameColumn.ColumnName = "USERNAME"; dtJson.Columns.Add(UserNameColumn); //创建 “用户类型” 列 DataColumn UserTypeColumn = new DataColumn(); UserTypeColumn.DataType = System.Type.GetType("System.String"); UserTypeColumn.ColumnName = "USERTYPE"; dtJson.Columns.Add(UserTypeColumn); #endregion 构建表结构 #region 给表赋值 DataRow row = dtJson.NewRow(); if (coun_info != null) { row["USERID"] = coun_info.ENO; row["USERNAME"] = coun_info.NAME; row["USERTYPE"] = "F"; } else if (stu_info != null) { row["USERID"] = stu_info.NUMBER; row["USERNAME"] = stu_info.NAME; row["USERTYPE"] = "Y"; } else { row["USERID"] = ""; row["USERNAME"] = ""; row["USERTYPE"] = ""; } dtJson.Rows.Add(row); #endregion 给表赋值 return(Json.DatatableToJson(dtJson)); }
/// <summary> /// 获得辅导员名称 /// </summary> /// <returns></returns> private string GetCounName() { string CounCode = ComHandleClass.getInstance().ByStuNumberGetCounCode(user.User_Id); string CounName = string.Empty; Basic_coun_info coun = CounHandleClass.getInstance().GetCounInfo_Obj(CounCode); if (coun != null) { CounName = coun.NAME; } return(CounName); }
/// <summary> /// 通过接口获得辅导员信息 /// </summary> /// <returns></returns> private string GetCounInfo() { ReturnJson json = new ReturnJson(); try { #region 校验参数 string counno = Request.QueryString["counno"]; string token = Request.QueryString["token"]; LogDBHandleClass.getInstance().LogOperation("", "辅导员信息接口", CValue.LOG_ACTION_TYPE_8, CValue.LOG_RECORD_TYPE_1, "辅导员信息接口被调用", "", "", ""); if (string.IsNullOrWhiteSpace(counno)) { json.status = 0; json.message = "参数错误"; LogDBHandleClass.getInstance().LogException(CValue.LOG_LEVEL_ERROR, "辅导员信息接口参数错误:"); return(Newtonsoft.Json.JsonConvert.SerializeObject(json)); } #endregion 校验参数 #region 校验密钥 string msg = ""; if (!OpenDataHandleClass.getInstance().VerifyParamForMD5(token, out msg)) { json.status = 0; json.message = msg; LogDBHandleClass.getInstance().LogException(CValue.LOG_LEVEL_ERROR, "辅导员信息接口密钥错误:" + msg); return(Newtonsoft.Json.JsonConvert.SerializeObject(json)); } #endregion 校验密钥 #region 通过工号读取辅导员信息 Basic_coun_info counInfo = CounHandleClass.getInstance().GetCounInfo_Obj(counno); if (counInfo == null) { json.status = 0; json.message = "通过学号未找到相关辅导员信息"; LogDBHandleClass.getInstance().LogException(CValue.LOG_LEVEL_ERROR, "辅导员信息接口密钥错误,通过工号未找到相关辅导员信息:" + counno); return(Newtonsoft.Json.JsonConvert.SerializeObject(json)); } OpenCounInfo openStuInfo = new OpenCounInfo(counInfo); List <object> objData = new List <object>(); objData.Add(openStuInfo); #endregion 通过工号读取辅导员信息 json.status = 1; json.message = ""; json.data = objData; return(Newtonsoft.Json.JsonConvert.SerializeObject(json)); } catch (Exception ex) { json.status = 0; json.message = "接口内部错误"; LogDBHandleClass.getInstance().LogException(CValue.LOG_LEVEL_ERROR, "调用辅导员信息接口错误:" + ex.Message + ex.StackTrace); return(Newtonsoft.Json.JsonConvert.SerializeObject(json)); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string optype = Request.QueryString["optype"]; #region 操作加载 if (!string.IsNullOrEmpty(optype)) { object o = ds.ExecuteTxtScalar(string.Format("SELECT OID FROM BASIC_STU_INFO WHERE NUMBER = '{0}'", user.User_Id)); if (o != null && o.ToString().Length > 0) { head.OID = o.ToString(); ds.RetrieveObject(head); } switch (optype.ToLower().Trim()) { case "getfamilymembers": Response.Write(GetFamilyMembers()); Response.End(); break; case "getscore": Response.Write(GetScore()); Response.End(); break; case "getdstapply": Response.Write(GetDstApply()); Response.End(); break; case "getscholarship": Response.Write(GetScholarship()); Response.End(); break; case "getloaninfo": Response.Write(GetLoanInfo()); Response.End(); break; case "getinsuranceinfo": Response.Write(GetInsuranceInfo()); Response.End(); break; } } #endregion 操作加载 #region 首次加载 else { object o = ds.ExecuteTxtScalar(string.Format("SELECT OID FROM BASIC_STU_INFO WHERE NUMBER = '{0}'", user.User_Id)); if (o != null && o.ToString().Length > 0) { head.OID = o.ToString(); ds.RetrieveObject(head); head.NATIVEPLACE = ComHandleClass.getInstance().ConvertAddress(head.NATIVEPLACE); head.REGISTPLACE = ComHandleClass.getInstance().ConvertAddress(head.REGISTPLACE); head.ADDRESS = ComHandleClass.getInstance().ConvertAddress(head.ADDRESS); head.STUPLACE = ComHandleClass.getInstance().ConvertAddress(head.STUPLACE); //头像存储目录 DataTable dt_p = ds.ExecuteTxtDataTable(string.Format("SELECT * FROM UA_USER_PHOTO WHERE USER_ID = '{0}'", user.User_Id)); if (dt_p != null && dt_p.Rows.Count > 0) { strPhotoPath = string.Format("{0}/{1}", dt_p.Rows[0]["ARCHIVE_DIRECTORY"].ToString().Replace("\\", "/"), dt_p.Rows[0]["PHOTO_NAME"].ToString().Replace("\\", "/")); } //辅导员信息 DataTable dt_coun = ds.ExecuteTxtDataTable(string.Format("SELECT * FROM UA_CLASS_GROUP WHERE RET_CHANNEL = 'D4000' AND GROUP_CLASS IN (SELECT CLASS FROM BASIC_STU_INFO WHERE NUMBER = '{0}')", user.User_Id)); if (dt_coun != null && dt_coun.Rows.Count > 0) { coun = CounHandleClass.getInstance().GetCounInfo(dt_coun.Rows[0]["GROUP_NUMBER"].ToString(), dt_coun.Rows[0]["GROUP_TYPE"].ToString()); if (coun == null) { coun = new Basic_coun_info(); } } } object bankOID = ds.ExecuteTxtScalar(string.Format("SELECT OID FROM BASIC_STU_BANK_INFO WHERE NUMBER = '{0}'", user.User_Id)); if (bankOID != null && bankOID.ToString().Length > 0) { bank.OID = bankOID.ToString(); ds.RetrieveObject(bank); } //学生饭卡信息 object riceOID = ds.ExecuteTxtScalar(string.Format("SELECT OID FROM BASIC_STU_RICECARD WHERE STU_NUMBER = '{0}'", user.User_Id)); if (riceOID != null && riceOID.ToString().Length > 0) { ricecard.OID = riceOID.ToString(); ds.RetrieveObject(ricecard); } } #endregion 首次加载 if (user.Stu_Type.Equals("Y")) //学生类型为研究生 { if (user.User_Role.Contains("S")) //角色还包含学生的,不显示 { IsShowScoreOrDst = false; } } } }