示例#1
0
        public static FORMBarrowedBooks  Instance()
        {
            if (sForm == null)
            {
                sForm = new FORMBarrowedBooks();
            }

            return(sForm);
        }
示例#2
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (components != null)
         {
             components.Dispose();
         }
     }
     base.Dispose(disposing);
     sForm = null;
 }
示例#3
0
        private void FORMBarrowedBooks_Load(object sender, System.EventArgs e)
        {
            //Set Images
            setImages();

            //Set the Data Adapter
            daBarrowedList = new OleDbDataAdapter("", clsConnections.CN);

            //Set the Combo Box
            sFunctions.FillCombo(cbYear, "SELECT tblSchoolYear.IndexSY, [YearStart] & ' - ' & [YearEnd] AS SY FROM tblSchoolYear ORDER BY [YearStart] & ' - ' & [YearEnd] ASC", "tblSchoolYear", 1);
            sFunctions.FillCombo(cbLevel, "SELECT * FROM tblLevel ORDER BY LevelName ASC", "tblLevel", 1);

            //Set the Tab Control
            setTabControl();

            //Load List of Barrowed Books
            loadBarrowed("SELECT tblBooks.BookNo, tblBooks.BookTitle, tblBarrowers.BarrowerID, [LastName] & ', ' & [FirstName] & ' ' & [MiddleName] AS Fullname, tblBarrowed.DateBarrowed, tblBarrowed.DateDue, tblCategory.CategoryName, tblLevel.LevelName, [YearStart] & ' - ' & [YearEnd] AS SY FROM (tblSchoolYear RIGHT JOIN (tblLevel RIGHT JOIN tblBarrowers ON tblLevel.IndexLevel = tblBarrowers.LevelIndex) ON tblSchoolYear.IndexSY = tblBarrowers.SchoolYear) RIGHT JOIN (tblCategory INNER JOIN (tblBooks INNER JOIN tblBarrowed ON tblBooks.BookNo = tblBarrowed.BookNo) ON tblCategory.IndexCategory = tblBooks.CategoryIndex) ON tblBarrowers.BarrowerID = tblBarrowed.BarrowerID WHERE [YearStart] & ' - ' & [YearEnd] LIKE '" + cbYear.Text + "' AND tblLevel.LevelName LIKE '" + cbLevel.Text + "' AND (tblBarrowed.Returned)=No ORDER BY tblBooks.BookNo ASC");

            publicBarrowedList = this;
        }