Beispiel #1
0
        public List <object> GetRowReport(ReportViewer rpt)
        {
            var objDataEngine = new FleetDataEngine(AccessMode.CustomerService, DBType.Maint);


            try
            {
                objDataEngine.InitiateConnection();

                SqlParameter[] Parameters = new SqlParameter[3];

                Parameters[0] = string.IsNullOrEmpty(rpt.SelectedRptType) ? new SqlParameter("@RptType", DBNull.Value) : new SqlParameter("@RptType", rpt.SelectedRptType);
                Parameters[1] = string.IsNullOrEmpty(rpt.RefKey) ? new SqlParameter("@RefKey", DBNull.Value) : new SqlParameter("@RefKey", rpt.RefKey);
                Parameters[2] = new SqlParameter("@RptDate", ConvertDatetimeDB(rpt.Date));
                var           Collector = objDataEngine.FillDataSet("WebRptViewer", CommandType.StoredProcedure, Parameters);
                var           datarow   = Collector.Tables[0].AsEnumerable().ToList();
                List <object> Rows      = new List <object>();
                foreach (var x in datarow)
                {
                    Rows.Add(x.ItemArray);
                }
                return(Rows);
            }
            finally
            {
                objDataEngine.CloseConnection();
            }
        }
Beispiel #2
0
        public object GetReport(ReportViewer rpt)
        {
            var objDataEngine = new FleetDataEngine(AccessMode.Admin, DBType.Maint);

            try
            {
                objDataEngine.InitiateConnection();
                SqlParameter[] Parameters = new SqlParameter[3];
                Parameters[0] = string.IsNullOrEmpty(rpt.SelectedRptType) ? new SqlParameter("@RptType", DBNull.Value) : new SqlParameter("@RptType", rpt.SelectedRptType);
                Parameters[1] = string.IsNullOrEmpty(rpt.RefKey) ? new SqlParameter("@RefKey", DBNull.Value) : new SqlParameter("@RefKey", rpt.RefKey);
                Parameters[2] = new SqlParameter("@RptDate", ConvertDatetimeDB(rpt.Date));
                var Collector   = objDataEngine.FillDataSet("WebRptViewer", CommandType.StoredProcedure, Parameters);
                var objDataInfo = GetInfo(Collector.Tables[0]);
                //  var objListTable = CloneTable(Collector.Tables[0], 2000);
                return(objDataInfo);
            }
            finally
            {
                objDataEngine.CloseConnection();
            }
        }