protected void Page_Load(object sender, EventArgs e) { USERECREQ vrParameter = new USERECREQ(); string szPID = Request["dwPID"]; DEVUSEREC[] vrResult; GetPageCtrlValue(out vrParameter.szReqExtInfo); if (!IsPostBack) { dwStartDate.Value = DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd"); dwEndDate.Value = DateTime.Now.ToString("yyyy-MM-dd"); } vrParameter.dwStartDate = DateToUint(dwStartDate.Value); vrParameter.dwEndDate = DateToUint(dwEndDate.Value); string szKey = Request["szGetKey"]; if (szKey != null && szKey != "") { //vrParameter.dwGetType = (uint)REPORTREQ.DWGETTYPE.USERECGET_BYDEVID; vrParameter.dwDevID = Parse(szKey); } else { //vrParameter.dwGetType = (uint)REPORTREQ.DWGETTYPE.USERECGET_BYALL; } if (vrParameter.szReqExtInfo.szOrderKey == null || vrParameter.szReqExtInfo.szOrderKey == "") { vrParameter.szReqExtInfo.szOrderKey = "dwBeginTime"; vrParameter.szReqExtInfo.szOrderMode = "desc"; } vrParameter.dwClassKind = (uint)UNIDEVCLS.DWKIND.CLSKIND_LOAN; UNIACCOUNT account = new UNIACCOUNT(); if (szPID != null && GetAccByLogonName(szPID, out account)) { vrParameter.dwAccNo = account.dwAccNo; } vrParameter.dwPurpose = (uint)UNIRESERVE.DWPURPOSE.USEFOR_LOAN; if (m_Request.Report.GetUseRec(vrParameter, out vrResult) == REQUESTCODE.EXECUTE_SUCCESS) { for (int i = 0; i < vrResult.Length; i++) { m_szOut += "<tr>"; m_szOut += "<td>" + vrResult[i].szDevName.ToString() + "</td>"; m_szOut += "<td>" + vrResult[i].szKindName + "</td>"; m_szOut += "<td>" + vrResult[i].szModel + "</td>"; m_szOut += "<td>" + vrResult[i].szSpecification + "</td>"; m_szOut += "<td>" + vrResult[i].szLabName + "</td>"; m_szOut += "<td>" + vrResult[i].szTrueName + "(" + vrResult[i].szPID + ")" + "</td>"; m_szOut += "<td>" + vrResult[i].szDeptName + "</td>"; m_szOut += "<td>" + Get1970Date(vrResult[i].dwBeginTime, "MM-dd HH:mm") + "-" + Get1970Date(vrResult[i].dwEndTime, "MM-dd HH:mm") + "</td>"; m_szOut += "<td>" + GetMinToStr(vrResult[i].dwUseTime) + "</td>"; m_szOut += "</tr>"; } UpdatePageCtrl(m_Request.Report); } PutBackValue(); }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { USERECREQ vrParameter = new USERECREQ(); string szPID = Request["dwPID"]; DEVUSEREC[] vrResult; string szKey = Request["szGetKey"]; if (szKey != null && szKey != "") { vrParameter.dwDevID = Parse(szKey); } if (vrParameter.szReqExtInfo.szOrderKey == null || vrParameter.szReqExtInfo.szOrderKey == "") { vrParameter.szReqExtInfo.szOrderKey = "dwBeginTime"; vrParameter.szReqExtInfo.szOrderMode = "desc"; } vrParameter.dwStartDate = DateToUint(Request["startdate"]); vrParameter.dwEndDate = DateToUint(Request["enddate"]); uint uKindID = Parse(Request["dwDevKind"]); if (uKindID != null && uKindID != 0) { vrParameter.dwDevKind = uKindID; } vrParameter.dwClassKind = (uint)UNIDEVCLS.DWKIND.CLSKIND_SEAT; UNIACCOUNT account = new UNIACCOUNT(); if (szPID != null && szPID != "" && GetAccByLogonName(szPID, out account)) { vrParameter.dwAccNo = account.dwAccNo; } GetPageCtrlValue(out vrParameter.szReqExtInfo); vrParameter.szReqExtInfo.dwNeedLines = 100000; vrParameter.szReqExtInfo.dwStartLine = 0; if (m_Request.Report.GetUseRec(vrParameter, out vrResult) == REQUESTCODE.EXECUTE_SUCCESS) { System.IO.StringWriter swCSV = new System.IO.StringWriter(); swCSV.WriteLine("座位名称,类型,所属区域,使用人,部门,使用时间,使用时长"); for (int i = 0; i < vrResult.Length; i++) { System.Text.StringBuilder sbText = new System.Text.StringBuilder(); string szValue = "\"" + ((char)(9)).ToString() + vrResult[i].szDevName.ToString() + "\""; sbText = AppendCSVFields(sbText, szValue); szValue = "\"" + ((char)(9)).ToString() + vrResult[i].szKindName + "\""; sbText = AppendCSVFields(sbText, szValue); szValue = "\"" + ((char)(9)).ToString() + vrResult[i].szLabName.ToString() + "\""; sbText = AppendCSVFields(sbText, szValue); szValue = "\"" + ((char)(9)).ToString() + vrResult[i].szTrueName + "(" + vrResult[i].szPID + ")" + "\""; sbText = AppendCSVFields(sbText, szValue); szValue = "\"" + ((char)(9)).ToString() + (vrResult[i].szDeptName) + "\""; sbText = AppendCSVFields(sbText, szValue); szValue = "\"" + ((char)(9)).ToString() + Get1970Date(vrResult[i].dwBeginTime, "MM-dd HH:mm") + "-" + Get1970Date(vrResult[i].dwEndTime, "MM-dd HH:mm") + "\""; sbText = AppendCSVFields(sbText, szValue); szValue = "\"" + ((char)(9)).ToString() + GetMinToStr(vrResult[i].dwUseTime) + "\""; sbText = AppendCSVFields(sbText, szValue); sbText.Remove(sbText.Length - 1, 1); swCSV.WriteLine(sbText.ToString()); } DownloadFile(Response, swCSV.GetStringBuilder(), "ativityplan.csv"); swCSV.Close(); Response.End(); } } }
protected void Page_Load(object sender, EventArgs e) { USERECREQ vrParameter = new USERECREQ(); string szPID = Request["dwPID"]; DEVUSEREC[] vrResult; GetPageCtrlValue(out vrParameter.szReqExtInfo); if (!IsPostBack) { dwStartDate.Value = DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd"); dwEndDate.Value = DateTime.Now.ToString("yyyy-MM-dd"); } vrParameter.dwStartDate = DateToUint(dwStartDate.Value); vrParameter.dwEndDate = DateToUint(dwEndDate.Value); string szKey = Request["szGetKey"]; if (szKey != null && szKey != "") { //vrParameter.dwGetType = (uint)REPORTREQ.DWGETTYPE.USERECGET_BYDEVID; vrParameter.dwDevID = Parse(szKey); } if (vrParameter.szReqExtInfo.szOrderKey == null || vrParameter.szReqExtInfo.szOrderKey == "") { vrParameter.szReqExtInfo.szOrderKey = "dwBeginTime"; vrParameter.szReqExtInfo.szOrderMode = "desc"; } UNIDEVKIND[] RoomKind = GetDevKindByKind((uint)UNIDEVCLS.DWKIND.CLSKIND_COMMONS); szKindStr += GetInputItemHtml(CONSTHTML.radioButton, "dwDevKind", "全部", "0", true); if (RoomKind != null && RoomKind.Length > 0) { for (int i = 0; i < RoomKind.Length; i++) { szKindStr += GetInputItemHtml(CONSTHTML.radioButton, "dwDevKind", RoomKind[i].szKindName.ToString(), RoomKind[i].dwKindID.ToString()); } } uint uKindID = Parse(Request["dwDevKind"]); if (uKindID != null && uKindID != 0) { vrParameter.dwDevKind = uKindID; } vrParameter.dwClassKind = (uint)UNIDEVCLS.DWKIND.CLSKIND_COMMONS; UNIACCOUNT account = new UNIACCOUNT(); if (szPID != null && szPID != "" && GetAccByLogonName(szPID, out account)) { vrParameter.dwAccNo = account.dwAccNo; } if (m_Request.Report.GetUseRec(vrParameter, out vrResult) == REQUESTCODE.EXECUTE_SUCCESS) { for (int i = 0; i < vrResult.Length; i++) { m_szOut += "<tr>"; m_szOut += "<td>" + vrResult[i].szDevName.ToString() + "</td>"; m_szOut += "<td>" + vrResult[i].szKindName + "</td>"; m_szOut += "<td>" + vrResult[i].szLabName + "</td>"; m_szOut += "<td>" + vrResult[i].szTrueName + "(" + vrResult[i].szPID + ")" + "</td>"; m_szOut += "<td>" + vrResult[i].szDeptName + "</td>"; m_szOut += "<td>" + Get1970Date(vrResult[i].dwBeginTime, "MM-dd HH:mm") + "-" + Get1970Date(vrResult[i].dwEndTime, "MM-dd HH:mm") + "</td>"; m_szOut += "<td>" + GetMinToStr(vrResult[i].dwUseTime) + "</td>"; m_szOut += "</tr>"; } UpdatePageCtrl(m_Request.Report); } PutBackValue(); }
protected void Page_Load(object sender, EventArgs e) { USERECREQ vrParameter = new USERECREQ(); string szPID = Request["dwPID"]; DEVUSEREC[] vrResult; GetPageCtrlValue(out vrParameter.szReqExtInfo); if (!IsPostBack) { dwStartDate.Value = DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd"); dwEndDate.Value = DateTime.Now.ToString("yyyy-MM-dd"); } string szMAC = Request["szMAC"]; if (szMAC != null && szMAC != "") { vrParameter.szMAC = szMAC; } vrParameter.dwStartDate = DateToUint(dwStartDate.Value); vrParameter.dwEndDate = DateToUint(dwEndDate.Value); string szKey = Request["szGetKey"]; if (szKey != null && szKey != "") { //vrParameter.dwGetType = (uint)REPORTREQ.DWGETTYPE.USERECGET_BYDEVID; vrParameter.dwDevID = Parse(szKey); } if (vrParameter.szReqExtInfo.szOrderKey == null || vrParameter.szReqExtInfo.szOrderKey == "") { vrParameter.szReqExtInfo.szOrderKey = "dwBeginTime"; vrParameter.szReqExtInfo.szOrderMode = "desc"; } UNIACCOUNT account = new UNIACCOUNT(); if (szPID != null && szPID != "" && GetAccByLogonName(szPID, out account)) { vrParameter.dwAccNo = account.dwAccNo; } // vrParameter.dwPurpose = (uint)UNIRESERVE.DWPURPOSE.USEFOR_PERSONNAL; if (m_Request.Report.GetUseRec(vrParameter, out vrResult) == REQUESTCODE.EXECUTE_SUCCESS) { for (int i = 0; i < vrResult.Length; i++) { m_szOut += "<tr>"; //m_szOut += "<td class='lnkDevice' data-id=" + vrResult[i].dwSID.ToString() + ">" + vrResult[i].dwDevSN + "</td>"; m_szOut += "<td class='lnkDevice' data-id=" + vrResult[i].dwSID.ToString() + ">" + vrResult[i].szDevName.ToString() + "</td>"; m_szOut += "<td>" + vrResult[i].szClassName.ToString() + "</td>"; // m_szOut += "<td class='lnkTeacher'>" + vrResult[i].szAttendantName.ToString() + "</td>"; string szDevMode = vrResult[i].szModel + "/" + vrResult[i].szSpecification; string szModeRes = ""; if (GetMinStr(szDevMode, out szModeRes)) { // m_szOut += "<td title=\"" + szDevMode + "\">" + szModeRes + "</td>"; } else { // m_szOut += "<td>" + szModeRes + "</td>"; } m_szOut += "<td>" + vrResult[i].szRoomName + "</td>"; m_szOut += "<td>" + vrResult[i].szLabName + "</td>"; m_szOut += "<td>" + vrResult[i].szTrueName + "(" + vrResult[i].szPID + ")" + "</td>"; // m_szOut += "<td>" + vrResult[i].szTutorName + "</td>"; m_szOut += "<td>" + vrResult[i].szDeptName + "</td>"; m_szOut += "<td>" + vrResult[i].szMAC + "</td>"; m_szOut += "<td>" + Get1970Date(vrResult[i].dwBeginTime, "MM-dd HH:mm") + "-" + Get1970Date(vrResult[i].dwEndTime, "MM-dd HH:mm") + "</td>"; m_szOut += "<td>" + GetMinToStr(vrResult[i].dwUseTime) + "</td>"; m_szOut += "</tr>"; } UpdatePageCtrl(m_Request.Report); } PutBackValue(); }