public bool GetDeptByID(string szDeptID, out UNIDEPT dept) { dept = new UNIDEPT(); UNIDEPT[] vrResult; if (Session["DeptList"] == null) { vrResult = GetAllDept(); } else { vrResult = (UNIDEPT[])Session["DeptList"]; } if (vrResult != null && vrResult.Length > 0) { for (int i = 0; i < vrResult.Length; i++) { if (vrResult[i].dwID.ToString() == szDeptID) { dept = vrResult[i]; return(true); } } } return(false); }
private void InitDept() { DEPTREQ req = new DEPTREQ(); UNIDEPT[] rlt; if (m_Request.Account.DeptGet(req, out rlt) == REQUESTCODE.EXECUTE_SUCCESS) { for (int i = 0; i < rlt.Length; i++) { UNIDEPT dept = rlt[i]; itemList += "<li it='dept' url=\"../a/courselist.aspx?deptId=" + dept.dwID + "&deptName=" + Server.UrlEncode(dept.szName) + "\"><a><span>" + dept.szName + "</span></a></li>"; } } }
public bool GetDeptByName(string szName, out UNIDEPT dept) { dept = new UNIDEPT(); DEPTREQ vrParameter = new DEPTREQ(); UNIDEPT[] vrResult; vrParameter.szName = szName; vrParameter.dwKind = (uint)ConfigConst.GCDeptKind; if (m_Request.Account.DeptGet(vrParameter, out vrResult) == REQUESTCODE.EXECUTE_SUCCESS && vrResult != null && vrResult.Length > 0) { dept = vrResult[0]; return(true); } return(false); }
private string GetDept() { DEPTREQ req = new DEPTREQ(); UNIDEPT[] rlt; string ret = ""; if (m_Request.Account.DeptGet(req, out rlt) == REQUESTCODE.EXECUTE_SUCCESS) { ret += "<li class='nav_cls_li'><ul class='it_list nav'>"; for (int i = 0; i < rlt.Length; i++) { UNIDEPT dept = rlt[i]; ret += "<li class='it' it='dept' url=\"../a/courselist.aspx?deptId=" + dept.dwID + "&deptName=" + Server.UrlEncode(dept.szName) + "\"><a><span>" + dept.szName + "</span></a></li>"; } ret += "</ul></li>"; } else { MsgBox(m_Request.szErrMsg); } return(ret); }
protected void Page_Load(object sender, EventArgs e) { uint uYearTerm = 20131401; if ((((ADMINLOGINRES)Session["LoginResult"]).dwManRole & (uint)ADMINLOGINRES.DWMANROLE.MANROLE_LEADER) > 0) { bLeader = true; } REQUESTCODE uResponse = REQUESTCODE.EXECUTE_FAIL; DEVLISTREQ vrParameter = new DEVLISTREQ(); DEVLIST[] vrResult; GetPageCtrlValue(out vrParameter.szReqExtInfo); string szValue = Request["changeInfo"]; string opSub = Request["opSub"]; if (IsPostBack && opSub == "1") { vrParameter.dwReportStat = (uint)DEVLIST.DWREPORTSTAT.REPORTSTAT_SAVE; vrParameter.dwYearTerm = uYearTerm; uResponse = m_Request.Report.GetDevList(vrParameter, out vrResult); if (uResponse == REQUESTCODE.EXECUTE_SUCCESS && vrResult != null && vrResult.Length > 0) { for (int i = 0; i < vrResult.Length; i++) { DEVLIST setValue2 = vrResult[i]; setValue2.dwReportStat = (uint)DEVLIST.DWREPORTSTAT.REPORTSTAT_DEPLOY; m_Request.Report.SetDevList(setValue2); } } } if (IsPostBack && szValue != "" && opSub != "1") { szValue = szValue.Substring(0, szValue.Length - 1); szValue = "[" + szValue + "]"; List <devListSet> devlist = JsonConvert.DeserializeObject <List <devListSet> >(szValue); for (int i = 0; i < devlist.Count; i++) { UNIDEPT setDept = new UNIDEPT(); DEVLIST setValueObj = new DEVLIST(); devListSet temp = (devListSet)devlist[i]; setValueObj.dwReportStat = (uint)DEVLIST.DWREPORTSTAT.REPORTSTAT_SAVE; setValueObj.dwDevID = temp.dwDevID; if (temp.dwStatCode != 0) { setValueObj.dwStatCode = temp.dwStatCode; } setValueObj.dwYearTerm = uYearTerm; if (temp.szDeptSN != "") { if (GetDeptBySN(temp.szDeptSN, out setDept)) { setValueObj.dwDeptID = setDept.dwID; } } else { setValueObj.szDeptSN = null; } m_Request.Report.SetDevList(setValueObj); } } vrParameter.dwReportStat = (uint)DEVLIST.DWREPORTSTAT.REPORTSTAT_SAVE; vrParameter.dwYearTerm = uYearTerm; uResponse = m_Request.Report.GetDevList(vrParameter, out vrResult); if (uResponse == REQUESTCODE.EXECUTE_SUCCESS && vrResult != null && vrResult.Length > 0) { for (int i = 0; i < vrResult.Length; i++) { m_szOut += "<tr>"; m_szOut += "<td data-labid='" + vrResult[i].dwLabID.ToString() + "' data-YearTerm='" + vrResult[i].dwYearTerm.ToString() + "' data-id='" + vrResult[i].dwDevID.ToString() + "'>" + ConfigConst.GCSchoolCode.ToString() + "</td>"; m_szOut += "<td>" + vrResult[i].szAssertSN.ToString() + "</td>"; m_szOut += "<td>" + vrResult[i].szClassSN.ToString() + "</td>"; m_szOut += "<td>" + vrResult[i].szDevName.ToString() + "</td>"; m_szOut += "<td>" + vrResult[i].szModel.ToString() + "</td>"; m_szOut += "<td>" + vrResult[i].szSpecification.ToString() + "</td>"; m_szOut += "<td>" + vrResult[i].dwComeFrom.ToString() + "</td>"; m_szOut += "<td>" + vrResult[i].dwNationCode.ToString() + "</td>"; m_szOut += "<td>" + vrResult[i].dwUnitPrice.ToString() + "</td>"; m_szOut += "<td>" + GetDateStr((uint)vrResult[i].dwPurchaseDate) + "</td>"; m_szOut += "<td class='tdSet' data-type='dwStatCode'>" + vrResult[i].dwStatCode + "</td>"; uint uDevPropery = (uint)vrResult[i].dwComeFrom; if ((uDevPropery & (uint)UNIDEVICE.DWPROPERTY.DEVPROP_FORTEACHING) > 0) { m_szOut += "<td>" + "调整" + "</td>"; } else if ((uDevPropery & (uint)UNIDEVICE.DWPROPERTY.DEVPROP_FORRESEARCH) > 0) { m_szOut += "<td>" + "调整" + "</td>"; } else { m_szOut += "<td>" + "" + "</td>"; } m_szOut += "<td data-type='szDeptSN'>" + vrResult[i].szDeptSN.ToString() + "</td>"; m_szOut += "<td>" + vrResult[i].szDeptName.ToString() + "</td>"; m_szOut += "</tr>"; } UpdatePageCtrl(m_Request.Report); } PutBackValue(); }