Пример #1
0
        /// <summary>
        /// 收费查询(分页)
        /// </summary>
        /// <param name="pNumber">所在页数</param>
        /// <param name="pRows">每页显示条数</param>
        /// <param name="values">收费项目</param>
        /// <param name="msg">出错信息</param>
        /// <returns>0:成功  大于0:出错  小于0:异常</returns>
        public int DB_PageCharge(int pNumber, int pRows, out ArrayList values, out string msg)
        {
            msg = "";

            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);
            OracleDataReader dr         = null;

            values = new ArrayList();

            try
            {
                int ret = -99;

                long maxrow;
                long minrow;
                General.CalculatePage(pNumber, pRows, out maxrow, out minrow);

                bool _flag = false;

                string findId1 = _builder.GetChargePage(maxrow, minrow, out _flag, out msg);
//                UtilLog.GetInstance().WriteOrderLog("1", findId1);


                if (!_flag)
                {
                    return(10);
                }

                dr = DbHelperOra.ExecuteReader(findId1, connection);

                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        ChargeDetail pd = new ChargeDetail();

                        pd.lx = !dr.IsDBNull(0) ? dr.GetString(0) : "";
                        pd.mc = !dr.IsDBNull(1) ? dr.GetString(1) : "";
                        pd.dw = !dr.IsDBNull(2) ? dr.GetString(2) : "";
                        pd.jg = !dr.IsDBNull(3) ? dr.GetDouble(3) : 0;

                        values.Add(pd);
                    }
                    ret = 0;
                }
                else
                {
                    msg    = "亲,没有记录";
                    values = null;
                    ret    = 2;
                }

                dr.Close();
                return(ret);
            }
            catch (Exception ex)
            {
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex);

                msg    = GetExceptionInfo(ex);;
                values = null;
                return(-99);
            }
            finally
            {
                if (null != dr)
                {
                    dr.Close();
                }
                connection.Close();
            }
        }