Esempio n. 1
0
		private void SetDataSource(ReportDocument Report)
		{
            long iID = 0;
            try
            {
                if (Request.QueryString["task"].ToString().ToLower() == "reportfromposted" && Request.QueryString["transferoutid"].ToString() != null)
                { iID = Convert.ToInt64(Request.QueryString["transferoutid"].ToString()); }
                else
                { iID = Convert.ToInt64(Common.Decrypt(Request.QueryString["transferoutid"].ToString(), Session.SessionID)); }
            }
            catch { iID = Convert.ToInt64(Common.Decrypt(lblReferrer.Text.Substring(lblReferrer.Text.IndexOf("transferoutid") + 14), Session.SessionID)); }

			ReportDataset rptds = new ReportDataset();

			TransferOut clsTransferOut = new TransferOut();
			MySqlDataReader myreader = clsTransferOut.List(iID, "TransferOutID", SortOption.Ascending);
            
			while(myreader.Read())
			{
				DataRow drNew = rptds.TransferOut.NewRow();
				
				foreach (DataColumn dc in rptds.TransferOut.Columns)
					drNew[dc] = "" + myreader[dc.ColumnName]; 
				
				rptds.TransferOut.Rows.Add(drNew);
			}
            myreader.Close();

            TransferOutItem clsTransferOutItem = new TransferOutItem(clsTransferOut.Connection, clsTransferOut.Transaction);
            MySqlDataReader myreaderitems = clsTransferOutItem.List(iID, "TransferOutItemID", SortOption.Ascending);
			while(myreaderitems.Read())
			{
				DataRow drNew = rptds.TransferOutItems.NewRow();
				
				foreach (DataColumn dc in rptds.TransferOutItems.Columns)
					drNew[dc] = "" + myreaderitems[dc.ColumnName]; 
				
				rptds.TransferOutItems.Rows.Add(drNew);
			}
            myreaderitems.Close();
            clsTransferOut.CommitAndDispose();

			Report.SetDataSource(rptds); 
			SetParameters(Report);
		}