コード例 #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Lib24Entities ctx         = new Lib24Entities();
            var           maxTrans    = ctx.BookIssueds.Max(x => x.TransactionNo);
            var           qryReceipt1 = from x in ctx.BookIssueds where x.TransactionNo == maxTrans select new
            {
                x.TransactionNo,
                x.ISBN,
                x.BookTitle,
                x.DateBorrow,
                x.DateDue,
                DateActualReturn = x.DateActualReturn ?? DateTime.MinValue,
            };
            var qryReceipt2    = from x in ctx.IssueTrans where x.TransactionNo == maxTrans select x.CustomerID;
            int qryReceipt2CId = qryReceipt2.First();

            var    qryReceipt3      = from x in ctx.LibraryMembers where x.CustomerID == qryReceipt2CId select x.CustomerName;
            string qryReceipt3CName = qryReceipt3.First();

            CrystalReport1 cr1 = new CrystalReport1();

            cr1.SetDataSource(qryReceipt1);
            cr1.SetParameterValue("pMemberName", qryReceipt3CName);

            crystalReportViewer1.ReportSource = cr1; //CrystalReport3 TransactionReceipt
        }
コード例 #2
0
        private void BooksByGenre_Load(object sender, EventArgs e)
        {
            Lib24Entities ctx = new Lib24Entities();

            var qrybooklist = from x in ctx.BookLists select x;

            BookGenre crBG = new BookGenre();

            crBG.SetDataSource(qrybooklist);
            crystalReportViewer1.ReportSource = crBG;
        }
コード例 #3
0
        private void MemberOverdueForm_Load(object sender, EventArgs e)
        {
            Lib24Entities ctx = new Lib24Entities();

            var qryOverdue = from x in ctx.DueTrans select new
            {
                x.DueTranID,
                x.CustomerID,
                DueAmount = x.DueAmount ?? 0,
                Remarks   = x.Remarks ?? "",
            };


            MembersOverdue crMO = new MembersOverdue();

            crMO.SetDataSource(qryOverdue);
            crystalReportViewer1.ReportSource = crMO;
        }
コード例 #4
0
        private void BookTime_Load(object sender, EventArgs e)
        {
            Lib24Entities ctx = new Lib24Entities();

            var qrytime = from x in ctx.BookIssueds
                          select new
            {
                x.TransactionNo,
                x.ISBN,
                x.BookTitle,
                x.DateBorrow,
                x.DateDue,
                DateActualReturn = x.DateActualReturn ?? DateTime.MinValue,
            };

            BookBorrowTrend crBBT = new BookBorrowTrend();

            crBBT.SetDataSource(qrytime);
            crystalReportViewer1.ReportSource = crBBT;
        }