예제 #1
0
        static public List <CheckLog> GetData(string from, string to)
        {
            CheckLogConnector sc             = new CheckLogConnector();
            string            dbFromDateTime = SQLDBConnector.CovertDateToDB(SQLDBConnector.ConvertStringToDate(from));
            string            dbToDateTime   = SQLDBConnector.CovertDateToDB(SQLDBConnector.ConvertStringToDate(to));
            List <CheckLog>   result         = sc.SelectAllData(dbFromDateTime, dbToDateTime);

            return(result);
        }
예제 #2
0
        public void MakeTransaction(bool status)
        {
            DateTime now        = DateTime.Now;
            DateTime expiryDate = now.AddDays(this.ItemCategory.Duration);

            this.CheckoutDate = SQLDBConnector.CovertDateToDB(now);
            this.ExpiryDate   = SQLDBConnector.CovertDateToDB(expiryDate);
            ItemConnector sc = new ItemConnector();

            if (status)
            {
                sc.UpdateItem(this.Barcode, this.Barcode, this.ItemDescription, status, this.ItemCategory.CategoryName, "NULL", "NULL", "NULL", this.Initial);
                CheckLog.TransactionItem(this.StudentNo, this.Barcode, this.ItemDescription, this.Initial, status, "NULL");
            }
            else
            {
                sc.UpdateItem(this.Barcode, this.Barcode, this.ItemDescription, status, this.ItemCategory.CategoryName, this.StudentNo, this.CheckoutDate, this.ExpiryDate, this.Initial);
                CheckLog.TransactionItem(this.StudentNo, this.Barcode, this.ItemDescription, this.Initial, status, this.ExpiryDate);
            }
            //CheckLog cl = new CheckLog();
        }