protected void submit_test_ServerClick(object sender, EventArgs e) { string name = testName.Text; string hour = testHour.Text; string num = userNum.Text; if (string.IsNullOrEmpty(name) || string.IsNullOrEmpty(hour)) { MsgBox("必填项不能为空"); return; } uint h; uint n; if (!uint.TryParse(hour, out h) || !uint.TryParse(num, out n)) { MsgBox("学时格式有误"); return; } UNITESTITEM para = new UNITESTITEM(); para.dwTestItemID = ToUInt(test_id); para.dwTestCardID = testItem.dwTestCardID; para.szTestName = name; para.dwTestHour = h; para.dwGroupPeopleNum = n; if (m_Request.Reserve.SetTestItem(para, out para) == REQUESTCODE.EXECUTE_SUCCESS) { MsgBox("修改成功", "parent.location.reload();CloseDlg();"); } else { MsgBox(m_Request.szErrMsg); } }
private string GetTestItem(UNITESTPLAN plan, out int testhour) { string ret = ""; testhour = 0; TESTITEMREQ req = new TESTITEMREQ(); req.dwGetType = (uint)TESTITEMREQ.DWGETTYPE.TESTITEMGET_BYPLANID; req.szGetKey = plan.dwTestPlanID.ToString(); req.dwCourseID = plan.dwCourseID; UNITESTITEM[] rlt; if (m_Request.Reserve.GetTestItem(req, out rlt) == REQUESTCODE.EXECUTE_SUCCESS) { for (int i = 0; i < rlt.Length; i++) { UNITESTITEM it = rlt[i]; testhour += (int)it.dwTestHour; ret += "<li><a href='?testId=" + it.dwTestItemID + "' test='" + it.dwTestItemID + "'><span class='ui-icon ui-icon-calculator'></span>" + it.szTestName + "[" + it.dwTestHour + "/" + it.dwResvTestHour + "]</a></li>"; //实验项目 if (testId != null && it.dwTestItemID == ToUInt(testId)) { curTest = it; GetTestDetail(it); } } } return(ret); }
string GetResv(UNITESTITEM test, out uint?usehour) { UNIRESERVE[] resvs = test.ResvInfo; usehour = 0; string[] week = { "一", "二", "三", "四", "五", "六", "日" }; string ret = ""; for (int i = 0; i < resvs.Length; i++) { UNIRESERVE resv = resvs[i]; uint? tchl = resv.dwTeachingTime; int start = (int)(tchl % 10000) / 100; int end = (int)tchl % 100; usehour += resv.dwTestHour; string rooms = GetRoomsFromResvDev(resv.ResvDev); string time = (int)tchl / 100000 + "周【" + "星期" + week[(int)((tchl / 10000) % 10)] + "】第" + start + (start == end ? "" : ("-" + end)) + "节"; ret += "<tr><td class='text-primary'>" + time + "</td>" + "<td>" + rooms + "</td>" + "<td>" + resv.dwResvUsers + " 人</td>" + "<td><span class='text-primary'>" + resv.dwTestHour + "</span> 学时</td>" + "<td>" + Util.Converter.ResvStatusConverter(resv.dwStatus) + "</td>" + "<td>" + (!IsStat(resv.dwStatus, (uint)UNIRESERVE.DWSTATUS.RESVSTAT_UNDO) ? "<a href='Attendance.aspx?plan_id=" + test.dwTestPlanID + "&test_id=" + test.dwTestItemID + "&resv_id=" + resv.dwResvID + "&start=" + yearTerm.dwBeginDate + "&end=" + yearTerm.dwEndDate + "' target='_blank'>学生考勤>></a>" : "<span class='grey'>学生考勤>></span>") + "</td>" + "<td><span class='pull-right text-info'><span title='删除' class='glyphicon glyphicon-trash click' rsv_id='" + resv.dwResvID + "' onclick='delResv(this);'></span></span></td></tr>"; } if (ret == "") { ret = "<tr><td colspan='10' class='text-center'>请点击【预约排课】预约上课</td></tr>"; } return(ret); }
private void ConvertTestResvInfo(UNITESTITEM test, ref List <uniresv> list) { UNIRESERVE[] resvs = test.ResvInfo; for (int j = 0; j < resvs.Length; j++) { uniresv resv = new uniresv(); UNIRESERVE info = resvs[j]; RESVDEV[] rsvdev = info.ResvDev; string rooms = GetRoomsFromResvDev(rsvdev); resv.id = info.dwResvID.ToString(); resv.title = test.szGroupName + ";" + rooms; // resv.detail = "房间:" + rooms + "<br/>班级:" + test.szGroupName + "<br/>实验:" + test.szTestName + "<br/>课程:" + test.szCourseName; resv.detail = info.dwResvID.ToString(); resv.testId = test.dwTestItemID.ToString(); resv.testName = test.szTestName; resv.owner = test.szTeacherName; resv.ownerAccno = test.dwTeacherID.ToString(); resv.groupId = test.dwGroupID.ToString(); // resv.groupName = test.szGroupName; resv.groupName = info.dwResvID.ToString(); resv.planId = test.dwTestPlanID.ToString(); resv.planName = test.szTestPlanName; actResv(info, ref resv); list.Add(resv); } }
string GetResv(UNITESTITEM test) { UNIRESERVE[] resvs = test.ResvInfo; //usehour = 0; string[] week = { "一", "二", "三", "四", "五", "六", "日" }; string ret = ""; for (int i = 0; i < resvs.Length; i++) { UNIRESERVE resv = resvs[i]; string date = ""; if (resv.dwPreDate > 0) { date = (resv.dwPreDate / 100 % 100) + "月" + (resv.dwPreDate % 100) + "日"; } uint?tchl = resv.dwTeachingTime; int start = (int)(tchl % 10000) / 100; int end = (int)tchl % 100; //usehour += resv.dwTestHour; string rooms = GetRoomsFromResvDev(resv.ResvDev); string time = "(第" + (int)tchl / 100000 + "周)【" + "星期" + week[(int)((tchl / 10000) % 10)] + "】第" + start + (start == end ? "" : ("-" + end)) + "节"; ret += "<tr><td class='text-primary'>" + date + time + "</td>" + "<td>" + resv.szLabName + "</td>" + "<td>" + rooms + "</td>" + "<td><span class='text-primary'>" + resv.dwTestHour + "</span> 学时</td>" + "<td>" + Util.Converter.ResvStatusConverter(resv.dwStatus) + "</td>" + "</tr>"; } return(ret); }
protected void submit_test_ServerClick(object sender, EventArgs e) { string name = testName.Text; string hour = testHour.Text; string num = userNum.Text; string report = Request["up_file"]; if (string.IsNullOrEmpty(name) || string.IsNullOrEmpty(hour)) { MsgBox("必填项不能为空"); return; } UNIACCOUNT acc = (UNIACCOUNT)Session["LOGIN_ACCINFO"]; //TESTCARD card = new TESTCARD(); UNITESTPLAN plan = GetTestPlanByID(planId); if (plan.dwTestPlanID == null) { MsgBox("获取实验计划失败"); return; } //card.szTestName = planId +"_"+ DateTime.Now.Ticks ; //if (m_Request.Reserve.SetTestCard(card, out card) == REQUESTCODE.EXECUTE_SUCCESS) //{ UNITESTITEM para = new UNITESTITEM(); para.szTestName = name; para.dwTestPlanID = plan.dwTestPlanID; para.szTestPlanName = plan.szTestPlanName; para.dwTeacherID = acc.dwAccNo; //para.dwTestCardID = card.dwTestCardID; if (!string.IsNullOrEmpty(num)) { para.dwGroupPeopleNum = ToUInt(num); } else { para.dwGroupPeopleNum = (uint)GetGroupMemCount(plan.dwGroupID); } para.dwTestHour = ToUInt(hour); para.dwGroupID = plan.dwGroupID; if (!string.IsNullOrEmpty(report)) { para.szReportFormURL = report; } if (m_Request.Reserve.SetTestItem(para, out para) == REQUESTCODE.EXECUTE_SUCCESS) { MsgBox("新建成功", "parent.location.reload();CloseDlg();"); return; } //} MsgBox(m_Request.szErrMsg); }
private string InitResvPanel(UNITESTITEM test, out uint?usehour) { string v = "<div class='panel_resv_list'>" + //"<button type='button' class='btn btn-primary pull-right' onclick='location.href=\"Reserve.aspx?term=" + yearTerm.dwYearTerm + "&test_id=" + test.dwTestItemID + "\"'>预约实验</button>" + "<table class='table' style='margin-bottom:0;'><tbody>" + GetResv(test, out usehour) + "</tbody></table></div>"; //resvPanelList += v; return(v); //dic.Add(test.dwTestItemID, v); }
protected void Page_Load(object sender, EventArgs e) { m_bRemember = false; string szTestItem = Request["testItemID"]; Response.CacheControl = "no-cache"; TESTITEMREQ vrGetCls = new TESTITEMREQ(); if (szTestItem != null && szTestItem != "") { vrGetCls.dwGetType = (uint)TESTITEMREQ.DWGETTYPE.TESTITEMGET_BYID; vrGetCls.szGetKey = szTestItem; } UNITESTITEM[] vtCls; vrGetCls.szReqExtInfo.dwNeedLines = 10; //最多10条 if (m_Request.Reserve.GetTestItem(vrGetCls, out vtCls) == REQUESTCODE.EXECUTE_SUCCESS && vtCls != null && vtCls.Length > 0) { UNITESTITEM testitem = new UNITESTITEM(); testitem.dwTestItemID = vtCls[0].dwTestItemID; if (m_Request.Reserve.DelTestItem(testitem) == REQUESTCODE.EXECUTE_SUCCESS) { Response.Write("success"); return; /* * TESTCARD testcard = new TESTCARD(); * testcard.dwTestCardID = vtCls[0].dwTestCardID; * if (m_Request.Reserve.DelTestCard(testcard) == REQUESTCODE.EXECUTE_SUCCESS) * { * * } * else * { * Response.Write("错误:" + m_Request.szErrMessage); * } * */ } else { Response.Write("错误:" + m_Request.szErrMessage); } Response.Write("success"); } else { Response.Write("错误:" + m_Request.szErrMessage); } }
private void InitTest() { testItem = GetTestItemByID(test_id); if (testItem.dwTestItemID != null) { testName.Text = testItem.szTestName; testHour.Text = testItem.dwTestHour.ToString(); userNum.Text = testItem.dwGroupPeopleNum.ToString(); } else { MsgBox(m_Request.szErrMsg); } }
private void InitTest() { test = GetTestItemByID(test_id); if (test.dwTestItemID != null) { if (!string.IsNullOrEmpty(test.szReportFormURL)) { fileName = "<a href='" + Page.ResolveClientUrl("~/ClientWeb/") + "upload/UpLoadFile/" + test.szReportFormURL + "'>模版已存在,点击下载</a>"; } } else { MsgBox(m_Request.szErrMsg); } }
private string GetValidPeriod(UNITESTITEM test) { uint?ret = 0; UNIRESERVE[] rsvs = test.ResvInfo; foreach (UNIRESERVE info in rsvs) { ret += info.dwTestHour; } ret = test.dwTestHour - ret; if (ret < 0) { ret = 0; } return(ret.ToString()); }
private void InitTestItemGroup(string testId) { //TESTITEMREQ req = new TESTITEMREQ(); UNITESTITEM it = GetTestItemByID(testId); if (it.dwTestItemID != null) { TESTITEMMEMRESV[] list = GetTestMemResv(it.dwTestItemID, it.dwTestPlanID, it.dwGroupID, null); if (list != null) { //初始组信息 group_id.Value = it.dwGroupID.ToString(); group_name.Value = it.szGroupName; mb_num.Value = it.dwGroupUsers.ToString(); // uint?num = it.dwResvTestHour; //int pg = 10; for (int i = 0; i < list.Length; i++) { //if (i % pg == 0) //{ //if (i != 0) mbList += "</tbody>"; //pageCtrl += "<li><span>" + (i / pg + 1) + "</span></li>"; //mbList += "<tbody>"; //} uint?h = list[i].dwResvTestHour; mbList += "<tr key='" + list[i].dwAccNo + "' kind='2' class='" + (h == num ? "it" : "done") + "'><td class='ellipsis'>" + list[i].szTrueName + " <span class='grey'>(已预约:" + h + " 时)</span></td><td class='text-center grey click item_toggle'>" + "<span class='glyphicon glyphicon-ok'></span></td></tr>"; //if (i == list.Length - 1) mbList += "</tbody>"; } } else { MsgBox(m_Request.szErrMsg); } } else { MsgBox(m_Request.szErrMsg); } }
private void GetTestDetail(UNITESTITEM test) { UNIRESERVE[] resvs = test.ResvInfo; int usehour = 0; for (int i = 0; i < resvs.Length; i++) { UNIRESERVE resv = resvs[i]; uint? tchl = resv.dwTeachingTime; int start = (int)(tchl % 10000) / 100; int end = (int)tchl % 100; usehour += (int)resv.dwTestHour; string rooms = GetRoomsFromResvDev(resv.ResvDev); //组成员 string member = "个人预约"; if ((resv.dwMemberKind & (uint)UNIRESERVE.DWMEMBERKIND.MEMBERKIND_GROUP) > 0) { GROUPMEMDETAIL[] mbs = GetMembers(resv.dwMemberID); if (mbs != null && mbs.Length > 0) { string str = ""; for (int j = 0; j < mbs.Length; j++) { str += mbs[j].szTrueName + ","; } member = str.Substring(0, str.Length - 1); } } string time = Get1970Date((int)resv.dwBeginTime).Substring(5) + "-" + Get1970Date((int)resv.dwEndTime).Substring(11); testDetail += "<tr><td>" + resv.szTestName + "</td><td>" + time + "</td>" + "<td>" + rooms + "</td>" + "<td>" + resv.dwResvUsers + " 人 <span class='click' onclick='uni.msgBox(\"" + member + "\",\"成员名称\")'>详细</span></td>" + "<td><span>" + resv.dwTestHour + "</span> 学时</td>" + "<td>" + Util.Converter.ResvStatusConverter(resv.dwStatus) + "</td>" + "<td><a onclick='delResv(" + resv.dwResvID + ")'>删除</a></td></tr>"; } if (testDetail == "") { testDetail = "<tr><td colspan='10' style='text-align:center;'>请点击【预约实验室】预约上课</td></tr>"; } }
private void InitTest() { test_id.Value = testitem_id; TESTITEMREQ req = new TESTITEMREQ(); req.dwGetType = (uint)TESTITEMREQ.DWGETTYPE.TESTITEMGET_BYID; req.szGetKey = testitem_id; UNITESTITEM[] rlt; if (m_Request.Reserve.GetTestItem(req, out rlt) == REQUESTCODE.EXECUTE_SUCCESS && rlt.Length > 0) { UNITESTITEM test = rlt[0]; valid_period.Value = GetValidPeriod(test); group_id.Value = test.dwGroupID.ToString(); mb_num.Value = GetGroupMemCount(test.dwGroupID).ToString(); groupName = test.szGroupName; testName = test.szTestName; curLink = test.dwTestPlanID + "," + test.dwTestItemID; uint?h = test.dwResvTestHour; //CheckTestHours(test,null); InitCourse(test.dwCourseID); } }
protected void submit_test_ServerClick(object sender, EventArgs e) { string report = Request["up_file"]; if (string.IsNullOrEmpty(report)) { MsgBox("还未上传文件"); return; } UNITESTITEM para = test; para.dwTestItemID = ToUInt(test_id); para.szReportFormURL = report; if (m_Request.Reserve.SetTestItem(para, out para) == REQUESTCODE.EXECUTE_SUCCESS) { MsgBox("保存成功", "CloseDlg();"); } else { MsgBox(m_Request.szErrMsg); } }
private void InitReport() { UNITESTITEM test = GetTestItemByID(testId); if (test.dwTestItemID == null) { MsgBox("未找到实验"); return; } else { curLink = test.dwTestPlanID + "," + testId; plan = GetTestPlanByID(test.dwTestPlanID.ToString()); InitResvRec(); curTest = test.szTestName; } TESTITEMINFOREQ req = new TESTITEMINFOREQ(); req.dwTeacherID = acc.dwAccNo; req.dwTestItemID = ToUInt(testId); TESTITEMINFO[] rlt; if (m_Request.Reserve.GetTestItemInfo(req, out rlt) == REQUESTCODE.EXECUTE_SUCCESS) { for (int i = 0; i < rlt.Length; i++) { TESTITEMINFO info = rlt[i]; string url = info.szReportURL == "" ? "<span class='orange'>未提交实验报告</span>" : "<a href='" + Page.ResolveClientUrl("~/ClientWeb/") + "upload/UpLoadFile/" + info.dwTestItemID + "/" + info.szReportURL + "'>下载实验报告 <span class='glyphicon glyphicon-download'></span></a>"; uint? score = info.dwReportScore; string szScore = (score == null || score == 0) ? "<span class='orange'>未评分</span>" : "<span class='text-primary'>" + score + " 分</span>"; report_list += "<tr><td>" + (i + 1) + "</td><td>" + info.szTrueName + "(" + info.szPID + ")</td><td>" + url + "</td><td>" + szScore + "</td>" + "<td>" + GetAttend(info.dwAccNo) + "</td>" + "<td><button type='button' class='btn btn-info btn-xs' onclick='correct(\"" + info.dwSID + "\",\"" + info.dwAccNo + "\",\"" + info.dwReportScore + "\",\"" + info.szReportMarkInfo + "\");'>评分 <span class='glyphicon glyphicon-edit'></span></button></td></tr>"; } } else { MsgBox(m_Request.szErrMsg); } }
private string GetTestItem(UNITESTPLAN plan, out int testhour, out int itemnum) { string ret = ""; testhour = 0; itemnum = 0; TESTITEMREQ req = new TESTITEMREQ(); req.dwGetType = (uint)TESTITEMREQ.DWGETTYPE.TESTITEMGET_BYPLANID; req.szGetKey = plan.dwTestPlanID.ToString(); req.dwCourseID = plan.dwCourseID; UNITESTITEM[] rlt; if (m_Request.Reserve.GetTestItem(req, out rlt) == REQUESTCODE.EXECUTE_SUCCESS) { itemnum = rlt.Length; for (int i = 0; i < rlt.Length; i++) { UNITESTITEM it = rlt[i]; testhour += (int)it.dwTestHour; uint? usehour;//手动计算的预约时间总和 string rsv = InitResvPanel(it, out usehour); string uped = string.IsNullOrEmpty(it.szReportFormURL) ? "(未上传)" : "(已上传)"; ret += "<tr class='tr_test_it' id='test_it_" + it.dwTestItemID + "' style='border-bottom: 2px #31b0d5 solid;'><td>" + it.szTestName + "</td>" + "<td>" + it.dwTestHour + " 学时(已用<span class='red'>" + it.dwResvTestHour + "</span>学时)</td>" + //"<td>" + Util.Converter.GetTestItemState(it.dwStatus) + "</td>" + "<td><button type='button' style='color:#428bca;' class='btn btn-default btn-xs' planid=" + it.dwTestPlanID + " testid=" + it.dwTestItemID + " onclick='linkResv(\"Reserve.aspx?term=" + yearTerm.dwYearTerm + "&test_id=" + it.dwTestItemID + "\",this)'>预约排课 <span class='glyphicon glyphicon-forward'></span></button></td>" + "<td><a href='Report.aspx?test_id=" + it.dwTestItemID + "' target='_blank'>实验报告>></a></td>" + "<td><span class='pull-right text-info'><a class='click' test_id='" + it.dwTestItemID + "' onclick='uploadFile(this)'>" + uped + "上传报告模版 <span class='glyphicon glyphicon-upload'></span></a>" + "<a class='click' test_id='" + it.dwTestItemID + "' onclick='setTestitem(this)'>更改设置 <span class='glyphicon glyphicon-cog'></span></a> <span class='glyphicon glyphicon-trash " + (isHitem?"hidden":"") + "' " + (it.ResvInfo.Length == 0 ? "title='删除' onclick='delTestitem(\"" + it.dwTestItemID + "\",\"" + it.dwTestCardID + "\")' style='cursor:pointer;'" : "style='color:#ddd;'") + "></span></span></td></tr>"; ret += "<tr><td colspan='8' style='padding:0;'>" + rsv + "</td></tr>"; } } return(ret); }
protected void Page_Load(object sender, EventArgs e) { REQUESTCODE uResponse = REQUESTCODE.EXECUTE_FAIL; Response.CacheControl = "no-cache"; string szTestName = Request["szTestName"]; uint dwGroupPeopleNum = Parse(Request["dwGroupPeopleNum"]); uint dwTestItemTestHour = Parse(Request["dwTestItemTestHour"]); string szTestItemMemo = Request["szTestItemMemo"]; uint dwTestClass = Parse(Request["dwTestClass"]); uint dwTestKind = Parse(Request["dwTestKind"]); string testitemid = (Request["testitemid"]); TESTITEMREQ vrGetCls = new TESTITEMREQ(); if (testitemid != null && testitemid != "") { vrGetCls.dwGetType = (uint)TESTITEMREQ.DWGETTYPE.TESTITEMGET_BYID; vrGetCls.szGetKey = testitemid; } UNITESTITEM[] vtCls; vrGetCls.szReqExtInfo.dwNeedLines = 10; //最多10条 if (m_Request.Reserve.GetTestItem(vrGetCls, out vtCls) == REQUESTCODE.EXECUTE_SUCCESS && vtCls != null && vtCls.Length > 0) { UNITESTITEM testItem = new UNITESTITEM(); testItem = vtCls[0]; testItem.szTestName = szTestName; testItem.dwGroupPeopleNum = dwGroupPeopleNum; testItem.szTestName = szTestName; testItem.szMemo = szTestItemMemo; testItem.dwTestClass = dwTestClass; testItem.dwTestKind = dwTestKind; testItem.dwTestHour = dwTestItemTestHour; uResponse = m_Request.Reserve.SetTestItem(testItem, out testItem); if (uResponse == REQUESTCODE.EXECUTE_SUCCESS) { TESTCARD newTestCard = new TESTCARD(); newTestCard.dwTestCardID = vtCls[0].dwTestCardID; Response.Write("success"); /*testcard不用管 * if (m_Request.Reserve.SetTestCard(newTestCard, out newTestCard) == REQUESTCODE.EXECUTE_SUCCESS) * { * Response.Write("success"); * } * else * { * string szError = m_Request.szErrMessage.ToString(); * * Response.Write("错误:" + szError); * return; * } * */ } else { if (m_Request.szErrMessage != null) { string szError = m_Request.szErrMessage.ToString(); Response.Write("错误:" + szError); return; } else { Response.Write("错误:登陆超时"); return; } } } else { Response.Write("错误:获取数据失败"); } }
protected void Page_Load(object sender, EventArgs e) { m_TermList = GetTermList(); if (Request["op"] == "set") { m_szTitle = "修改实验计划"; } string szID = Request["id"]; if (string.IsNullOrEmpty(szID) || szID == "0") { szID = Request["dwTestPlanID"]; } UNITESTPLAN vrParameter = new UNITESTPLAN(); GetHTTPObj(out vrParameter); vrParameter.dwKind = (uint)UNITESTPLAN.DWKIND.TESTPLANKIND_TEACHING; if (Request["IsSubmit"] == "true") { UNITESTPLAN vrResult; vrParameter.dwYearTerm = GetTerm(Request["dwYearTerm"]); if (!SetGroupFromClient(ref vrParameter.dwGroupID)) { return; } bool bOK = true; bool SetTestItem = (Request["SetTestItem"] == "true"); if (m_Request.Reserve.SetTestPlan(vrParameter, out vrResult) == REQUESTCODE.EXECUTE_SUCCESS) { szID = vrResult.dwTestPlanID.ToString(); if (SetTestItem) { //处理被删除的实验项目 string szTestItemDelList = Request["TestItemDelList"]; if (!string.IsNullOrEmpty(szTestItemDelList)) { string[] arrTestItemDelList = szTestItemDelList.Split(new char[] { ',' }); foreach (string szTestItemID in arrTestItemDelList) { string[] arrID = szTestItemID.Split(new char[] { ':' }); if (arrID.Length == 2) { uint testitemID = ToUint(arrID[0]); uint testcardID = ToUint(arrID[1]); UNITESTITEM delItem = new UNITESTITEM(); delItem.dwTestItemID = testitemID; delItem.dwTestCardID = testcardID; if (m_Request.Reserve.DelTestItem(delItem) != REQUESTCODE.EXECUTE_SUCCESS) { } TESTCARD delCard = new TESTCARD(); delCard.dwTestCardID = testcardID; if (m_Request.Reserve.DelTestCard(delCard) != REQUESTCODE.EXECUTE_SUCCESS) { } } } } //添加修改实验项目 string szItemAllData = Request["ItemAllData"]; if (!string.IsNullOrEmpty(szItemAllData)) { NameValueCollection result = HttpUtility.ParseQueryString(szItemAllData); int ItemDataCount = int.Parse(result["ItemDataCount"]); for (int i = 0; i < ItemDataCount; i++) { string item = result["ItemData" + i]; item = HttpUtility.UrlDecode(item); NameValueCollection testreq = HttpUtility.ParseQueryString(item); TESTCARD vrTestCard = new TESTCARD(); vrTestCard = (TESTCARD)UniLibrary.ObjHelper.NameValue2OBJ(testreq, "", typeof(TESTCARD)); if (vrTestCard.dwTestCardID == 0) { vrTestCard.dwTestCardID = null; } TESTCARD vrTestCardRet; if (m_Request.Reserve.SetTestCard(vrTestCard, out vrTestCardRet) == REQUESTCODE.EXECUTE_SUCCESS) { UNITESTITEM vrTestItem = new UNITESTITEM(); UNITESTITEM vrTestItemResult; vrTestItem.dwTestItemID = ToUint(testreq["dwTestItemID"]); if (vrTestItem.dwTestItemID == 0) { vrTestItem.dwTestItemID = null; } vrTestItem.dwTestPlanID = vrResult.dwTestPlanID; vrTestItem.szTestPlanName = vrResult.szTestPlanName; vrTestItem.dwTotalTestHour = vrTestCardRet.dwTestHour; //vrTestItem.dwTeacherID = ((ADMINLOGINRES)Session["LoginResult"]).AdminInfo.dwAccNo; vrTestItem.dwTestCardID = vrTestCardRet.dwTestCardID; vrTestItem.dwCourseID = vrResult.dwCourseID; vrTestItem.dwGroupID = vrResult.dwGroupID; vrTestItem.szMemo = vrTestCardRet.szMemo; if (m_Request.Reserve.SetTestItem(vrTestItem, out vrTestItemResult) == REQUESTCODE.EXECUTE_SUCCESS) { } else { bOK = false; break; } } else { bOK = false; break; } } } } } else { bOK = false; } if (bOK) { MessageBox(m_szTitle + "成功", m_szTitle + "成功", MSGBOX.SUCCESS, MSGBOX_ACTION.OK); } else { MessageBox(m_szTitle + "失败," + m_Request.szErrMessage, m_szTitle + "失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE); } } //if (Request["op"] == "set" && Request["IsSubmit"] != "true") if (!string.IsNullOrEmpty(szID) && szID != "0") { TESTPLANREQ vrGetParameter = new TESTPLANREQ(); UNITESTPLAN[] vrGetResult; vrGetParameter.dwGetType = (uint)TESTPLANREQ.DWGETTYPE.TESTPLANGET_BYID; vrGetParameter.szGetKey = szID; if (m_Request.Reserve.GetTestPlan(vrGetParameter, out vrGetResult) == REQUESTCODE.EXECUTE_SUCCESS && vrGetResult.Length > 0) { vrParameter = vrGetResult[0]; if (vrParameter.dwYearTerm == 0) { vrParameter.dwYearTerm = GetDefaultTerm(null); } //获取班级列表 GROUPREQ vrGroupReq = new GROUPREQ(); UNIGROUP[] vrGroupRet; //vrGroupReq.dwGetType = (uint)GROUPREQ.DWGETTYPE.GROUPGET_BYID; vrGroupReq.dwGroupID = vrParameter.dwGroupID;//.ToString(); if (m_Request.Group.GetGroup(vrGroupReq, out vrGroupRet) == REQUESTCODE.EXECUTE_SUCCESS && vrGroupRet.Length > 0) { for (int i = 0; i < vrGroupRet[0].szMembers.Length; i++) { m_szGroupID += vrGroupRet[0].szMembers[i].dwMemberID + ","; m_szGroupName += vrGroupRet[0].szMembers[i].szName + ","; } } //获取项目列表 TESTITEMREQ vrTestItemReq = new TESTITEMREQ(); UNITESTITEM[] vrTestItemRet; vrTestItemReq.dwGetType = (uint)TESTITEMREQ.DWGETTYPE.TESTITEMGET_BYPLANID; vrTestItemReq.szGetKey = szID; if (m_Request.Reserve.GetTestItem(vrTestItemReq, out vrTestItemRet) == REQUESTCODE.EXECUTE_SUCCESS) { m_szTestItemJSData = "["; for (int i = 0; i < vrTestItemRet.Length; i++) { m_szTestItemJSData += UniLibrary.ObjHelper.OBJ2JS(vrTestItemRet[i]) + ","; } m_szTestItemJSData += "null]"; } } else { MessageBox("获取失败,无此记录", "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL); } } TranTerm(ref vrParameter.dwYearTerm); PutJSObj(vrParameter); }
protected void Page_Load(object sender, EventArgs e) { if (LoadPage()) { if (act == "get_testitem") { GetTestItem(); } else if (act == "report_correct") { if (IsLoginReady()) { Correct(); } } else if (act == "report_upload") { if (IsLoginReady()) { string file = Request["file"]; string sid = Request["sid"]; if (!string.IsNullOrEmpty(file) && !string.IsNullOrEmpty(sid)) { REPORTUPLOAD para = new REPORTUPLOAD(); para.dwAccNo = curAcc.dwAccNo; para.dwSID = ToUInt(sid); para.szReportURL = file; if (m_Request.Reserve.UploadReport(para) == REQUESTCODE.EXECUTE_SUCCESS) { SucMsg("上传成功"); } else { ErrMsg(m_Request.szErrMsg); } } else { ErrMsgP(); } } } else if (act == "set_plan_status") { setPlanStatus(); } else if (act == "del_plan") { string id = Request["plan_id"]; if (string.IsNullOrEmpty(id)) { ErrMsg("参数有误"); return; } UNITESTPLAN para = new UNITESTPLAN(); para.dwTestPlanID = ToUInt(id); if (m_Request.Reserve.DelTestPlan(para) == REQUESTCODE.EXECUTE_SUCCESS) { SucMsg(); } else { ErrMsg(m_Request.szErrMsg); } } else if (act == "del_testitem") { string id = Request["test_id"]; string card_id = Request["card_id"]; UNITESTITEM para = new UNITESTITEM(); para.dwTestItemID = ToUInt(id); if (m_Request.Reserve.DelTestItem(para) == REQUESTCODE.EXECUTE_SUCCESS) { SucMsg(); //附带删除项目卡,否则不能创建同名项目 if (!string.IsNullOrEmpty(card_id)) { TESTCARD card = new TESTCARD(); card.dwTestCardID = ToUInt(card_id); m_Request.Reserve.DelTestCard(card); } } else { ErrMsg(m_Request.szErrMsg); } } } }
void Import(string szFilePath, string szErrListRawFile, out uint nImported, out uint nFailed) { ErrorLines = new ArrayList(); nImported = 0; nFailed = 0; string strline; StreamWriter tWrite = new StreamWriter(szErrListRawFile, false, Encoding.GetEncoding("gb2312")); System.IO.StreamReader mysr = new StreamReader(Server.MapPath(szFilePath), Encoding.GetEncoding("gb2312")); while ((strline = mysr.ReadLine()) != null) { uint uTermID = Parse(Request["dwYearTerm"]); string[] szList = strline.Split(','); string szCourName = szList[0]; string szClassName = (szList[1]); string szTeachLogonName = (szList[2]); UNIACCOUNT accinfoTeachar = new UNIACCOUNT(); if (GetAccByLogonName(szTeachLogonName, out accinfoTeachar)) { UNITESTPLAN setTestPlan = new UNITESTPLAN(); COURSEREQ courseGet = new COURSEREQ(); courseGet.szCourseName = szCourName; UNICOURSE[] courseRes; UNICOURSE setCourse = new UNICOURSE(); if (m_Request.Reserve.GetCourse(courseGet, out courseRes) == REQUESTCODE.EXECUTE_SUCCESS && courseRes != null && courseRes.Length > 0) { setCourse = new UNICOURSE(); setCourse = courseRes[0]; } else { setCourse.szCourseName = szCourName; setCourse.dwTestHour = 100; setCourse.szCourseCode = GetDevSN().ToString(); setCourse.dwCourseProperty = (uint)UNICOURSE.DWCOURSEPROPERTY.COURSEPROP_NOTHEORY; if (m_Request.Reserve.SetCourse(setCourse, out setCourse) != REQUESTCODE.EXECUTE_SUCCESS) { nFailed = nFailed + 1; continue; } //新建课程 } UNIGROUP setGroup = new UNIGROUP(); UNIGROUP[] setGroupList = GetGroupByName(szClassName); if (setGroupList != null && setGroupList.Length > 0) { setGroup = new UNIGROUP(); setGroup = setGroupList[0]; } else { //新建班级 UNITERM[] vtTerm = GetTermByID(uTermID); if (vtTerm != null && vtTerm.Length > 0) { NewGroup(szClassName, (uint)UNIGROUP.DWKIND.GROUPKIND_RERV, out setGroup, (uint)vtTerm[0].dwEndDate); } else { nFailed = nFailed + 1; continue; } } {//获取testplan是否已经新建 TESTPLANREQ testPlanReq = new TESTPLANREQ(); testPlanReq.dwYearTerm = uTermID; testPlanReq.dwGetType = (uint)TESTPLANREQ.DWGETTYPE.TESTPLANGET_BYNAME; testPlanReq.szGetKey = accinfoTeachar.szTrueName + "_" + szCourName; UNITESTPLAN[] vtTestPlan; if (m_Request.Reserve.GetTestPlan(testPlanReq, out vtTestPlan) == REQUESTCODE.EXECUTE_SUCCESS && vtTestPlan != null && vtTestPlan.Length > 0) { nFailed = nFailed + 1; continue; } } setTestPlan.szTestPlanName = accinfoTeachar.szTrueName + "_" + szCourName; setTestPlan.dwGroupID = setGroup.dwGroupID; setTestPlan.dwCourseID = setCourse.dwCourseID; setTestPlan.dwTeacherID = accinfoTeachar.dwAccNo; setTestPlan.dwKind = (uint)UNITESTPLAN.DWKIND.TESTPLANKIND_TEACHING; setTestPlan.dwTestHour = setCourse.dwTestHour; setTestPlan.dwYearTerm = uTermID; REQUESTCODE uResponse = m_Request.Reserve.SetTestPlan(setTestPlan, out setTestPlan); if (uResponse == REQUESTCODE.EXECUTE_SUCCESS) { nImported = nImported + 1; //新建默认的一个实验项目 uint uNewItem = 1; if (uNewItem == 1) { TESTCARD newCard = new TESTCARD(); newCard.dwGroupPeopleNum = 1; newCard.szTestName = setTestPlan.szTestPlanName; newCard.dwTestHour = setTestPlan.dwTestHour; if (m_Request.Reserve.SetTestCard(newCard, out newCard) == REQUESTCODE.EXECUTE_SUCCESS) { UNITESTITEM testItem = new UNITESTITEM(); testItem.dwTestPlanID = setTestPlan.dwTestPlanID; testItem.dwTestCardID = newCard.dwTestCardID; testItem.szTestName = setTestPlan.szTestPlanName; testItem.dwMaxResvTimes = 100; m_Request.Reserve.SetTestItem(testItem, out testItem); } } } else { nFailed = nFailed + 1; } } } tWrite.Close(); }
protected void Page_Load(object sender, EventArgs e) { Response.CacheControl = "no-cache"; UNITESTPLAN newTestPlan = new UNITESTPLAN(); GetHTTPObj(out newTestPlan); UNIACCOUNT accTeacher = new UNIACCOUNT(); if (GetAccByAccno(newTestPlan.dwTeacherID.ToString(), out accTeacher)) { newTestPlan.szTestPlanName = accTeacher.szTrueName + "_" + newTestPlan.szCourseName; } else { Response.Write("错误:" + "教师信息不能为空"); return; } if (Session["ClassGroupID"] != null && Session["ClassGroupID"].ToString() != "") { newTestPlan.dwGroupID = Parse(Session["ClassGroupID"].ToString()); } if ((newTestPlan.dwKind & (uint)UNITESTPLAN.DWKIND.TESTPLANKIND_OPEN) > 0) { UNITERM[] selectTerm = GetTermByID((uint)newTestPlan.dwYearTerm); if (selectTerm != null && selectTerm.Length > 0) { UNIGROUP groupClass = new UNIGROUP(); if (NewGroup(newTestPlan.szCourseName + "-" + newTestPlan.szTeacherName, (uint)UNIGROUP.DWKIND.GROUPKIND_RERV, out groupClass, (uint)selectTerm[0].dwEndDate)) { newTestPlan.dwGroupID = groupClass.dwGroupID; } else { Response.Write("错误:" + m_Request.szErrMessage); return; } } else { Response.Write("错误:" + "找不到对应学期信息"); return; } } newTestPlan.dwTheoryHour = 99; newTestPlan.dwPracticeHour = 100; newTestPlan.dwTestNum = 101; REQUESTCODE uResponse = m_Request.Reserve.SetTestPlan(newTestPlan, out newTestPlan); if (uResponse == REQUESTCODE.EXECUTE_SUCCESS) { Session["ClassGroupID"] = null; if (ConfigConst.GCscheduleMode <= 2)//新建计划同时新建项目 { TESTCARD newTestCard = new TESTCARD(); newTestCard.dwGroupPeopleNum = 1; newTestCard.szTestName = newTestPlan.szTestPlanName; newTestCard.szMemo = newTestPlan.szMemo;; newTestCard.dwTestClass = 1; newTestCard.dwTestKind = 1;; newTestCard.dwTestHour = newTestPlan.dwTestHour;; uResponse = REQUESTCODE.EXECUTE_SUCCESS;//testCARD不用管//m_Request.Reserve.SetTestCard(newTestCard, out newTestCard); if (uResponse == REQUESTCODE.EXECUTE_SUCCESS) { UNITESTITEM testItem = new UNITESTITEM(); testItem.dwGroupPeopleNum = 1; testItem.dwTestPlanID = newTestPlan.dwTestPlanID; testItem.szTestPlanName = newTestPlan.szTestPlanName; testItem.szMemo = newTestPlan.szMemo;; testItem.dwTestClass = 1; testItem.dwTestKind = 1;; testItem.dwTestHour = newTestPlan.dwTestHour;; testItem.szTestName = newTestPlan.szTestPlanName; uResponse = m_Request.Reserve.SetTestItem(testItem, out testItem); if (uResponse == REQUESTCODE.EXECUTE_SUCCESS) { Response.Write("testitemid:" + testItem.dwTestItemID + "," + newTestCard.dwTestCardID); return; } else { if (m_Request.szErrMessage != null) { string szError = m_Request.szErrMessage.ToString(); m_Request.Reserve.DelTestCard(newTestCard); Response.Write("错误:" + szError); return; } else { Response.Write("错误:登陆超时"); return; } } } else { string szError = m_Request.szErrMessage.ToString(); Response.Write("错误:" + szError); return; } } Response.Write(newTestPlan.dwTestPlanID.ToString()); } else { if (m_Request.szErrMessage != null) { Response.Write("错误:" + m_Request.szErrMessage.ToString()); } else { Response.Write("错误:登陆超时"); } } }
protected void Page_Load(object sender, EventArgs e) { Response.CacheControl = "no-cache"; uint uTestPlanID = Parse(Request["testPlanID"]); if (uTestPlanID == 0) { Response.Write("错误:" + "试验计划编号有误"); return; } UNITESTPLAN[] testplan = GetTestPlanByID(uTestPlanID); string szTestName = Request["szTestName"]; uint dwGroupPeopleNum = Parse(Request["dwGroupPeopleNum"]); uint dwTestItemTestHour = Parse(Request["dwTestItemTestHour"]); string szTestItemMemo = Request["szTestItemMemo"]; uint dwTestClass = Parse(Request["dwTestClass"]); uint dwTestKind = Parse(Request["dwTestKind"]); TESTCARD newTestCard = new TESTCARD(); newTestCard.dwGroupPeopleNum = dwGroupPeopleNum; newTestCard.szTestName = szTestName; newTestCard.szMemo = szTestItemMemo; newTestCard.dwTestClass = dwTestClass; newTestCard.dwTestKind = dwTestKind; newTestCard.dwTestHour = dwTestItemTestHour; REQUESTCODE uResponse = REQUESTCODE.EXECUTE_SUCCESS;//m_Request.Reserve.SetTestCard(newTestCard, out newTestCard); //testcard不用管 if (uResponse == REQUESTCODE.EXECUTE_SUCCESS) { UNITESTITEM testItem = new UNITESTITEM(); testItem.dwTestPlanID = uTestPlanID; testItem.szTestPlanName = testplan[0].szTestPlanName; testItem.dwGroupPeopleNum = dwGroupPeopleNum; testItem.szTestName = szTestName; testItem.szMemo = szTestItemMemo; testItem.dwTestClass = dwTestClass; testItem.dwTestKind = dwTestKind; testItem.dwTestHour = dwTestItemTestHour; testItem.dwTestCardID = newTestCard.dwTestCardID; testItem.szTestName = szTestName; uResponse = m_Request.Reserve.SetTestItem(testItem, out testItem); if (uResponse == REQUESTCODE.EXECUTE_SUCCESS) { Response.Write(testItem.dwTestItemID + "," + newTestCard.dwTestCardID); return; } else { if (m_Request.szErrMessage != null) { string szError = m_Request.szErrMessage.ToString(); m_Request.Reserve.DelTestCard(newTestCard); Response.Write("错误:" + szError); return; } else { Response.Write("错误:登陆超时"); return; } } } else { if (m_Request.szErrMessage != null) { Response.Write("错误:" + m_Request.szErrMessage.ToString()); } else { Response.Write("错误:登陆超时"); } } }
protected void Page_Load(object sender, EventArgs e) { m_bRemember = false; Response.CacheControl = "no-cache"; string szOP = Request["op"]; if (szOP == "del") { UNITESTITEM delItem = new UNITESTITEM(); GetHTTPObj(out delItem); if (m_Request.Reserve.DelTestItem(delItem) != REQUESTCODE.EXECUTE_SUCCESS) { Response.Write("Error"); return; } TESTCARD delCard = new TESTCARD(); delCard.dwTestCardID = delItem.dwTestCardID; if (m_Request.Reserve.DelTestCard(delCard) != REQUESTCODE.EXECUTE_SUCCESS) { } Response.Write("OK"); return; } else if (szOP == "set") { TESTCARD vrTestCard = new TESTCARD(); GetHTTPObj(out vrTestCard); if (vrTestCard.dwTestCardID == 0) { vrTestCard.dwTestCardID = null; } TESTCARD vrTestCardRet; if (m_Request.Reserve.SetTestCard(vrTestCard, out vrTestCardRet) == REQUESTCODE.EXECUTE_SUCCESS) { UNITESTITEM vrTestItem = new UNITESTITEM(); UNITESTITEM vrTestItemResult; vrTestItem.dwTestItemID = ToUint(Request["dwTestItemID"]); if (vrTestItem.dwTestItemID == 0) { vrTestItem.dwTestItemID = null; } vrTestItem.dwTestPlanID = ToUint(Request["dwTestPlanID"]); vrTestItem.szTestPlanName = Request["szTestPlanName"]; vrTestItem.dwTotalTestHour = vrTestCardRet.dwTestHour; //vrTestItem.dwTeacherID = ((ADMINLOGINRES)Session["LoginResult"]).AdminInfo.dwAccNo; vrTestItem.dwTestCardID = vrTestCardRet.dwTestCardID; vrTestItem.dwCourseID = ToUint(Request["dwCourseID"]); vrTestItem.dwGroupID = ToUint(Request["dwGroupID"]); vrTestItem.szMemo = vrTestCardRet.szMemo; if (m_Request.Reserve.SetTestItem(vrTestItem, out vrTestItemResult) == REQUESTCODE.EXECUTE_SUCCESS) { } else { Response.Write("Error"); return; } } else { Response.Write("Error"); return; } Response.Write("OK"); return; } else { Response.Write("Error"); } }
private void CheckTestHours(UNITESTITEM test, uint?hour) { //TESTITEMMEMRESV[] rlt = GetTestMemResv(test.dwTestItemID, test.dwTestPlanID, test.dwGroupID, hour); }
protected void Page_Load(object sender, EventArgs e) { m_bRemember = false; UNITESTPLAN vrParameter = new UNITESTPLAN(); GetHTTPObj(out vrParameter); vrParameter.dwKind = (uint)UNITESTPLAN.DWKIND.TESTPLANKIND_TEACHING; if (Request["IsSubmit"] == "true") { UNITESTPLAN vrResult; vrParameter.dwYearTerm = GetTerm(Request["dwYearTerm"]); if (!SetGroupFromClient(ref vrParameter.dwGroupID)) { return; } bool bOK = true; bool SetTestItem = (Request["SetTestItem"] == "true"); if (m_Request.Reserve.SetTestPlan(vrParameter, out vrResult) == REQUESTCODE.EXECUTE_SUCCESS) { if (SetTestItem) { //删除旧的实验项目 TESTITEMREQ vrTestItemReq = new TESTITEMREQ(); UNITESTITEM[] vrTestItemRet; vrTestItemReq.dwGetType = (uint)TESTITEMREQ.DWGETTYPE.TESTITEMGET_BYPLANID; vrTestItemReq.szGetKey = vrResult.dwTestPlanID.ToString(); if (m_Request.Reserve.GetTestItem(vrTestItemReq, out vrTestItemRet) == REQUESTCODE.EXECUTE_SUCCESS) { for (int i = 0; i < vrTestItemRet.Length; i++) { m_Request.Reserve.DelTestItem(vrTestItemRet[i]); } } //添加实验项目 string szItemAllData = Request["ItemAllData"]; if (!string.IsNullOrEmpty(szItemAllData)) { NameValueCollection result = HttpUtility.ParseQueryString(szItemAllData); int ItemDataCount = int.Parse(result["ItemDataCount"]); for (int i = 0; i < ItemDataCount; i++) { string item = result["ItemData" + i]; item = HttpUtility.UrlDecode(item); NameValueCollection testreq = HttpUtility.ParseQueryString(item); TESTCARD vrTestCard = new TESTCARD(); TESTCARD vrTestCardRet; vrTestCard.szTestName = testreq["szTestName"]; vrTestCard.dwGroupPeopleNum = ToUint(testreq["dwGroupPeopleNum"]); vrTestCard.dwTestHour = ToUint(testreq["dwTestHour"]); vrTestCard.szMemo = testreq["szMemo"]; if (m_Request.Reserve.SetTestCard(vrTestCard, out vrTestCardRet) == REQUESTCODE.EXECUTE_SUCCESS) { UNITESTITEM vrTestItem = new UNITESTITEM(); UNITESTITEM vrTestItemResult; vrTestItem.dwTestPlanID = vrResult.dwTestPlanID; vrTestItem.szTestPlanName = vrResult.szTestPlanName; vrTestItem.dwTotalTestHour = vrTestCardRet.dwTestHour; //vrTestItem.dwTeacherID = ((ADMINLOGINRES)Session["LoginResult"]).AdminInfo.dwAccNo; vrTestItem.dwTestCardID = vrTestCardRet.dwTestCardID; vrTestItem.dwCourseID = vrResult.dwCourseID; vrTestItem.dwGroupID = vrResult.dwGroupID; vrTestItem.szMemo = vrTestCardRet.szMemo; if (m_Request.Reserve.SetTestItem(vrTestItem, out vrTestItemResult) == REQUESTCODE.EXECUTE_SUCCESS) { } else { bOK = false; break; } } else { bOK = false; break; } } } } } else { bOK = false; } if (bOK) { MessageBox("添加成功", "添加成功", MSGBOX.SUCCESS, MSGBOX_ACTION.OK); } else { MessageBox("添加失败" + m_Request.szErrMessage, "添加失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE); } } if (Request["op"] == "set" && Request["IsSubmit"] != "true") { TESTPLANREQ vrGetParameter = new TESTPLANREQ(); UNITESTPLAN[] vrGetResult; vrGetParameter.dwGetType = (uint)TESTPLANREQ.DWGETTYPE.TESTPLANGET_BYID; vrGetParameter.szGetKey = Request["id"]; if (m_Request.Reserve.GetTestPlan(vrGetParameter, out vrGetResult) == REQUESTCODE.EXECUTE_SUCCESS && vrGetResult.Length > 0) { vrParameter = vrGetResult[0]; if (vrParameter.dwYearTerm == 0) { vrParameter.dwYearTerm = GetDefaultTerm(null); } //获取班级列表 GROUPREQ vrGroupReq = new GROUPREQ(); UNIGROUP[] vrGroupRet; //vrGroupReq.dwGetType = (uint)GROUPREQ.DWGETTYPE.GROUPGET_BYID; vrGroupReq.dwGroupID = vrParameter.dwGroupID;//.ToString(); if (m_Request.Group.GetGroup(vrGroupReq, out vrGroupRet) == REQUESTCODE.EXECUTE_SUCCESS && vrGroupRet.Length > 0) { for (int i = 0; i < vrGroupRet[0].szMembers.Length; i++) { m_szGroupID += vrGroupRet[0].szMembers[i].dwMemberID + ","; m_szGroupName += vrGroupRet[0].szMembers[i].szName + ","; } } //获取项目列表 TESTITEMREQ vrTestItemReq = new TESTITEMREQ(); UNITESTITEM[] vrTestItemRet; vrTestItemReq.dwGetType = (uint)TESTITEMREQ.DWGETTYPE.TESTITEMGET_BYPLANID; vrTestItemReq.szGetKey = Request["id"]; if (m_Request.Reserve.GetTestItem(vrTestItemReq, out vrTestItemRet) == REQUESTCODE.EXECUTE_SUCCESS) { m_szTestItemJSData = "["; for (int i = 0; i < vrTestItemRet.Length; i++) { m_szTestItemJSData += UniLibrary.ObjHelper.OBJ2JS(vrTestItemRet[i]) + ","; } m_szTestItemJSData += "null]"; } } else { MessageBox("获取失败,无此记录", "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL); } } TranTerm(ref vrParameter.dwYearTerm); PutJSObj(vrParameter); }
protected void cre_course_ServerClick(object sender, EventArgs e) { UNIACCOUNT acc = (UNIACCOUNT)Session["LOGIN_ACCINFO"]; string id = Request["plan_id"]; string name = Request["plan_name"]; string courseId = Request["course_id"]; string courseName = Request["course_name"]; string testHour = Request["test_hour"]; string testNum = Request["test_num"]; string type = Request["type"]; string groupId = Request["group_id"]; string file = Request["up_file"]; string user_kind = Request["user_kind"]; uint? max = ToUInt(Request["mb_max"]); string deadline = Request["deadline"]; UNITESTPLAN para = new UNITESTPLAN(); if (string.IsNullOrEmpty(term_year.Value) || term_year.Value == "0") { MsgBox("请选择学期"); return; } else { para.dwYearTerm = ToUInt(term_year.Value); } if (string.IsNullOrEmpty(courseId) || string.IsNullOrEmpty(courseName)) { MsgBox("请选择课程"); return; } else { para.dwCourseID = ToUInt(courseId); para.szCourseName = courseName; } if (!string.IsNullOrEmpty(user_kind)) { para.dwTesteeKind = ToUInt(user_kind); } if (!string.IsNullOrEmpty(name)) { para.szTestPlanName = name; } if (!string.IsNullOrEmpty(testHour)) { uint tmp = ToUInt(testHour); if (tmp == 0) { MsgBox("请填入正确的学时数"); return; } para.dwTestHour = tmp; } if (!string.IsNullOrEmpty(testNum)) { para.dwTestNum = ToUInt(testNum); } para.dwTeacherID = acc.dwAccNo; if (!string.IsNullOrEmpty(type)) { if (type == "self") { para.dwKind = (uint)UNITESTPLAN.DWKIND.TESTPLANKIND_TEACHFORSELF; } else if (type == "open") { if (max == 0 || string.IsNullOrEmpty(deadline)) { MsgBox("请正确填写班级信息"); return; } para.dwStatus = (uint)UNITESTPLAN.DWSTATUS.TESTPLANSTAT_UNOPEN; para.dwKind = (uint)UNITESTPLAN.DWKIND.TESTPLANKIND_OPEN; } else { para.dwKind = (uint)UNITESTPLAN.DWKIND.TESTPLANKIND_TEACHING; } } if (!string.IsNullOrEmpty(groupId)) { para.dwGroupID = ToUInt(groupId); } else if (max > 0 && !string.IsNullOrEmpty(deadline))//开放实验 组设置 { uint?gId = SetGroup(max, deadline); if (gId == null) { MsgBox("设置班级时出错"); return; } else { para.dwGroupID = gId; } } if (!string.IsNullOrEmpty(id))//修改操作 { para.dwTestPlanID = ToUInt(id); } else//新建操作 { para.szTestPlanName = acc.szTrueName + "_" + courseName; } if (m_Request.Reserve.SetTestPlan(para, out para) == REQUESTCODE.EXECUTE_SUCCESS) { if (!string.IsNullOrEmpty(id)) { MsgBox("修改实验计划成功", "parent.location.reload();"); } else { if (GetConfig("scheduleMode") == "2")//自动创建项目 { UNITESTPLAN plan = GetTestPlanByID(para.dwTestPlanID.ToString()); if (plan.dwTestPlanID != null && plan.dwTestPlanID != 0) { TESTCARD card = new TESTCARD(); card.dwGroupPeopleNum = plan.dwGroupUsers; card.dwTestHour = plan.dwTestHour; card.szTestName = plan.szTestPlanName; if (m_Request.Reserve.SetTestCard(card, out card) == REQUESTCODE.EXECUTE_SUCCESS) { UNITESTITEM test = new UNITESTITEM(); test.dwTestPlanID = plan.dwTestPlanID; test.dwTeacherID = acc.dwAccNo; test.dwTestCardID = card.dwTestCardID; test.dwGroupID = plan.dwGroupID; if (m_Request.Reserve.SetTestItem(test, out test) == REQUESTCODE.EXECUTE_SUCCESS) { MsgBox("创建实验计划成功", "parent.crePlanSuc?parent.crePlanSuc('" + type + "'):parent.location.reload();"); return; } } } MsgBox("创建实验项目时出错:" + m_Request.szErrMsg, "parent.location.reload();"); m_Request.Reserve.DelTestPlan(para); } else { MsgBox("创建实验计划成功", "parent.crePlanSuc?parent.crePlanSuc('" + type + "'):parent.location.reload();"); } } } else { MsgBox(m_Request.szErrMsg); } }