Пример #1
0
        private void SetDataSource(ReportDocument Report)
        {
            long iID = 0;

            try
            {
                if (Request.QueryString["task"].ToString().ToLower() == "reportfromposted" && Request.QueryString["memoid"].ToString() != null)
                {
                    iID = Convert.ToInt64(Request.QueryString["memoid"].ToString());
                }
                else
                {
                    iID = Convert.ToInt64(Common.Decrypt(Request.QueryString["memoid"].ToString(), Session.SessionID));
                }
                lblReferrer.ToolTip = iID.ToString();
            }
            catch { iID = long.Parse(lblReferrer.ToolTip); }

            ReportDataset rptds = new ReportDataset();

            DebitMemos clsDebitMemos = new DebitMemos();

            System.Data.DataTable dt = clsDebitMemos.ListAsDataTable(DebitMemoID: iID);

            DebitMemoItems clsDebitMemoItems = new DebitMemoItems(clsDebitMemos.Connection, clsDebitMemos.Transaction);

            System.Data.DataTable dtitems = clsDebitMemoItems.ListAsDataTable(DebitMemoID: iID);

            clsDebitMemos.CommitAndDispose();

            foreach (System.Data.DataRow dr in dt.Rows)
            {
                DataRow drNew = rptds.DebitMemo.NewRow();

                foreach (DataColumn dc in rptds.DebitMemo.Columns)
                {
                    drNew[dc] = dr[dc.ColumnName];
                }

                rptds.DebitMemo.Rows.Add(drNew);
            }

            foreach (System.Data.DataRow dr in dtitems.Rows)
            {
                DataRow drNew = rptds.DebitMemoItem.NewRow();

                foreach (DataColumn dc in rptds.DebitMemoItem.Columns)
                {
                    drNew[dc] = dr[dc.ColumnName];
                }

                rptds.DebitMemoItem.Rows.Add(drNew);
            }

            Report.SetDataSource(rptds);
            SetParameters(Report);
        }
Пример #2
0
        private void LoadItems()
        {
            DataClass clsDataClass = new DataClass();

            DebitMemoItems clsDebitMemoItems = new DebitMemoItems();

            lstItem.DataSource = clsDebitMemoItems.ListAsDataTable(Convert.ToInt64(lblDebitMemoID.Text)).DefaultView;
            lstItem.DataBind();
            clsDebitMemoItems.CommitAndDispose();
        }