Ejemplo n.º 1
0
        public Peminjaman returnLend(string username, string lendId)
        {
            Peminjaman temp = new Peminjaman();

            query = $"SELECT * FROM Lendings WHERE Username = '******' AND LendId ='{lendId}'";
            SqlDataReader sdr;
            SqlCommand    command = new SqlCommand(query, sqlConn);

            sqlConn.Open();
            sdr = command.ExecuteReader();

            //Get value
            sdr.Read();
            temp.lendId      = sdr.GetString(0).Trim();
            temp.username    = sdr.GetString(1).Trim();
            temp.bookId      = sdr.GetString(2).Trim();
            temp.strLendDate = sdr.GetString(3).Trim();
            temp.strDueDate  = sdr.GetString(4).Trim();
            temp.converToDateTime();
            temp.fineCount();
            //return class
            sqlConn.Close();
            return(temp);
        }