コード例 #1
0
        private void LoadItems()
        {
            BranchTransferItem clsBranchTransferItem = new BranchTransferItem();

            lstItem.DataSource = clsBranchTransferItem.ListAsDataTable(Convert.ToInt64(lblBranchTransferID.Text), "BranchTransferItemID", SortOption.Ascending).DefaultView;
            lstItem.DataBind();
            clsBranchTransferItem.CommitAndDispose();
        }
コード例 #2
0
        private void LoadItems()
        {
            DataClass clsDataClass = new DataClass();

            BranchTransferItem clsBranchTransferItem = new BranchTransferItem();

            lstItem.DataSource = clsBranchTransferItem.ListAsDataTable(Convert.ToInt64(lblBranchTransferID.Text)).DefaultView;
            lstItem.DataBind();
            clsBranchTransferItem.CommitAndDispose();
        }
コード例 #3
0
        private void SetDataSource(ReportDocument Report)
        {
            Int64 iID = 0;

            try
            {
                if (Request.QueryString["task"].ToString().ToLower() == "reportfromposted" && Request.QueryString["branchtransferid"].ToString() != null)
                {
                    iID = Convert.ToInt64(Request.QueryString["branchtransferid"].ToString());
                }
                else
                {
                    iID = Convert.ToInt64(Common.Decrypt(Request.QueryString["branchtransferid"].ToString(), Session.SessionID));
                }
            }
            catch { iID = Convert.ToInt64(Common.Decrypt(lblReferrer.Text.Substring(lblReferrer.Text.IndexOf("branchtransferid") + 13), Session.SessionID)); }

            ReportDataset rptds = new ReportDataset();

            BranchTransfer clsBranchTransfer = new BranchTransfer();

            System.Data.DataTable dt = clsBranchTransfer.ListAsDataTable(iID);
            BranchTransferItem    clsBranchTransferItem = new BranchTransferItem(clsBranchTransfer.Connection, clsBranchTransfer.Transaction);

            System.Data.DataTable dtitems = clsBranchTransferItem.ListAsDataTable(iID);
            clsBranchTransfer.CommitAndDispose();

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

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

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

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

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

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

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