Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        REQUESTCODE  uResponse   = REQUESTCODE.EXECUTE_FAIL;
        RTUSESTATREQ vrParameter = new RTUSESTATREQ();

        RTUSESTAT[] vrResult;
        GetPageCtrlValue(out vrParameter.szReqExtInfo);
        vrParameter.dwStartDate = DateToUint(Request["dwStartDate"]);
        vrParameter.dwEndDate   = DateToUint(Request["dwEndDate"]);
        uResponse = m_Request.Report.GetRTUseStat(vrParameter, out vrResult);
        if (uResponse == REQUESTCODE.EXECUTE_SUCCESS && vrResult != null && vrResult.Length > 0)
        {
            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();
                sbText = AppendCSVFields(sbText, vrResult[i].szStatName.ToString());
                sbText = AppendCSVFields(sbText, vrResult[i].szExtName);
                sbText = AppendCSVFields(sbText, vrResult[i].dwResvTimes.ToString());
                sbText = AppendCSVFields(sbText, vrResult[i].dwResvMinutes.ToString());
                sbText = AppendCSVFields(sbText, vrResult[i].dwSampleNum.ToString());  //
                sbText = AppendCSVFields(sbText, vrResult[i].dwRealCost.ToString());
                sbText = AppendCSVFields(sbText, vrResult[i].dwDevUseFee.ToString());  //协助
                sbText = AppendCSVFields(sbText, vrResult[i].dwSampleFee.ToString());  ////使用
                sbText = AppendCSVFields(sbText, vrResult[i].dwEntrustFee.ToString()); //样品费


                sbText.Remove(sbText.Length - 1, 1);

                //写datatable的一行
                swCSV.WriteLine(sbText.ToString());
            }
            DownloadFile(Response, swCSV.GetStringBuilder(), "devUseFeeTotal.csv");
            swCSV.Close();
            Response.End();
        }
    }
Пример #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        REQUESTCODE  uResponse   = REQUESTCODE.EXECUTE_FAIL;
        RTUSESTATREQ vrParameter = new RTUSESTATREQ();

        RTUSESTAT[] vrResult;
        GetPageCtrlValue(out vrParameter.szReqExtInfo);
        if (!IsPostBack)
        {
            dwStartDate.Value = DateTime.Now.AddDays(-30).ToString("yyyy-MM-dd");
            dwEndDate.Value   = DateTime.Now.ToString("yyyy-MM-dd");
        }
        UNIDEPT[] dept = GetAllDept();
        if (dept != null)
        {
            szDept += GetInputItemHtml(CONSTHTML.option, "", "全部", "0");
            for (int i = 0; i < dept.Length; i++)
            {
                szDept += GetInputItemHtml(CONSTHTML.option, "", dept[i].szName, dept[i].dwID.ToString());
            }
        }
        uint uDeptID = Parse(Request["deptid"]);

        if (uDeptID != 0)
        {
            vrParameter.dwDeptID = uDeptID;
        }
        vrParameter.dwStartDate = DateToUint(dwStartDate.Value);
        vrParameter.dwEndDate   = DateToUint(dwEndDate.Value);
        uResponse = m_Request.Report.GetRTUseStat(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 class=\"devTd\" data-id=\"" + vrResult[i].dwStatID.ToString() + "\"><a>" + vrResult[i].szStatName.ToString() + "</a></td>";
                m_szOut += "<td>" + vrResult[i].szExtName + "</td>";
                m_szOut += "<td>" + vrResult[i].dwResvTimes.ToString() + "</td>";
                uint uUseTime = (uint)vrResult[i].dwResvMinutes;

                m_szOut += "<td>" + uUseTime / 60 + "小时" + uUseTime % 60 + "分钟" + "</td>";
                m_szOut += "<td>" + vrResult[i].dwSampleNum.ToString() + "</td>";//
                m_szOut += "<td>" + GetFee(vrResult[i].dwRealCost) + "</td>";

                m_szOut += "<td>" + GetFee(vrResult[i].dwDevUseFee) + "</td>";  //

                m_szOut += "<td>" + GetFee(vrResult[i].dwSampleFee) + "</td>";  ////

                m_szOut += "<td>" + GetFee(vrResult[i].dwEntrustFee) + "</td>"; //
                m_szOut += "</tr>";
            }
            {
                UpdatePageCtrl(m_Request.Report);
                REQEXTINFExt ext;
                m_Request.Report.UTPeekDetail(out ext);

                m_szOut += "<tr>";

                m_szOut += "<td colspan='2'>" + "合计" + "</td>";
                m_szOut += "<td>" + ext.szExtInfo.dwResvTimes.ToString() + "</td>";
                uint uUseTime = (uint)ext.szExtInfo.dwResvMinutes;

                m_szOut += "<td>" + uUseTime / 60 + "小时" + uUseTime % 60 + "分钟" + "</td>";
                m_szOut += "<td>" + ext.szExtInfo.dwSampleNum.ToString() + "</td>";//
                m_szOut += "<td>" + GetFee(ext.szExtInfo.dwRealCost) + "</td>";

                m_szOut += "<td>" + GetFee(ext.szExtInfo.dwDevUseFee) + "</td>";  //

                m_szOut += "<td>" + GetFee(ext.szExtInfo.dwSampleFee) + "</td>";  ////

                m_szOut += "<td>" + GetFee(ext.szExtInfo.dwEntrustFee) + "</td>"; //
                m_szOut += "</tr>";
            }
        }

        PutBackValue();
    }